← ALL POSTS
RAGLLMAIProductionEngineeringEvaluation

Production RAG Implementation: How I Build Retrieval Systems at Million-Document Scale

Most RAG demos fall apart past a few thousand documents. Here's what I actually build for clients — a hybrid retrieval architecture proven past a million documents, with the production practices that keep it fast and reliable.

August 8, 20269 min read

Production RAG Implementation: How I Build Retrieval Systems at Million-Document Scale

Every RAG demo works. Ten PDFs, one embedding model, a vector search call, and the answers look great in the walkthrough video. Then a client says: "Great — now point it at our real document store. All 1.2 million files, across a dozen departments, updated daily." That's the moment most RAG projects quietly fall apart.

I build the systems that survive that moment. This isn't a tutorial — I've already written those (linked below). This is a straight description of what I actually build and deliver for clients who need retrieval that works at real scale, and how you can get one built for you.

Why Demos Don't Survive Contact With Production

At a few hundred documents, almost any approach looks fine. Brute-force similarity search is fast enough, a single chunking rule is good enough, and nobody notices the edge cases. None of that holds at scale.

Past tens of thousands of documents, naive setups start failing in specific, predictable ways: retrieval gets noisy and starts surfacing near-misses instead of the right chunk, latency climbs, one customer's documents leak into another's answers, and quality quietly degrades because nobody built a way to measure it. These aren't exotic failures — they're the default outcome of shipping a prototype architecture as-is.

If you want the deep-dive on chunking strategy, retrieval mechanics, and eval frameworks, read Building the Perfect RAG — it covers the theory in full. This post skips the theory and shows you the resulting production system.

What I've Built: A Multi-Tenant RAG Platform Past 1 Million Documents

I've designed and shipped a multi-tenant RAG platform indexing more than one million documents, with retrieval that stays fast at that scale — not just on a good day, but as the baseline. The core architecture:

Here's why each of those pieces earns its place.

Dense vector search is excellent at meaning — it finds the chunk that's conceptually related to a question even if the wording is completely different. It's weak, though, at exact terms: a contract clause number, a product SKU, a specific name. Sparse lexical search (BM25) is the mirror image — strong on exact matches, blind to meaning. Run both and combine the results, and you cover each other's weak spots instead of picking one and living with its gaps.

Hybrid doesn't have to mean two engines, either. I've also built the entire hybrid approach inside Qdrant alone — it stores dense and sparse vectors side by side, so a single engine handles both semantic and lexical search without a separate search cluster to operate. Fewer moving parts, same coverage. Which shape fits depends on your infrastructure, and I've shipped both.

Why Adaptive Chunking

Treating every document with the same chunking rule is one of the most common shortcuts I see — and one of the most expensive. A 40-page equipment manual, a 2-page contract, and a dense quarterly report don't share a structure, so splitting them all with the same fixed-size rule throws away the structure that made each one readable in the first place. I build chunking that adapts to document type — respecting how contracts, reports, and manuals are actually organized — rather than forcing every document through the same generic splitter.

Why Reranking and Query Rewriting

Initial retrieval is intentionally a wide net — it pulls a broad candidate set from both the dense and sparse indexes. Reranking then narrows that set with a model that looks at the query and each candidate together, which is far more accurate than similarity scores computed independently. Query rewriting sits in front of all of it, because real user queries are messy, vague, or missing context an LLM needs to retrieve well — cleaning that up before retrieval runs measurably improves what comes back.

What "Production-Grade" Actually Means

A lot of RAG systems are "production" only in the sense that they're deployed somewhere. Production-grade means something more specific:

How I Keep a RAG System Honest: Evaluation

"Continuous evaluation" was one bullet in the list above, but it deserves its own section, because it's the practice that separates systems that stay good from systems that quietly rot. Eyeballing ten answers at launch is not evaluation. A million-document system changes constantly — new documents, new query patterns, model upgrades, chunking tweaks — and every one of those changes can make answers worse without anyone noticing until a client does.

What I actually set up looks like this:

The Tools I Reach For

The ecosystem has largely settled on a handful of tools, and the same vendor-neutral rule applies as with vector databases — the loop matters more than the logo:

Which of these lands in your stack depends on what you already run and where your data is allowed to live — I've set up managed and self-hosted variants both. The non-negotiable part isn't the tool. It's that evaluation runs continuously, on real traffic, with failures feeding back into the golden dataset. The full metric-by-metric breakdown — RAGAS dimensions, LLM-as-judge rubrics, retrieval metrics like MRR and NDCG — is in Building the Perfect RAG if you want the theory behind the loop.

What I Can Build for You

I've delivered systems in this same category — hybrid retrieval, adaptive chunking, production hardening — for multiple clients, in both Java and Python, across different document types and industries. And none of it is tied to one vendor: Qdrant is what the platform above runs on, but the same retrieval design works on Weaviate, Elasticsearch, or any other vector database — the right engine is whichever one fits your infrastructure and your team. If you already have a stack, I build inside it rather than pushing a rewrite you didn't ask for. If you're starting from a shaky prototype or nothing at all, the deliverable is the same class of system described above, sized to your actual document volume and use case.

If you're still deciding between RAG and fine-tuning for your use case, Why RAG beats fine-tuning for most use cases lays out when each one actually makes sense — RAG wins for the large majority of document-grounded use cases, which is exactly why it's what I build most.

Let's Build Yours

If you have a real document corpus — thousands or millions of files — and you need retrieval that actually holds up in production, get in touch through the contact form. If you'd rather see this class of system in action before we talk, the live RAG project demos are one click away. You can also see the full scope of what this kind of engagement looks like on the AI Integration services page.

← BACK TO ALL POSTS