Explainers · measured July 2026
RAG, a live index, or grep? The retrieval map for code.
There are three ways an AI agent pulls your code into context: semantic embeddings (RAG), a live index, or brute-force grep. They win and lose in different places: RAG is fuzzy and drifts, grep is exact but slow, an index is exact, fast, and fresh. This is the map: what each is for, when to use which, and why the fast-exact-fresh lane is the one most setups are missing.
The three lanes
Two different questions. Three tools.
Start with the question you're actually asking. RAG answers “what is this about?” It retrieves by meaning, approximately. Grep and a live index answer “where is this exact thing?” They match literal text. That split decides the lane; speed and freshness decide the rest.
Bars are relative across lanes: longer is better on that axis (faster, fresher, more exact). RAG is the odd lane out: it's the only one answering by meaning, which is exactly why it runs parallel to the other two, not against them.
A decision guide
Reach for the right lane.
Where the other two break
RAG drifts. Grep crawls.
Embeddings are a snapshot of meaning. Rename a function, refactor a module, add a file, and the vectors keep pointing at the old meaning until you re-embed. Retrieval is nearest-neighbor (approximate by design), so it's superb for discovery and shaky at “did I catch every exact call site?” Drift is the tax you pay for meaning.
Grep reads the real bytes every time, so it's never stale and never wrong about what's literally there. The catch is that it re-walks the disk on every query. On the benchmark machine one content query took 93.8 s; the same query on a live index returned in 16 ms. Fine for one folder, punishing across a whole machine, run after run.
A live index keeps grep's exactness and grep's freshness (a save is searchable in about a millisecond, under 30 ms in the worst case), and adds the one thing grep can't: it answers before the disk walk, because the walk already happened.
The measured lane · Ryzen 9 9950X3D · 4.47M files
Exact retrieval at memory speed.
| The tool | The task | Time | vs Interlinked |
|---|---|---|---|
| Interlinked (live index) | one indexed lookup | 85 μs | baseline |
| VS Code · Ctrl+P | same file, same drive | 35 s | 412,000× |
| Windows Search | median of 20 queries | 67 s | ~480,000× |
That's the filename lane. On the content lane the story repeats: queries run 7 to 9 ms typical (exact phrases ~16 ms), 58,625× faster than ripgrep on the heaviest query, same files, same machine.
Methodology: Ryzen 9 9950X3D · 64 GB DDR5 · NVMe · Windows 11 · 4,470,000 files. Filename figures are medians: 139 μs across 20 queries, 85 μs single-file; content queries run 7 to 9 ms typical (exact phrases ~16 ms). At rest the engine sits near 44 MB in Task Manager, and the on-disk index is under 1% of the drive (~24 GB on a 4 TB machine).
The thesis
Keep your vector database. Add the exact lane under it.
RAG and a live index aren't rivals: they answer different questions, so they belong in the same stack. Point embeddings at meaning, where fuzzy recall is the feature. Point the index at the exact file, symbol, string, or error message, whole-machine, across every repo and the files git ignores, fresh to the last save. No model in the loop: every hit is a literal match you can verify, not a ranked guess. And the same index carries something no per-repo vector store can see: a machine-wide relationship layer it builds itself. Interlinked is the exact-retrieval lane. It replaces neither your model nor your vector DB; it runs parallel to both.
PARALLEL TO RAG · EXACT, FAST, FRESH · NO MODEL IN THE LOOP.
Do this today
Give every agent the exact lane.
Install once. One signed installer auto-configures 19 AI clients: Claude Code, Cursor, Codex, Windsurf, Zed, Cline and the rest. No JSON to edit.
Point each lane at its job. Keep RAG for meaning. Hand the agent the exact lane for names, symbols, strings and error messages, whole-machine, fresh to the last save. At rest the engine sits near 44 MB.
Scope when you know, sweep when you don’t. Whole-machine when you have no idea where something lives; scoped to a folder when you do. Scoped queries return in microseconds.
Let it stay fresh. Save a file and it’s searchable in about a millisecond. No re-embedding, no re-index step, no drift.
Everything local is free forever, on all your devices, no card. Hosting starts at $5.99/mo. Download for Windows.