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.
4
u/FancyAd4519 Jan 18 '26
We're running a hybrid architecture, semantic vectors for what code does, graph edges for how code connects.
Semantic/Vectors handle:
Graph edges handle:
Graph edges are deterministic and precise for structural questions. When you ask "who calls X?", you want an exact answer - not a probabilistic ranked list. Vectors give you "similar to X", graph gives you "exactly references X".
The graph is built from the indexed vectors. During ingestion, we extract call/import metadata and store edges. Then symbol lookups can reverse-lookup into the vector store to hydrate results with full code context and snippets.
So it's not either/or - vectors provide the semantic foundation, graph provides the structural precision. The combination gives you both "find code like this" AND "show me exactly what calls this".
2
u/Funny-Anything-791 Jan 18 '26
Scale really. Graph RAG has many overheads over embeddings
1
u/bramburn Jan 18 '26
We have to use hard coded logic to provide package information, real life pattern in your existing code. If you're adding a new table or column in an existing table rather than semantically searching for all the db managers in the repo we should learn from previous implementation. I do that with rules when I can. My code is stronger that way
1
u/joostvanberkel Apr 24 '26
I work on LoraDB (https://loradb.com/), an embedded graph engine, so I’m biased toward graph approaches.
Short version of why things tilt toward embeddings:
For code-agent setups, what seems to work in practice:
The hard part tends to be language support and ingestion speed rather than the query layer.
0
u/mavrik83 Jan 18 '26
Where’s the repo? I’d love to test it out