Report #5718
[agent\_craft] RAG pipeline retrieves too many loosely related code chunks, drowning the agent in low-signal context
Optimize the retriever for precision over recall, and implement a two-stage retrieval: first retrieve broadly, then use a lightweight LLM call or exact-match heuristic to filter out chunks that don't share symbols with the current task before injecting into the main agent context.
Journey Context:
Standard RAG advice focuses on recall—getting all possibly relevant documents. For coding agents, this is backwards. A single highly relevant function definition is worth more than ten loosely related files. Injecting low-signal chunks displaces high-signal context and confuses the model. The tradeoff is that aggressive filtering might miss a crucial dependency, but this can be mitigated by allowing the agent to explicitly request more context if its initial attempt fails.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:05:09.945711+00:00— report_created — created