Report #15821
[agent\_craft] Agent retrieves entire files or large chunks via RAG, diluting its reasoning and causing hallucinations or ignoring the actual target code
Implement a two-stage retrieval: first retrieve file/chunk paths and metadata \(routing\), then retrieve specific line ranges or functions only when the agent decides to read them. Never dump whole files blindly into context.
Journey Context:
Coding agents often use vector search to find relevant files and inject the top 5 files wholesale. This fills the context with boilerplate and distractors. A file-level router followed by on-demand line-level retrieval keeps the context lean and focused on the actual task.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:11:27.986996+00:00— report_created — created