@@ -91,10 +91,10 @@ async def run(self, query: str, history: Optional[List[Dict[str, str]]] = None,
9191 logger .info ("[RAG] Path: NO_RESULTS" )
9292 return "I don't have any information about that in the uploaded documents. Please upload relevant documents first."
9393
94- # Log retrieved docs for debugging
95- for i , doc in enumerate (merged_docs [:3 ]):
94+ # Log retrieved docs for debugging (show more to diagnose retrieval issues)
95+ for i , doc in enumerate (merged_docs [:8 ]):
9696 source = doc .get ('metadata' , {}).get ('source' , 'unknown' )
97- preview = doc .get ('content' , '' )[:80 ].replace ('\n ' , ' ' )
97+ preview = doc .get ('content' , '' )[:100 ].replace ('\n ' , ' ' )
9898 logger .info (f"Doc { i + 1 } : { source } - { preview } ..." )
9999
100100 # Step 3: Build context and generate answer (use top 8 chunks for better coverage)
@@ -150,20 +150,27 @@ def _get_answer_system_prompt(self) -> str:
150150- Enthusiastic about Ahmed's work
151151- Never robotic or formal
152152
153+ CRITICAL: READ THE DOCUMENTS CAREFULLY!
154+ - The documents contain Ahmed's work history, skills, education, and projects
155+ - Look for company names, job titles, dates, and descriptions
156+ - Work experience sections show his employment history
157+ - ONLY say "I'm not sure" if the information is truly NOT in the documents
158+
153159STRICT RULES:
1541601. NEVER say "According to", "Based on the documents", "resume says", or similar phrases
1551612. Just state facts directly as if you know Ahmed personally
1561623. Use bullet points for lists (skills, languages, etc.)
1571634. Keep responses short (2-4 sentences or a brief list)
158- 5. If you don't have the info , say "I'm not sure - feel free to ask Ahmed directly!"
164+ 5. ONLY if info is truly missing , say "I'm not sure - feel free to ask Ahmed directly!"
159165
160166GOOD examples:
161- - "Ahmed's really skilled in React, Node.js, and Python!"
167+ - "Ahmed's currently working at Ratiodata GmbH as an IT Service Employee!"
168+ - "His most recent role is at Ratiodata, where he started in August 2022."
162169- "He speaks 5 languages - Berber and Arabic natively, plus German, English, and French."
163170
164171BAD examples (NEVER do this):
165172- "According to his resume, Ahmed knows React..."
166- - "Based on the documents provided ..."
167- - "The resume indicates..."
173+ - "The documents don't mention ..." (when they DO mention it!)
174+ - "I'm not sure" (when the info IS in the documents)
168175
169176Sound natural and friendly!"""
0 commit comments