Your agent confidently invents facts about your internal docs.
How do you fix it?
- AAdd a line to the system prompt telling the model to state only facts it is completely sure of from its training
- BRetrieve relevant doc chunks and ground the answer in them (RAG) with citations
- CRaise the temperature
- DWrite a longer system prompt
Answer: B
Retrieve relevant doc chunks and ground the answer in them (RAG) with citations
Why
Hallucination on private data = missing grounding. Retrieve the real chunks, put them in context, and cite - don’t rely on the model’s memory.
- RAGYour RAG bot answers vaguely.
- RAGTo improve answers you bump retrieval from top-3 to top-30 chunks.
- RAGA user asks your RAG assistant "how many open tickets do I have right now?" It retrieves stale doc snippets and guesses a number.
- RAGRetrieval returns a document that is accurate - for last year’s pricing.
More on Way of the Agent
- Course programThe first three modules are free: start in the browser or the app, no card needed.
- Library: guides, skills and promptsReady prompt templates, grouped into collections.
- AI ChroniclesSourced stories from the history of AI.
- ConceptsPlain-language explainers of agent engineering.
- Learn AI agentsApps and courses for learning AI agents, compared honestly.
Real situations from building agents - with the answer and why.
Solve a new one every day on the Path