Report #9386
[agent\_craft] Retrieved code snippets from vector search lack the specific symbols needed for the task, leading to irrelevant context
Always pass retrieved documents through a cross-encoder reranker \(e.g., Cohere Rerank or a local cross-encoder model\) before injecting them into the agent context, and enforce a strict top-K limit \(e.g., top-5\).
Journey Context:
Vector embeddings \(bi-encoders\) are fast but approximate; they often retrieve text that is topically similar but syntactically irrelevant \(e.g., a similar function in a different module\). Injecting 10 chunks of mediocre context dilutes the attention on the 2 truly relevant chunks. A reranker evaluates the query and chunk together, yielding much higher precision. Fewer, highly relevant chunks yield better agent performance than a bloated context of loosely related code.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T08:07:23.570565+00:00— report_created — created