Interlinked.

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.

FUZZY RECALL“what is this about?”EXACT RETRIEVAL“where is this exact thing?”RAG / EMBEDDINGSe.g. Pinecone-style vector searchMATCHESMEANINGsemantic, nearest-neighborSPEEDembed + network hopFRESHNESSre-embed to updateEXACTNESSapproximate by designBEST WHENyou don’t know the wordsLIVE INDEXInterlinked FilesMATCHESLITERAL TEXTnames + file contentsSPEED85 μs to 10 msFRESHNESS~1 ms after a saveEXACTNESSliteral, deterministicBEST WHENyou need it exact, fast, freshGREP / RIPGREPe.g. ripgrep, grepMATCHESLITERAL TEXTregex over raw bytesSPEEDwalks the disk / queryFRESHNESSreads bytes nowEXACTNESSliteral, deterministicBEST WHENone-off, no index, any regex

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.

RAG / embeddings
Fuzzy recall
Pinecone-style vector search
REACH FOR IT WHEN
+you don’t know the exact terms
+you want conceptually similar code across files and languages
+discovery: “explain this area,” “what handles auth?”
+approximate recall over a large corpus is acceptable
WEAK WHEN you need the exact call site, the current bytes, or a symbol that just changed: it ranks by similarity, and vectors lag the code until re-embedded.
Live index
Exact retrieval
Interlinked Files
REACH FOR IT WHEN
+you know roughly what you want: a name, symbol, string, error message
+you need it now, inside an agent loop
+you need it fresh to the last save
+you need whole-machine scope, across every repo and the files git ignores
WEAK WHEN the query is purely conceptual with no shared literal token: that’s RAG’s job, not the index’s.
grep / ripgrep
Brute force
ripgrep, grep
REACH FOR IT WHEN
+it’s a one-off you won’t repeat
+you’re inside a single folder
+you need arbitrary regex
+you don’t want to maintain an index at all
WEAK WHEN the corpus is large or machine-wide, or you run the same class of query again and again: it re-walks the disk every single time.

Where the other two break

RAG drifts. Grep crawls.

THE FUZZY LANE · DRIFT

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.

THE BRUTE LANE · SCALE

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.

85 μs
one file, straight from the index (best case 2 μs)
139 μs
median of 20 queries across 4.47M files
~8 ms
typical content query inside files (rare symbols ~7 ms, common words ~9 ms)
The toolThe taskTimevs Interlinked
Interlinked (live index)one indexed lookup85 μsbaseline
VS Code · Ctrl+Psame file, same drive35 s412,000×
Windows Searchmedian of 20 queries67 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.

WHAT THE LANE BUYS AN AGENT
6m 57s → 16ms
time to find one file: before, then with the index
71 → 1
tool calls spent hunting
~58% → ~0%
session tokens burned on file search

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.

0 LLMs
every hit is a literal match you can check, never a model’s guess, never an embedding to drift
26,958 pairs
relationships seeded across 12 repos in 1.7 s on a fresh machine: no model, just its own git history
19 clients
auto-configured in one install: Claude Code, Cursor, Codex, Windsurf, Zed and the rest

PARALLEL TO RAG · EXACT, FAST, FRESH · NO MODEL IN THE LOOP.

Do this today

Give every agent the exact lane.

1

Install once. One signed installer auto-configures 19 AI clients: Claude Code, Cursor, Codex, Windsurf, Zed, Cline and the rest. No JSON to edit.

2

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.

3

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.

4

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.

Measured July 2026 · Ryzen 9 9950X3D · 4.47M files · Windows 11← All research