Report #21626
[frontier] Naive RAG over code returns disconnected snippets missing structural dependencies
Replace naive vector search with GraphRAG or AST-based retrieval. Use static analysis like Tree-sitter to build a code graph, then retrieve the subgraph \(definition, callers, and imports\) rather than just the text chunk.
Journey Context:
Vector search is fast but semantically weak for code where precision and structural context matter. A function's meaning depends heavily on its types and callers. GraphRAG and AST retrieval are slower to index but yield compilable, context-rich snippets, drastically reducing hallucinated APIs and broken code modifications.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T14:42:48.999553+00:00— report_created — created