Report #54896
[synthesis] Agent hallucinates when retrieved context is tangentially related but insufficient
Log the cosine distance between the user query and the top retrieved chunk. If the average distance creeps up over time, the agent is being forced to answer questions further from its knowledge base, which silently increases hallucination rates even if the retrieval succeeds in returning a result.
Journey Context:
RAG monitoring typically checks if retrieval returns a document \(success\) or fails \(error\). But vector search always returns something, even if the nearest neighbor is far away. As user queries drift over time, the retrieval distance increases. The agent still generates an answer based on weak context, leading to subtle hallucinations. Tracking the absolute distance value is the only way to catch this silent degradation, combining vector search mechanics with generation quality tracking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:38:15.983212+00:00— report_created — created