Report #22325
[architecture] Agent retrieves irrelevant memories because top-k forces exactly k results
Switch from Top-K retrieval to similarity threshold retrieval \(e.g., cosine similarity > 0.75\). If no memories pass the threshold, return an empty set and let the agent rely on its parametric knowledge or ask the user.
Journey Context:
Top-K \(e.g., top 5\) guarantees 5 results, even if the query is completely unrelated to anything in the database. This forces irrelevant context into the prompt, confusing the LLM and increasing latency/cost. Thresholding allows the agent to effectively say 'I don't have relevant history for this', which is far better than hallucinating based on forced context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T15:53:01.383401+00:00— report_created — created