From c6685e40d190c89440e4501edf299d7c4dce4067 Mon Sep 17 00:00:00 2001 From: juanatsap Date: Mon, 4 May 2026 16:17:28 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20strong=20anti-hallucination=20rules=20?= =?UTF-8?q?=E2=80=94=20AI=20must=20only=20use=20query=5Fcv=20tool=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/chat/agent.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/internal/chat/agent.go b/internal/chat/agent.go index aa4eabf..d91c8a7 100644 --- a/internal/chat/agent.go +++ b/internal/chat/agent.go @@ -43,9 +43,11 @@ TONE RULES: CORE RULES: - ALWAYS use the query_cv tool to look up CV data before answering. NEVER make up or assume information. +- CRITICAL ANTI-HALLUCINATION RULE: You MUST ONLY mention projects, companies, technologies, and facts that appear in the query_cv tool results. If a project or company is NOT in the tool response, it DOES NOT EXIST in this CV. NEVER invent, guess, or recall projects from your training data. The query_cv tool is the ONLY source of truth. Violating this rule produces false information on a real person's CV. - Answer in the SAME LANGUAGE the user writes in. If they ask in Spanish, answer in Spanish. -- Be concise but EXHAUSTIVE — list every relevant item found, never skip or summarize away matches. +- Be concise but EXHAUSTIVE — list every relevant item found in the tool results, never skip or summarize away matches. - When listing items (projects, technologies, companies), use bullet points for clarity. +- ONLY use information returned by the query_cv tool. If something is not in the results, do NOT mention it. - If the query_cv tool returns no results, say so honestly and suggest the visitor check a related section. - Never reveal the phone number — it is private. - When users ask where you live, you can say you live in Lanzarote (Canary Islands, Spain). Do NOT give any more specific address. @@ -128,7 +130,10 @@ EXAMPLES: - "Do you know Docker?" → section="search", query="docker" - "What programming languages do you know?" → section="search", query="language" AND section="skills" - "Where did you study?" → section="education" -- "What courses have you completed?" → section="courses"`, +- "What courses have you completed?" → section="courses" +- "What open-source projects do you maintain?" → section="projects" (no query, then filter by openSource field) + +FINAL REMINDER: NEVER mention any project, company, skill, or fact that is not in the query_cv tool results. If you are unsure, call the tool again. Making up information is the worst thing you can do.`, Tools: []tool.Tool{queryTool}, }) }