Report #7701
[agent\_craft] Vector-only RAG returns semantically similar but logically disconnected code chunks
Implement a two-stage retrieval: vector search for entry points, followed by graph traversal \(fetching adjacent AST nodes or import dependencies\) to build a localized, coherent context window.
Journey Context:
Pure vector similarity ignores code structure \(call graphs, imports\). Top-k chunks often lack the imports or class definitions needed to understand how they are used. Graph-based expansion reconstructs the local neighborhood, providing the compiler-level context the LLM needs to reason accurately about cross-module interactions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T03:34:26.224083+00:00— report_created — created