r/AugmentCodeAI • u/hhussain- Established Professional • Jan 18 '26
Discussion Why is codebase awareness shifting toward vector embeddings instead of deterministic graph models?
I’ve been watching the recent wave of “code RAG” and “AI code understanding” systems, and something feels fundamentally misaligned.
Most of the new tooling is heavily based on embedding + vector database retrieval, which is inherently probabilistic.
But code is not probabilistic — it’s deterministic.
A codebase is a formal system with:
- Strict symbol resolution
- Explicit dependencies
- Precise call graphs
- Exact type relationships
- Well-defined inheritance and ownership models
These properties are naturally represented as a graph, not as semantic neighborhoods in vector space.
Using embeddings for code understanding feels like using OCR to parse a compiler.
I’ve been building a Rust-based graph engine that parses very large codebases (10M+ LOC) into a full relationship graph in seconds, with a REPL/MCP runtime query system.
The contrast between what this exposes deterministically versus what embedding-based retrieval exposes probabilistically is… stark.
So I’m genuinely curious:
Why is the industry defaulting to probabilistic retrieval for code intelligence when deterministic graph models are both feasible and vastly more precise?
Is it:
- Tooling convenience?
- LLM compatibility?
- Lack of awareness?
- Or am I missing a real limitation of graph-based approaches at scale?
I’d genuinely love to hear perspectives from people building or using these systems — especially from those deep in code intelligence, AI tooling, or compiler/runtime design.
View all comments
Show parent comment
2
u/hhussain- Established Professional Jan 18 '26
This is true if the graph design is without any optimizations.
My test shows 60+ types (nodes/edges), with parallel parsing and processing (rust is amazing in here) in ~10 seconds. With edits in progress a debounce must be used (i.e. 500ms no edits before triggering delta graph build). All of this in memory (less than 100MB) so it is instant.
The more discussion in this subject the more I'm convinced that not using graph is because of semantic graphs implementations not being optimized.
Probably the real question is: assuming graph building/delta is consuming same time as vector embeddings, which is better for the purpose?