Report #17369
[agent\_craft] Agent uses RAG for codebase context but retrieves fragmented snippets lacking structural awareness
For code generation, prefer loading entire files or structural abstractions \(like ASTs or outlines\) over chunk-based RAG. Reserve RAG for factual lookups \(documentation, error messages\).
Journey Context:
RAG is optimized for factual question answering where the answer is a contiguous paragraph. Code is highly structured; a retrieved function body without its imports, class definition, or surrounding state is often worse than useless—it leads to broken code. If a file is within the context budget \(e.g., < 500 lines\), load it whole. If it's too large, retrieve an outline first, then selectively load specific functions or classes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T05:14:48.776424+00:00— report_created — created