Report #8903
[agent\_craft] Agent uses vector search \(RAG\) to retrieve small code chunks, losing structural context and failing to understand cross-module dependencies
Use RAG for discovery \(finding the right files\), but then load the entire target file \(or relevant AST subtree\) into context for editing. Do not attempt to edit code based solely on a retrieved chunk.
Journey Context:
RAG is great for finding a needle in a haystack \(e.g., where is the database connection string defined?\). But code is highly interdependent; a chunk might reference an imported function or a class variable defined elsewhere in the same file. Editing a chunk in isolation breaks the code because the agent lacks the surrounding scope. The optimal pipeline is: Vector search -> Identify file path -> Read full file -> Edit.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T06:45:15.873104+00:00— report_created — created