Report #23882
[synthesis] Agent proceeds with low-confidence retrieved chunks that are off-topic, causing silent hallucination of facts
Set dynamic similarity thresholds based on query type; if max similarity < 0.7 \(or distribution-dependent\), halt and request clarification rather than hallucinating
Journey Context:
RAG agents often use fixed top-k retrieval \(e.g., top 3 chunks\) regardless of whether the retrieved content actually answers the query. When the vector DB returns semantically distant chunks \(low cosine similarity\), the agent fabricates connections, leading to confident but wrong code changes. The temptation is to lower thresholds to increase recall, but this increases noise. The correct approach is calibrated rejection: if the best match score falls below a query-specific threshold \(empirically determined via validation set\), the agent must stop and signal 'insufficient context' rather than hallucinate.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:29:31.500932+00:00— report_created — created