From MVP to Real Business: How to Scale a RAG System for Experts
The developers of the AI assistant "Mark" have shared a case study on turning a "naive" RAG system into a production-grade solution for occupational safety. The main difficulty was moving from a dozen PDF files to a base of thousands of documents, where errors carry legal risks. The updated architecture is built on LangGraph, which gives flexible control over search logic and answer generation. The article describes in detail how the system was tuned, how the team fought hallucinations, and how the search mechanisms were configured. It is a practical guide to building reliable LLM products for industries with strict requirements for data accuracy.
AI-processed from Habr AI; edited by Hamidun News
From MVP to Real Business: How to Scale a RAG System for Experts
In AI, moving from a prototype that works under ideal conditions to a full-scale production solution is always a challenge. The problem is especially acute in industries where data accuracy is critical and errors can lead to serious legal consequences. The team behind the AI assistant "Mark," which specializes in occupational safety, faced exactly this task: they turned a "naive" RAG (Retrieval-Augmented Generation) system from a simple tool into a reliable solution for professionals.
Context: From the "magic" of the MVP to the harsh reality of production
Many developers who work with language models for the first time go through what could be called a "honeymoon" phase. Using popular frameworks such as LangChain and simple databases such as ChromaDB, they load a few dozen PDF documents and write a basic prompt. The result is often impressive: the AI assistant gives answers, experts are pleased, and the MVP (Minimum Viable Product) is ready within days.
But as practice shows, the "magic" fades quickly once the volume of data grows tenfold or a hundredfold. With thousands of documents containing specialized information, every inaccuracy stops being a harmless "hallucination" and becomes a potential source of legal risk and financial penalties. This is the problem the developers of "Mark," the AI expert on occupational safety, ran into.
Their original "naive" RAG, which worked well with a small dataset, began to fail as it scaled, proving unfit for production use.
Deep dive: Reworking the architecture with LangGraph
The key step in solving the scaling problem was reworking the system's architecture. Instead of a linear, simple approach, the team chose a more flexible and powerful tool: LangGraph. The library lets developers build complex, multi-step workflows for LLM applications, which proved ideal for managing the logic of information retrieval and answer generation across a large and varied set of documents. The "Mark" project covered the following key areas:
- System tuning: The process included detailed adjustment of how the language model interacts with the retrieval system. This made it possible to understand user queries more accurately and retrieve more relevant documents.
- Fighting hallucinations: One of the main goals was to minimize cases where the model generates unreliable information. The team used several techniques, including strengthening context, improving the quality of retrieved fragments, and using specific prompts aimed at fact-checking.
- Configuring search mechanisms: Working with thousands of documents required optimizing the search process itself. The team introduced advanced indexing and search methods that quickly find the most relevant text fragments, even for complex and ambiguous queries.
The LangGraph-based architecture did more than improve answer quality: it also made the system more resilient to errors, which is critical in occupational safety, where mistakes can have far-reaching consequences.
Implications: Reliable LLM products for critical industries
The successful scaling of the RAG system for "Mark" shows that moving from an MVP to a production solution is possible even in the most demanding fields. The experience has broad implications for building LLM products in other industries where accuracy and reliability come first, such as law, medicine, finance and engineering. Flexible architectural solutions like LangGraph, combined with deep tuning of search mechanisms and methods for fighting hallucinations, make it possible to build AI assistants that do not merely "entertain" but actually help with complex professional tasks, reducing risk and improving efficiency.
Conclusion: A practical guide to action
The story of how the AI assistant "Mark" was transformed is not just an account of a technical achievement but a practical guide for anyone who wants to build reliable, scalable LLM products. The move from a local script to a complex architecture capable of processing huge volumes of critical information highlights the importance of careful system design and continuous refinement. The "Mark" team's experience shows that success depends on a deep understanding of the subject domain, careful tuning of every component, and a readiness for iterative development aimed at minimizing risk and maximizing value for the end user.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.