Atlas is a multi-tenant agentic RAG platform — the kind of retrieval backend a product team would build an AI feature on top of. Roughly 12,400 lines of async Python plus a 4,300-line TypeScript console, deployed on Google Cloud Run in asia-south1 and live at atlas.hulage.in. The code is open at github.com/hulagerushikesh/atlas.
The aim
“RAG over your documents” is commoditised — a weekend of work gets you a demo that answers most questions. What is not commoditised is knowing whether the answer was actually supported by the retrieved text, and what it cost. So the parts of Atlas that got the attention are the unglamorous ones: a verification pass that grades the generated answer against its own evidence, an evaluation harness that decides whether a pipeline change helped, per-request cost attribution, and a daily spend cap the server enforces rather than trusts.
The demo corpus is the DuckDB 2.0 manual — 226 pages, 3,975 passages — so the retrieval quality claims below are measured against a real, labelled question set rather than asserted.
Six stages, each one timed
A question goes through route → decompose → retrieve → grade → generate → verify, and the trace carries wall-clock for each stage, every candidate chunk with the score it earned at each retrieval step, and the token cost of every model call.
- Retrieve is hybrid: dense vector search over Qdrant and an Okapi BM25 keyword index, merged by Reciprocal Rank Fusion, then a cross-encoder reranks the merged candidates. Dense and sparse disagree often enough that the fusion is worth its cost.
- Grade scores the retrieved context before generation, and a weak result sends the pipeline back for another retrieval round rather than letting the model answer from thin evidence.
- Verify is the stage most RAG systems do not have. After the answer is written, a second model call checks each claim against the chunks that were actually retrieved. On the streaming endpoint the answer is sent first and the verdict follows as its own event, so the reader is not made to wait for a check they may not need — and the response says the verdict is pending rather than quietly omitting it.
Measured, not guessed
- The numbers, as of the November 2026 run — on 16 labelled questions over the DuckDB manual, Atlas finds the right page for all 16 (recall 1.00), keeps its answers to the retrieved pages at 0.99 and gets them right at 0.77 against hand-written references, at a median of about 7 seconds. Answer correctness is the weak one and is reported as such. (The earlier FastAPI-docs run, 3 October 2026, scored faithfulness 1.00, recall 0.94 and precision 0.47.)
- A harness that resists its own author — a later full rerun put answer correctness at 0.7992, a 12.5% apparent improvement, and the project’s own significance test scored it a tie on all five metrics (p = 0.61, 7 of 16 samples differing). The older, lower number is still the quoted one. A measurement whose gaps are silenced reports whatever you expected it to.
- Rejections are output too — HyDE was implemented, measured on both arms and turned down: warm p95 latency +56% for the concat variant and +139% for replace, with no quality win to pay for it. Doubling the container’s CPU was measured and rejected the same way — the cold path is a sequential import, 43.38s against 43.49s.
- Cost is measured per query, not estimated once — about ₹0.20 (≈$0.002) per question, ₹0 while idle, and an evaluation run costs about ₹6 once the grading model’s own calls are counted. Omitting the judges under-states a run by roughly a third.
Built to be depended on
- Namespace isolation — each tenant’s corpus is a separate Qdrant collection and a separate keyword index, with the namespace resolved from the authenticated key rather than from the request body. An early version shared one BM25 index across namespaces, which leaked keyword hits between tenants; it was caught by a test written to prove the isolation rather than to confirm it, and the fix is now mutation-tested.
- The keyword index is a cache, not a second copy of record — Qdrant holds the truth, and each container rebuilds its sparse half from the vector store whenever the two disagree on row count. It refuses three ways: an empty collection never empties a populated index, a scroll that fails halfway is never adopted, and an unreachable Qdrant is not recorded as agreement.
- Spend is capped server-side — SHA-hashed API keys, per-key rate limiting, token-level cost attribution and Prometheus telemetry on every request, under a hard daily cap checked before the model is called and after the budget is read, not after the bill arrives.
- Idempotent ingestion — content fingerprinting skips unchanged chunks, so re-indexing a corpus pays only for what changed; a four-chunk documentation fix cost 433 tokens instead of a full re-embed.
- Cold start is a measured number — 36.9s down to 11.7s by deferring the cross-encoder import, with a Cloud Run startup probe keeping an instance out of rotation until its model is actually loaded.
Stack
Gemini through an OpenAI-compatible base URL, Qdrant Cloud for vectors, Firestore for API keys and spend, FastAPI and Docker on Cloud Run, fronted by a Vercel rewrite, with a React console for upload, querying and the trace view. 892 tests run in CI with a 90% coverage floor alongside the linter, the type checker, a console build, and a check that the committed static bundle matches a fresh one.
The site above is live. Anyone can ask questions about the demo DuckDB manual without a key, under a ₹10-a-day cap; uploading your own documents still needs a key, because the cap is real money.