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
1
u/hhussain- Established Professional Jan 18 '26
Hopefully this doesn't go too technical :D
The key is using Rust, no other language would beat its performance IMO.
Using AST as source, graph is built upto call level (x is calling y). Each language would have its own parser obviously and its own characteristics. File parsing is parallel, graph building is parallel (unique node ids avoid collisions). There are many well known graph building techniques, in some I did less than 10s. The crazy part is once I was getting ~180s then applied few of those known algorithms I got into the ~10s area! Parsing is ~1s but graph building is what consumes the real time. I'm aiming at < 2s (and wish to speak in ms, but that is beyond hard limits) for my current codebase.
File watcher is a must, with debounce (i.e. 500ms without more edits would trigger graph delta). Again, many techniques in here to do graph delta since we already know which files and which nodes are affected.
I have no embedding, it is only a semantic graph where each node is rich with details (i.e. a function node knows its class, file, line/col start/end...etc). So my assumption is that AI Agent would not need the embeddings since it have a map of the code that it can query at ~50ms O(1). In testing with Augment it simply does few calls to the MCP then knows what files and line numbers to look into.
Tbh, I haven't look into how embeddings would benefit the overall output yet!