By Sagar Shankaran, Founder of CallSphere
RAG was the wrong abstraction for code. Code-Review-Graph builds a deterministic AST graph in SQLite — no embeddings required, no chunking artifacts, no vector DB tax.
Key takeaways
Half the AI coding industry is rebuilding RAG pipelines for code. Vector DBs, chunkers, hybrid retrievers — every conference talk is an architecture diagram with seven boxes. Code-Review-Graph took the opposite bet: parse the code with Tree-sitter, store the AST in SQLite, query it with structural traversal. The result outperforms RAG on every code-relevant metric.
flowchart TB
SRC[Source files
23 languages] --> TS[Tree-sitter parser]
TS --> AST[Abstract Syntax Trees]
AST --> EXT[Node + Edge extractor]
EXT --> N[Nodes:
functions, classes,
imports, modules]
EXT --> E[Edges:
calls, inherits,
imports, tests]
N --> DB[(SQLite +
FTS5 index)]
E --> DB
DB --> Q1[Structural queries
callers / callees / tests]
DB --> Q2[Full-text search
name / signature]
DB --> Q3[Optional vector search
semantic similarity]
Q1 & Q2 & Q3 --> AGENT[Agent context]
style DB fill:#0ea5e9,stroke:#0369a1,color:#fff
style AGENT fill:#a855f7,stroke:#7e22ce,color:#fff
LSP gives you semantic precision per language but requires a running server per project. Tree-sitter gives you a uniform AST across 23 languages — Python, TypeScript, Go, Rust, Java, Ruby, C, C++, C#, Kotlin, Swift, Lua, PHP, even Jupyter notebooks and Perl XS files — with a single dependency tree and offline operation.
For a tool that needs to ship to anyone's laptop and parse any repo, Tree-sitter is the only sane choice.
Graph databases assume your graph is the product. For Code-Review-Graph, the graph is metadata. SQLite gives you transactional updates, FTS5 full-text search, sub-millisecond queries on millions of rows, and a single file you can ignore-list in .gitignore.
For export, the tool does emit Neo4j Cypher, GraphML, and Obsidian wikilink vaults. But the operational store is SQLite — and that is why incremental rebuilds on a 1,122-file FastAPI repo finish in 128ms.
Hear it before you finish reading
Talk to a live CallSphere AI voice agent in your browser — 60 seconds, no signup.
| Property | RAG | Code-Review-Graph |
|---|---|---|
| Retrieval primitive | Embedding similarity | Structural graph traversal |
| Determinism | Probabilistic ranking | Exact graph queries |
| Recall on impact | ~70% (chunk artifacts) | 100% |
| Index size | GB-scale vector store | Tens of MB SQLite |
| Update cost | Re-embed chunks | Re-parse changed files |
| Failure mode | Hallucinated retrieval | Empty result set |
Natural-language search across docstrings, README files, design docs — those are similarity tasks. Code-Review-Graph supports optional vector embeddings exactly for this case. The hybrid approach gives you structural precision and semantic search, with the graph as the trustworthy core.
If the rest of your AI stack rebuilt this fast, you would not be reading articles about token costs.
If you've spent any real time with tree-sitter + SQLite = The Anti-RAG, you already know the cost curve bites before the quality curve. Token spend, latency tail, and tool-call retries compound long before users complain about answer quality. The teams that ship fastest treat tree-sitter + sqlite = the anti-rag as an evals problem first and a modeling problem second. They write the failure cases into the regression set on day one, not after the first incident.
Agentic AI in a real call center is a different beast than a single-LLM chatbot. Instead of one model answering one prompt, you orchestrate a small team: a router that decides intent, specialists that own a vertical (booking, intake, billing, escalation), and tools that read and write to the same Postgres your CRM trusts. Hand-offs are where most production bugs hide — when Agent A passes context to Agent B, anything that isn't explicit in the message gets lost, and the user feels it as the agent "forgetting." That's why the systems that hold up under load are the ones with typed tool schemas, deterministic state stored outside the conversation, and a hard ceiling on tool calls per session. The cost story is just as important: a multi-agent loop can quietly burn 10x the tokens of a single-LLM design if you let it think out loud at every step. The fix isn't a smarter model, it's smaller agents, shorter prompts, cached system messages, and evals that fail the build when p95 latency or per-session cost regresses. CallSphere runs this pattern across 6 verticals in production, and the rule has held every time: the agent you can debug in five minutes will out-survive the agent that's "smarter" on a benchmark.
Q: What's the hardest part of running tree-sitter + SQLite = The Anti-RAG live?
Still reading? Stop comparing — try CallSphere live.
CallSphere ships complete AI voice agents per industry — 14 tools for healthcare, 10 agents for real estate, 4 specialists for salons. See how it actually handles a call before you book a demo.
A: Scaling comes from constraint, not capability. The deployments that hold up keep each agent narrow, cap tool calls per turn, cache the system prompt, and pin a smaller model for routing while reserving the larger model for synthesis. CallSphere's stack — 37 agents · 90+ tools · 115+ DB tables · 6 verticals live — is sized that way on purpose.
Q: How do you evaluate tree-sitter + SQLite = The Anti-RAG before shipping?
A: Hard ceilings beat heuristics. A maximum step count, an idempotency key on every tool call, and a fallback to a deterministic script when confidence drops below a threshold are what keep the loop bounded. Evals that simulate noisy inputs catch the rest before they reach a real caller.
Q: Which CallSphere verticals already rely on tree-sitter + SQLite = The Anti-RAG?
A: It's already in production. Today CallSphere runs this pattern in IT Helpdesk and Real Estate, alongside the other live verticals (Healthcare, Real Estate, Salon, Sales, After-Hours Escalation, IT Helpdesk). The same orchestrator code path serves voice and chat — the difference is the tool set the router exposes.
Want to see sales agents handle real traffic? Spin up a walkthrough at https://sales.callsphere.tech or grab 20 minutes on the calendar: https://calendly.com/sagar-callsphere/new-meeting.
Written by
Sagar Shankaran· Founder, CallSphere
Sagar Shankaran is the founder of CallSphere, where he builds production AI voice and chat agents deployed across healthcare, hospitality, real estate, and home services. He writes about agentic AI, LLM engineering, and shipping voice agents that handle real calls in production.
See how AI voice agents work for your industry. Live demo available -- no signup required.
A founder's guide to building a chatbot for answering questions on your website: RAG, voice, and how CallSphere ships one in 3-5 days.
Graphiti is the open-source temporal knowledge graph for AI agents in 2026. Learn how bi-temporal memory beats vector RAG for voice agents and long-running LLMs.
A founder's guide on how to create a chatbot in 2026. Build options, AI stack, integration patterns, and when buying a managed agent wins over building.
The 2026 desktop AI agent landscape — ServiceNow Project Arc, Anthropic Claude offerings, OpenAI agents, and Google Mariner. A buyer's map.
Haystack 2.7's Agent component plus an Ollama-served Llama 3.2 gives you tool-calling RAG with citations. Here's a complete pipeline against your own document store.
Beyond single-shot RAG — agentic RAG with LangGraph that re-retrieves, self-grades, and rewrites queries. With evals that catch silent retrieval drift.
© 2026 CallSphere LLC. All rights reserved.