Why rlat?
You already have an LLM, file tools, vector databases, and a context window you could paste documents into. This page is the measured case for using rlat instead — and the honest list of cases where you shouldn't. Every number below comes from a published benchmark with a committed test set; each one links to its section on the benchmarks page.
What you're choosing between
An AI assistant answering questions about your corpus has
four options today: trust its training data, dig through files with
grep-style tools, bolt on a vector database, or paste the documents
into context. rlat is the fifth: build the corpus into a single
.rlat file once, and the assistant gets grounded,
cited answers in milliseconds for tenths of a cent — plus three
things none of the alternatives have at all: standing knowledge of
your world's rules and dead ends, a memory that survives sessions,
and a self-improvement loop with published evidence.
Training data is where hallucinations live
On a Microsoft Fabric documentation corpus — a domain the LLM partially knows, the most dangerous kind — Sonnet alone answered 63 hand-written questions at 56.9% accuracy with 19.6% hallucination, and invented an answer for half the product names that don't exist. The same model with rlat in the loop:
| Lane | Accuracy | Hallucination | $ / question |
|---|---|---|---|
| Sonnet alone | 56.9% | 19.6% | $0.002 |
+ rlat search (one shot) | 76.5% | 3.9% | $0.004 |
+ rlat deep-search --mode knowledge | 92.2% | 0.0% | $0.009 |
One retrieval call adds ~20 points of accuracy at 5× lower
hallucination; the multi-hop loop takes hallucination to zero on
answerable questions. For compliance work, single-shot
--mode constrain is the floor: 2.0% hallucination and
a 91.7% refusal rate on made-up product names — it invents nothing
11 times out of 12. Full matrix:
hallucination reduction.
The grep loop is good. It's also 6.5× the price.
The strongest alternative is a real one: an agent with grep, glob, and read-file tools digging through the corpus. On the Fabric bench it scored 94.1% — two points above deep-search's 92.2% — at $0.060 per question against $0.009, slower wall-time, and it was fooled by half again as many fake product names (25.0% vs 16.7% distractor hallucination). Within noise of each other on accuracy; 6.5× apart on spend.
And here is the honest other half. On a second benchmark — a hand-written code corpus the LLM had zero prior knowledge of — the grep loop beat single-shot rlat on accuracy outright (85% vs 35%): questions needing cross-file synthesis reward a tool that can keep digging. rlat was still 3.7× cheaper per correct answer ($0.012 vs $0.044), but if your workload is deep code navigation and thoroughness beats cost, use the file tools — we publish the number that says so (token spend).
The split, in one rule: volume and repetition favour rlat; one-off forensic digs favour the agent loop. An assistant answering corpus questions all day at $0.060 each is a bill; at $0.009 it's a rounding error.
A database is a part. rlat is the whole.
Measured against Chroma's out-of-box defaults on the same 1,000-passage corpus, same CPU: rlat answers warm queries at 17 ms p50 against 145 ms — 8.5× faster — and the result on disk is 2.7 MB against 8.6 MB. Chroma does build faster (a lighter embedder), then pays it back 8× on every query; build happens once, queries happen millions of times (build & query speed).
But the speed row understates the difference, because a vector DB
is infrastructure you assemble: you choose the embedder, write the
chunker, run the service, and what you get back is passages. A
.rlat is the assembled thing — encoder pinned and
benchmarked (BEIR-5 floor published),
chunking built in, zero services, one portable file you can commit,
copy, or hand to a teammate. And it holds what a DB has no column
for: cited claims, standing constraints, falsified findings, and
drift tracking back to source files.
The most expensive option is the default one
Dumping the whole corpus into the context window every question cost $0.796 per correct answer on the code-corpus bench — 264,331 tokens a question — and scored worse than the grep agent (70% vs 85%): models lose facts in the middle of a giant paste. rlat's retrieved slice cost $0.012 per correct answer — 67× cheaper (token spend). Pasting re-buys the same tokens every single question; a knowledge model pays for the corpus once, at build time.
The part you can't assemble from parts
Retrieval is the comparable half of rlat. The other half doesn't have a competitor row, because the alternatives don't attempt it:
- Your world's standing rules, always served. Facts no document states — "this tenant is EU-only" — captured and injected on every relevant answer. Measured: rule-violating answers fell 62% → 7%, replicated across three unrelated domains (R1 / R1-X).
- Your dead ends, never re-recommended. Approaches tried and falsified in your environment serve under their verdict: re-recommendations fell 7 of 7 → 0 of 7 (R2).
- A memory that survives the session — recall at the prompt, capture at session end, zero labour (Memory & sessions).
- Published failures, not just wins. The self-cleaning rule we wanted didn't pass its safety bar, so it didn't ship — and the full record is public (R4). That is the standard the numbers above are held to.
The honest list
- One question, small corpus — if the documents fit comfortably in context and you'll ask once, paste them. Build cost only pays off on repetition.
- Deep code navigation — for cross-file forensic work where thoroughness beats cost, the grep/read agent loop measured more complete. Use both: rlat to orient, tools to dig.
- Exact-string lookup — if you know the literal string, ripgrep finds it faster than any semantic layer.
- General world knowledge — questions with no private corpus behind them are what the LLM alone is for.
One pip install, no API key
pip install rlat, build a knowledge model from a folder,
query it — all free and local. The LLM-driven loops (deep research,
curation, capture) run as skills on the Claude subscription you
already have; an API key is only for unattended automation
(API keys). First build to first
grounded answer is a 15-minute path:
getting started.