How we built the data ingestion pipeline behind a RAG assistant for an insurance group: a governed knowledge base, grounding and citations on regulated content.

An Italian insurance group distributes its products through a network of more than 3,500 frontline staff. The knowledge needed to sell a policy and assist a customer, meaning contract terms, KIDs, internal circulars, regulatory updates and claims procedures, sat scattered across file shares and document archives, often in versions that didn't match. Finding the right information took between five and seven minutes, with a real risk of giving inconsistent answers on regulated matters.
For this client we designed and shipped to production a RAG system with a conversational assistant that answers by always citing the authoritative, currently valid source. The time to find the correct information dropped from minutes to under twenty seconds, with a hallucination rate on regulated content below 0.5%. The part that took the real work was the data ingestion pipeline that makes a heterogeneous document corpus genuinely queryable by an AI. That is what this article is about.
When people talk about RAG, the attention almost always lands on the model: which LLM, how much context, which prompt. In our experience the model is the least complicated part. What separates a proof of concept from a system the compliance function will let into production is the quality with which data enters the knowledge base: governed, versioned, citable. In a regulated industry, that quality essentially decides whether the system ever sees production.
An LLM is only as accurate as the data it receives. "Garbage in, garbage out" holds for any AI system, but in RAG the effect is amplified: one wrong chunk, one expired document, one misread table, and the model produces a fluent, wrong answer in a confident tone. In the project mentioned above, the corpus arrived in heterogeneous formats (native and scanned PDFs, Word, Excel sheets for rate tables, HTML pages) and the versions were not always consistent. Without metadata, taxonomies and structured tables, those documents were effectively opaque to an AI: any system could only have guessed.
Most projects stop at the word "ingestion": taking data and bringing it in. On regulated corpora we raise the bar and talk about knowledge injection, because a document has to enter the knowledge base already governed: with a version, a validity window, an authoritative-source flag and, for regulated content, a human approval workflow. An expired document left in the index sooner or later becomes a wrong answer given with confidence. This governance is built in at the very moment the data enters the knowledge base, starting from acquisition.
We designed ingestion as a staged pipeline, incremental and cost-optimized. Here is what happens to a document, from its source to the point where it can be queried.
It is this last stage, continuous, selective injection, that keeps the assistant aligned with current documentation without re-indexing the entire corpus every time.


Reprocessing the whole corpus on every change is the simplest choice, and also the most expensive: it recomputes the embeddings for everything, every time. We tied re-embedding to the actual diff, so when a circular changes one section, only that section is recomputed. In production this cut re-indexing costs by 73% and brought the time to align the assistant with a regulatory update down from two to three weeks to under four hours.
Once the data is injected properly, the retrieval and generation layer can be designed for precision and safety. Retrieval combines metadata pre-filtering (line of business, validity, user permissions), hybrid lexical and semantic search, and a reranking step that brings the truly relevant passages to the top. Generation runs on a multi-agent orchestration built with LangGraph and LlamaIndex (after evaluating CrewAI), in which each agent has a single job: a Router classifies the intent of the question; a Retrieval agent fetches and ranks the passages; a Compliance and Citation agent checks that every statement rests on an authoritative, valid source, enforces citation and blocks the answer if the evidence isn't enough; a Synthesis agent writes the answer; a Calculation agent reads the structured rate tables to give consistent numerical examples. Over all of it, NeMo Guardrails enforces the grounding and refusal policies.
The guiding principle is clear-cut: no source, no answer. Without adequate documentation, the assistant doesn't improvise: it says it doesn't have enough information and points to escalation. And all of this runs with p95 latency under 2.8 seconds in production.


In a system like this, quality has to be measured at every release. Together with the client's domain experts we built a golden set of about 1,200 question-answer pairs, representative by line of business and by intent type. On that set, and then on production telemetry, we track objective metrics with Ragas and LangSmith: faithfulness (how well the answer is supported by the retrieved sources), citation accuracy, retrieval precision and recall, and the hallucination rate. The steady-state numbers: 96.4% faithfulness, 98.1% citation accuracy, retrieval at 0.91 precision and 0.88 recall, hallucination on regulated content below 0.5%. Every significant change to the pipeline or to the agents goes through this golden set before release.


This client has the distribution, the brand and the domain expertise. What it lacked was a data and AI engineering team able to take a system like this to production, with the governance a regulated industry demands. We worked as an end-to-end external tech team, from product strategy to MLOps, behind the scenes. A pilot on two lines of business in ten weeks, and the full system on those lines in nine months.
The operational change is qualitative: the network went from searching to asking, with the guarantee that every answer rests on a current, citable document. Adoption reached 78% of frontline staff in three months, and second-level escalations fell by 42%. For a compliance function, full traceability of every answer is as much a result as speed.
If you have a document corpus that an AI should be able to query, choosing the model is the easy part. The serious question is about your data: is it versioned and up to date, with a source you can always trace? Almost no archive already is, and that is where the game is won or lost.
Data ingestion is the standard term for the process that acquires data from different sources and prepares it for use. We use "knowledge injection" in regulated contexts to raise the bar: the data has to enter the knowledge base already governed, with a version, a validity window and a tracked authoritative source. It is the same family of processes, with stricter governance requirements.
Because an LLM is only as accurate as the data it retrieves. The model is by now an interchangeable commodity, while retrieval quality depends on how the documents were extracted, normalized, enriched with metadata and segmented. A wrong chunk or an expired document produces a fluent, unreliable answer. In a regulated industry, where every statement has to be cited and grounded, the ingestion pipeline is where the system becomes reliable, or doesn't.
The main lever is grounding: every statement has to rest on a passage retrieved from an authoritative, currently valid source, with mandatory citation checked by a dedicated agent that blocks the answer when the evidence is insufficient. On top of that comes below-threshold abstention: without adequate documentation, the assistant says it doesn't have enough information and points to escalation, instead of improvising.
The cost depends almost entirely on how you handle updates. Reprocessing the whole corpus on every change is simple to implement but expensive, because it recomputes the embeddings for everything, every time. The alternative is to tie re-embedding to the actual differences, so that only the parts of a document that change are recomputed.
It depends on the quality of the starting sources and on the governance requirements, but a realistic path starts with a pilot on a narrow scope, to validate the approach before scaling. In the case described in this article, we put a pilot on two lines of business into production in ten weeks and completed the system in nine months.
Start now with Mokka Studios and turn your ideas into measurable results through innovative software development practices.