What RAG actually solves
A language model only knows what it was trained on, plus whatever's in the current conversation. RAG (retrieval-augmented generation) fixes that by retrieving relevant information from a business's own documents or database before generating a response, so the answer is grounded in real, current data instead of the model's training cutoff. The diagram version is: query in, retrieve relevant chunks, stuff them into the prompt, generate an answer. The production version has a lot more decisions buried in that second step.
Chunking is where most RAG systems quietly fail
How source documents get split into retrievable pieces determines almost everything about retrieval quality, and it's the part most tutorials skip past. Chunk too large, and retrieval pulls back mostly irrelevant text alongside the useful part, diluting the context the model actually needs. Chunk too small, and you lose the surrounding context that made a passage meaningful in the first place — a paragraph about pricing might be meaningless without the plan name three sentences above it. There's no universal chunk size; it depends on document structure. Structured documents (FAQs, policy pages) usually chunk cleanly along their existing sections. Long-form or technical documents often need overlap between chunks so context doesn't get severed at an arbitrary boundary.
Retrieval is a search problem before it's an AI problem
Vector similarity search (embedding the query and finding the nearest chunks) is the default approach, and it works well for conceptual, meaning-based queries. It works noticeably worse for queries that depend on exact terms — model numbers, specific dates, exact phrasing — where a plain keyword match often outperforms semantic similarity. Hybrid retrieval, combining vector search with keyword search and re-ranking the combined results, is usually worth the added complexity for anything beyond a narrow, well-defined domain.
Grounding, not just retrieving
Retrieving the right chunks doesn't automatically produce a grounded answer. The model can still ignore retrieved context and answer from its training data, blend retrieved facts with invented ones, or answer confidently from a chunk that's only tangentially related to the actual question. Production RAG systems need explicit instructions and structure that push the model to answer only from what was retrieved, and — just as important — a defined behavior for when retrieval comes back empty or irrelevant, rather than letting the model guess.
What actually changes at production scale
- Freshness. If source documents update, the retrieval index needs a real update pipeline, not a one-time embedding job.
- Access control. Retrieval needs to respect who's allowed to see what — a support agent's RAG system shouldn't be able to surface another customer's data because it happened to be in the same vector index.
- Evaluation. "It seems to work" isn't a test plan. Production systems need a way to measure whether retrieval is actually pulling the right chunks for a representative set of real questions, not just the ones used to demo it.
RAG vs. fine-tuning vs. a plain prompt
| Approach | Best for |
|---|---|
| Plain prompt | General knowledge questions with no need for private or current data. |
| RAG | Grounded answers over a business's own documents or data, especially when that data changes often. |
| Fine-tuning | Teaching a model a consistent style, format, or behavior — not a substitute for giving it current facts. |
Where this shows up in practice
Quantwist builds RAG systems as part of its AI development work — grounding an AI tutor in a specific syllabus for Luma, for example, follows the same underlying architecture questions covered here: what to chunk, how to retrieve it, and how to make sure the model actually uses it rather than answering from general training data.
The practical takeaway
RAG is genuinely useful and genuinely not a weekend project once real documents, real scale, and real edge cases are involved. The parts that separate a working demo from a production system are almost always chunking strategy, retrieval quality, and explicit grounding — not the model choice, which usually matters far less than the architecture around it.