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.
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.
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.
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.
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.
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.
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.
PARALLEL TO RAG AND FINE-TUNING · EXACT, FRESH, VERIFIABLE · NO MODEL IN THE LOOP.
Do this today
Give the model 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.
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.
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.
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.