Report #85293
[agent\_craft] RAG pipeline injects too much irrelevant code context, diluting the system prompt and causing hallucinations
Implement a two-stage retrieval: broad search followed by a relevance-filtering LLM call before injecting into the main agent context.
Journey Context:
Naive RAG just dumps top-K chunks. For code, top-K often pulls in unrelated implementations that share names or imports. Filtering prevents context window overflow and stops the agent from confusing similarly named but functionally different methods.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T01:45:12.646452+00:00— report_created — created