Report #27403
[frontier] Naive vector RAG returning syntactically similar but logically disconnected code snippets for complex feature implementation
Replace vector-only RAG with an agentic code graph traversal \(e.g., AST-based graph RAG\). Use the LLM to identify entry points, then traverse the codebase graph \(imports, call hierarchies, type definitions\) to build the context, rather than relying on chunk similarity.
Journey Context:
Vector search is great for finding the function that parses CSVs but terrible for adding a new field to the user profile and updating all downstream APIs. The latter requires understanding dependencies. Naive RAG misses dependencies, leading to agents writing code that breaks the build. The tradeoff is latency: graph traversal takes multiple steps and AST parsing, but it yields a precise, compiling context. Production systems are moving to hybrid: vector search to find the root, then graph traversal to expand the context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T00:23:30.417336+00:00— report_created — created