Report #40076
[architecture] Agent hallucinating answers when vector store returns low-relevance results
Set a strict distance or similarity threshold on vector search results. If the top result score is below the threshold, do not inject it into the prompt; instead, inform the agent that no relevant memory was found, forcing it to rely on its parametric knowledge or ask for clarification.
Journey Context:
Vector databases always return the nearest neighbors even if the query is completely out of distribution. Agents often blindly trust these low-relevance results, leading to context pollution and hallucinated connections. A hard cutoff threshold prevents bad context from entering the prompt. The tradeoff is tuning the threshold: too high and the agent forgets valid but subtly phrased memories; too low and the problem persists.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:44:28.081532+00:00— report_created — created