I used to treat RAG as a magic black box: dump documents in one end, get answers out the other, and hope the retrieval step did its job. That approach produced impressive demos and fragile systems. The first time a retrieved chunk quietly contradicted an earlier chunk and the model smoothed the conflict into a confident answer, I stopped hoping and started designing for review.
This post walks through the concrete RAG pipeline I now run with Mistral Large 4 for any knowledge base that actually matters—internal docs, support playbooks, or the messy family knowledge base I share with Priya. The design goal is simple: every answer must be reviewable. That means the system shows its sources, surfaces conflicts, and leaves a clear human checkpoint before anything is treated as action.
If it only works in the demo, it isn’t in the workflow yet. A RAG pipeline that cannot be inspected is still a demo.
Design Principles Before Any Code
Three rules shaped every decision:
Retrieval is not truth. The chunks that come back are candidates, not facts. The pipeline must make it easy to see which candidates were used and whether they agree.
The model is a synthesizer, not an authority. Mistral Large 4 is good at turning retrieved text into coherent answers. It is less reliable at noticing when the retrieved text is incomplete or contradictory. The pipeline therefore forces the model to cite and to flag uncertainty.
Human review is a first-class stage, not an afterthought. For any answer that will be acted on, there is an explicit review step. The system is allowed to be fast; it is not allowed to be unsupervised when the stakes are real.
These principles sound obvious until you look at most published RAG tutorials. Many optimize for latency and “end-to-end” fluency. I optimize for the ability to catch a quiet error before it leaves the building.
High-Level Architecture

The pipeline has five stages:
Ingestion & chunking — documents are split with deliberate overlap and metadata.
Indexing — embeddings plus a lightweight keyword/BM25 hybrid so exact terms are not lost.
Retrieval — top-k chunks plus a relevance score and the original section heading.
Generation with forced citation — Mistral Large 4 receives the chunks and must answer in a structured format that includes source references and an uncertainty note.
Review surface — a simple UI or notebook view that shows the question, the answer, the exact chunks used, and a one-click “approve / edit / reject” action.
I run the generation stage against the Mistral Large 4 API for quality, with the option to fall back to a smaller local model for low-stakes queries. The rest of the stack stays local so I can inspect every intermediate artifact.
Stage 1 & 2: Ingestion That Does Not Throw Information Away
I chunk by semantic sections rather than fixed token counts whenever the source has headings. When it does not, I use 400–600 token chunks with 15 % overlap. Every chunk carries:
original document ID and title
section heading (or “no heading”)
page or paragraph range
ingestion timestamp
a short hash of the raw text so I can detect later edits
The embedding model is a solid open sentence-transformer; I do not need the absolute latest for this pipeline. I also keep a parallel BM25 index on the raw text. Hybrid retrieval (vector + keyword) consistently reduces the “I know the document contains the word X but the vector search missed it” failures that pure embedding search produces on technical material.
Stage 3: Retrieval That Returns Evidence, Not Just Text
When a query arrives I retrieve the top 8 chunks by hybrid score. I deliberately over-retrieve a little so the generation stage has material to work with and so the review surface can show near-misses. Each returned chunk includes its relevance score and the section heading. That heading is surprisingly useful; it often tells a human reviewer whether the chunk is even in the right part of the document before they read the text.
I also run a lightweight conflict check: if two high-scoring chunks contain contradictory statements about the same entity or rule, I surface both and add a flag. The model is told about the flag; it is not asked to resolve it silently.
Stage 4: Generation with Mistral Large 4 Under Strict Instructions
The system prompt is short and non-negotiable:
“You are a careful assistant that answers only from the provided sources. Cite every factual claim with the chunk ID. If the sources conflict or are insufficient, say so explicitly in an ‘Uncertainty’ field. Do not invent details. Do not smooth over contradictions.”
The user message contains the question plus the retrieved chunks in a fixed format:
text
[Chunk 3 | score 0.81 | Section: Billing Exceptions]
text...
[Chunk 7 | score 0.76 | Section: Account Tiers]
text...I ask for a structured response:
Answer (plain language)
Citations (list of chunk IDs used)
Uncertainty (any conflicts, missing information, or low-confidence points)
Suggested next action (optional)
Temperature stays at 0.2. I run the generation twice when the uncertainty field is non-empty and keep both outputs for the reviewer. The extra cost is small; the reduction in silent errors is not.
Stage 5: The Review Surface That Makes the Pipeline Honest
This is the part most tutorials skip. I built a minimal notebook / lightweight web view that shows:
the original question
the model’s answer
the uncertainty note
the exact text of every cited chunk, highlighted
the near-miss chunks that were retrieved but not cited
two buttons: Approve (optionally with edits) and Reject (with a required reason)
Approved answers are stored with their full provenance. Rejected answers are logged with the reason so I can later see whether the failure was retrieval, generation, or an ambiguous source document. Over time the rejection log becomes more valuable than any single accuracy metric.
For the family knowledge base I keep the review step even for low-stakes questions. It takes thirty seconds and has already caught two cases where the model confidently answered from an outdated note that had never been deleted.

A Concrete Walk-Through with Real Numbers
Last week I asked the pipeline a question against our internal support playbook: “What is the exact process for issuing a partial refund on a legacy plan?”
Retrieval returned six chunks. Two of them contained slightly different wording about whether manager approval was required for amounts under $50. The conflict flag fired. Mistral Large 4 produced a clear answer that cited both chunks and stated the uncertainty. The review surface showed the two conflicting paragraphs side by side. I spent forty seconds reading them, confirmed the current rule, edited one sentence, and approved. Total wall-clock time from question to approved answer: under three minutes, most of it human reading.
Without the conflict flag and the forced uncertainty field, the model would almost certainly have picked one version and presented it as settled. That is the quiet failure the pipeline is designed to make noisy.
Cost, Latency, and Maintenance Reality
On the API side a typical query costs a few cents. Latency is dominated by retrieval + two generation calls when uncertainty is present; it stays under ten seconds for the document sets I use. The larger ongoing cost is the human review time and the discipline of keeping the source documents clean. RAG does not remove maintenance; it changes what you maintain. You still have to notice when a policy document is updated and re-ingest it. You still have to watch the rejection log for patterns.
I schedule a thirty-minute weekly pass over new rejections and any documents that have changed. That is the real operating cost. The model is the easy part.
What I Still Don’t Know
I have not yet stress-tested this pipeline with multi-hop questions that require chaining more than three chunks. I have not measured how the conflict-detection heuristic behaves when the knowledge base grows past a few hundred documents. I have not compared the same pipeline with a fully local Mistral setup under quantization. Those experiments are already on the list.
The current design is good enough for the workloads I actually run: internal playbooks, technical decision records, and the family knowledge base. It is deliberately not “fully automated.” Fully automated is how quiet errors become production incidents.
Practical Checklist If You Want to Copy This
Chunk with overlap and keep section metadata.
Use hybrid retrieval.
Force citations and an explicit uncertainty field.
Over-retrieve slightly and show near-misses to the reviewer.
Log every rejection with a reason.
Budget human time; do not pretend the pipeline removes it.
The goal is not a system that never needs a human. The goal is a system where the human can see exactly what the model saw and decide whether the answer is safe to use. That is the difference between a demo and a workflow I am willing to rely on when the kids are already in bed and the only thing left is to get the answer right.
Here is what I controlled, here is what changed, and here is what I still don’t know. The pipeline above is the controlled part. The rest is still being measured.

No comments yet.