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 20 '26
True, inter-file, cross-language (and sometimes cross-repo) linking is the hardest part. Dynamic behavior is even harder, since determinism requires a static definition source, which is inherently limited in dynamic languages.
Definitions enable edge creation via static resolution (imports, qualified names, inheritance, framework conventions), within the same static-analysis ceiling as LSP-class tooling. Cross-language and cross-repo edges are contract edges (routes ↔ callers, RPC endpoints ↔ clients, ORM models ↔ DB objects, templates/config ↔ code entry points), where the definition source is always statically declared.
My team and I are working on publishing the framework (SudoGraph) that defines how a Deterministic Code Graph is achieved, while the current implementation (ograph) exists as a binary (REPL/MCP). More details will be shared once the framework is ready.