Interlinked.

Explainers · measured July 2026

Three ways to give an LLM your knowledge. Only one keeps up with code.

You can bake it into the model's weights (fine-tuning), embed it into a vector store and match by meaning (RAG), or fetch the exact text and drop it straight into the context window. Each wins somewhere. This is the honest map (across cost, freshness, and effort) and why, for knowledge that changes every time you hit save, the retrieval lane is usually the one that keeps up.

Where the knowledge lives

One question decides it: when does the knowledge enter?

Fine-tuning writes your knowledge into the weights, once, at training time. It is baked in. RAG and context both fetch it at query time; the difference is how. RAG matches by meaning and returns something close. Context matches exactly and returns the real, current bytes. Everything else (cost, freshness, effort) follows from that split.

BAKED INchanges only when you retrainRETRIEVED AT QUERY TIMEchanges the moment your files doFINE-TUNINGtrain the weights on your dataLIVESin the weightsENTERStrain time · baked in onceCHEAPa training run to change itFRESHfrozen at train timeEASYa pipeline, data, evalsBEST FORa skill, tone, or format (not facts)RAGembed to a vector store, match by meaningLIVESin a vector storeENTERSquery time · by similarityCHEAPembed + host a vector DBFRESHre-embed to update; driftsEASYchunk, embed, tune recallBEST FORfuzzy recall over a big, stable corpusCONTEXTretrieve the exact text into the windowLIVESin the context windowENTERSquery time · by exact matchCHEAPno training, no storeFRESH~1 ms after a saveEASYfetch it, hand it overBEST FORexact, current knowledge (like code)

Bars are directional: longer is better on each axis. The hard numbers live two sections down; here the shape of the tradeoff is the point. Note the honest catch: “cheap” and “easy” for context assume the retrieval is fast. Done naively by scanning the whole disk, it is neither.

Each is genuinely good at something

What each one is actually for.

Fine-tuning
Teach a behavior
knowledge in the weights
REACH FOR IT WHEN
+you want a tone, house style, or output format by default
+a narrow, durable domain skill
+compressing a fixed body of reasoning into cheaper inference
+the knowledge almost never changes
WEAK WHEN facts that move. You can’t fine-tune this morning’s commit into the weights, and updating means another training run. It teaches how you write, not what the code says today.
RAG / embeddings
Recall by meaning
knowledge in a vector store
REACH FOR IT WHEN
+a large, fairly stable corpus: docs, policies, tickets
+questions where you don’t know the exact words
+grounding an answer in cited sources
+discovery: “explain this area,” “what handles auth?”
WEAK WHEN anything exact or fast-moving. Embeddings are a snapshot of meaning; rename or edit and they point at the old version until you re-embed, and retrieval is approximate by design.
Context / retrieval
Retrieve exactly, now
knowledge in the window
REACH FOR IT WHEN
+exact things: a symbol, string, error message, config value
+knowledge that changes constantly, like code
+whole-machine scope, across every repo and the files git ignores
+grounding on the real current bytes, not a ranked guess
WEAK WHEN a purely conceptual question with no shared literal token. That’s RAG’s job. And naive retrieval that scans the whole disk is slow: the fix is a live index.

Read the middle and right cards together: RAG is retrieval: semantic retrieval. The context lane is exact retrieval: fetch the real, current text and hand it over. Same family, opposite tradeoff.

Why code is the hard case

Fine-tuning freezes it. RAG drifts.

THE BAKED LANE · STALE

Code is the most fast-moving knowledge you own. It changes every save. Fine-tuning captures it at one instant and freezes it there. By the time a training run finishes, the code has moved; to catch up you train again. Superb for teaching a model how you write; wrong for telling it what the code says right now.

THE FUZZY LANE · DRIFT

RAG keeps a vector snapshot of meaning. Rename a function, refactor a module, add a file, and the vectors keep pointing at the old shape until you re-embed. Retrieval is nearest-neighbor (approximate by design), so it's great at “what handles auth?” and shaky at “find every exact call site of the symbol I just renamed.”

Code wants the opposite of both: exact and current. Retrieve the real text at query time and the model sees what's there right now: no snapshot to go stale, no meaning to drift. The only catch is speed: retrieval has to be faster than the model can wait. That is the entire job of a live index.

The exact lane, measured · Ryzen 9 9950X3D · 4.47M files

Exact and fresh, 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
7 to 9 ms
typical content search inside files (exact phrases ~16 ms)

Same query, same machine: a content search that took 93.8 s to grind through the disk returned in 16 ms from the index, 58,625× faster across the five-query set. And it stays current: a save is searchable in about a millisecond, under 30 ms worst case. No re-embedding, no retrain, no drift.

WHAT THE EXACT 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 land around 7 to 9 ms, with exact phrases near 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 honest verdict

Fine-tune for skill. RAG for meaning. Put your code in the exact lane.

These aren't rivals: they answer different questions, so they belong in the same stack. Fine-tune for behavior. Reach for RAG when the question is fuzzy and the corpus is stable. And for the knowledge that's exact and changes every save (your code, your files, the config with the answer), retrieve it fresh into the context window. No model in the loop: every hit is a literal match you can verify, whole-machine, across every repo and the files git ignores. The same index also carries a relationship layer it builds itself (which files change together, which repos ship as a set), so the context an agent gets is not just fresh, it's connected.

0 LLMs
every hit is a literal match you can check: nothing to embed, nothing to drift
~1 ms
from save to searchable, the freshness fine-tuning and RAG can’t hold
19 clients
auto-configured in one install: Claude Code, Cursor, Codex, Windsurf, Zed and the rest

PARALLEL TO RAG AND FINE-TUNING · EXACT, FRESH, VERIFIABLE · NO MODEL IN THE LOOP.

Do this today

Give the model 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

Match each path to its job. Fine-tune for behavior. Keep RAG for meaning. Hand the agent exact, current text for names, symbols, strings, error messages and config. Whole-machine, fresh to the last save.

3

Let it stay fresh. Save a file and it’s searchable in about a millisecond: no re-embedding step, no retrain, no drift. At rest the engine sits near 44 MB.

4

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.

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