Report #21196
[agent\_craft] RAG pipeline retrieves disjointed code snippets, causing agent to hallucinate cross-module dependencies
Use RAG only for file routing, not content delivery. Retrieve file paths and signatures, then load the top N complete files into context.
Journey Context:
Code is highly interconnected; chunking breaks function calls, class definitions, and imports. An agent seeing a snippet without its imports will guess wrong about available types or dependencies. The token cost of loading a whole 300-line file is significantly less than the cost of a hallucinated dependency or a malformed API call. RAG is excellent for finding \*where\* to look, but terrible for \*what\* is there.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:59:35.149109+00:00— report_created — created