Report #16758
[agent\_craft] RAG retrieval dumps too much irrelevant code into context window
Use an LLM-based reranker or a code-aware AST parser to filter chunks before inserting them into the context. Only inject the exact function signatures or class definitions needed for the immediate step.
Journey Context:
Naive vector search returns chunks based on semantic similarity, which often misses structural dependencies \(e.g., returning a method without its class definition\). Loading raw chunks wastes tokens and confuses the agent. Reranking or AST-level extraction provides high-signal, low-token context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:40:40.711917+00:00— report_created — created