The policy-wording assistant at Highveld Mutual, our fictional South African insurer, was built in three weeks. It answered questions from 60 product documents, cited them correctly and impressed everyone who tried it. Then the business asked for the full estate: 400,000 documents across policy wordings, claims procedures, underwriting guidelines, broker circulars and scanned endorsements going back fifteen years. Within a month the team was dealing with questions no prompt could answer. Which version of the 2019 household wording applies to a policy renewed in 2022? Why can a broker's assistant quote from an internal underwriting memo? Who decides that a withdrawn circular comes out of the index, and how quickly?
None of those are prompting problems. They are data problems: ownership, permissions, versioning, freshness and lineage. Retrieval-augmented generation (RAG) is a data product with a model attached, and it needs to be run like one.
CloudNala has covered retrieval engineering in two series: RAG That Survives Production, from the retrieval pipeline end to end to operating RAG after launch, and Enterprise Knowledge Architecture Beyond Basic RAG. This part does not repeat the mechanics. It gives you the decision tools: which pattern fits, what the data product must provide, and how to size it honestly.
From prompt trick to pipeline
The original RAG paper by Lewis and colleagues (NeurIPS 2020) combined a language model with a retriever over a dense vector index. Enterprise RAG keeps that idea and surrounds it with everything a production data system needs.
Two pipelines meet at the index. The index lane runs continuously: approved sources are ingested, parsed, classified, chunked, enriched and indexed, carrying each document's permissions with its text and vectors. The question lane runs per request: the question is rewritten and authorised, retrieval combines lexical and vector search and filters by the asker's permissions, results are reranked and composed into a bounded context, and the answer is generated with citations that are checked before the user sees them.
A few points in that flow carry most of the risk:
- Permissions are applied during retrieval, not after generation. Once a restricted passage is in the model's context, no output filter reliably removes its influence. See permission-aware retrieval.
- Hybrid retrieval is the default, not an upgrade. Vector search finds paraphrases; lexical search finds policy numbers, clause references and product codes. Reciprocal rank fusion, introduced by Cormack, Clarke and Büttcher at SIGIR 2009, is a simple, widely used way to combine the two ranked lists. Hybrid search in plain language explains why.
- Context composition is a design step. Liu and colleagues found in Lost in the Middle (TACL 2024) that models they tested used relevant information best when it appeared at the start or end of a long context. Newer models may behave differently, but the lesson holds: more context is not automatically better context. Reranking, context budgets and cost covers the trade-off.
Five patterns compared
The research literature uses different labels. A widely cited survey by Gao and colleagues groups systems into naive, advanced and modular RAG. For architecture decisions, five patterns are more useful:
| Pattern | Best fit | Main limitation |
|---|---|---|
| Naive RAG | Small, clean corpus and low-risk discovery | Weak filtering, ranking and lifecycle control |
| Advanced RAG | Production knowledge assistants | More components and evaluation work |
| GraphRAG | Relationship-heavy domains and questions about a whole corpus | Graph construction and governance cost |
| Agentic RAG | Multi-step research and tool-supported retrieval | Higher latency, cost and control complexity |
| Multimodal RAG | Documents with tables, images, scans, audio or video | Extraction and cross-modal evaluation difficulty |
Two notes on the less common patterns. Microsoft's GraphRAG paper (Edge and colleagues, 2024) targets "global" questions about an entire corpus, such as the main themes across all complaints, which conventional vector retrieval handles poorly. Its repository warns that indexing can be expensive and recommends starting small. CloudNala's when you need a knowledge graph gives the test. Agentic RAG lets the harness from Part 2 decide what to retrieve next, which helps with research tasks and makes every control in that part apply to retrieval too.
Highveld's policy-wording assistant needed advanced RAG with a multimodal ingestion step for scanned endorsements. It did not need a graph or an agent. Most enterprise knowledge assistants are in the same position.
What makes it a data product
A data product has an owner, consumers, a defined quality and a lifecycle. Use this matrix to check whether your retrieval estate is one. Each row moves from a demo to a governed product.
| Dimension | Demo | Production pilot | Data product |
|---|---|---|---|
| Ownership | The developer | A project team | Named owner per source collection, with a consumer list |
| Source approval | Whatever was uploaded | Agreed folder | Approved sources with classification and purpose |
| Permissions | None | Filter added in the app | Source permissions carried into the index and enforced at query time, with tests |
| Freshness | Rebuilt by hand | Nightly batch | Freshness target per collection, change capture, and a revocation lag the owner accepts |
| Versioning | Latest only | Overwrites | Document versions and effective dates; index and embedding model versioned |
| Ingestion reliability | Script | Scheduled job | Queues, replay, dead-letter handling and idempotent processing |
| Quality | Spot checks | Test questions | Retrieval and answer evaluation run separately, on a versioned set |
| Lineage | None | Citation shown | Answer traced to chunk, document version and source system |
| Lifecycle | None | Manual removal | Retention, withdrawal and correction processes |
| Cost | Ignored | Monthly bill | Cost per collection and per accepted answer |
Three rows cause most production incidents.
Permissions and revocation lag. Carrying permissions into the index is now a native capability in some platforms, but it is not instant. As a dated example, Microsoft's documentation for document-level access control in Foundry IQ (Azure AI Search), checked on 18 November 2026, describes native filtering from several sources as generally available, with sensitivity-label enforcement still in preview. It also notes that permission changes are not revoked immediately. The older security filter pattern is explicit that the filter is a string the application supplies, not authentication in itself. Whatever platform you use, the gap between a permission change in the source and its effect in the index is a number the data owner must know and accept.
Versioning and effective dates. Insurance, legal and public-sector content changes over time while old versions stay in force for existing contracts. An index that holds only the latest wording will answer confidently and wrongly for every older policy. Index the effective dates and filter on them.
Embedding migration. When you change embedding models, existing vectors are not comparable with new ones. Google's Gemini embeddings documentation states that its two generations of embedding model produce incompatible spaces and that upgrading means re-embedding all existing data. Plan model changes as index migrations, with a parallel index, an evaluation run and a cut-over, not as a configuration change.
A worked sizing example
Sizing claims for RAG often circulate without assumptions. Here is Highveld's estate worked through with every assumption stated. These are illustrative figures for a fictional organisation, not benchmarks.
| Assumption | Value |
|---|---|
| Documents | 400,000 |
| Average length | 6 pages at about 500 tokens per page, so 3,000 tokens per document |
| Chunk size and overlap | 500 tokens with 50 tokens of overlap, so about 7 chunks per document |
| Embedding dimensions | 1,024, stored as 32-bit floats (4 bytes each) |
| Daily change | 2% of documents added or updated |
From those assumptions:
- Total corpus: 400,000 × 3,000 = 1.2 billion tokens.
- Chunks: 400,000 × 7 = 2.8 million.
- Raw vector storage: 2.8 million × 1,024 × 4 bytes ≈ 11.5 GB, before index structures, metadata, text, replicas and backups, which can multiply it several times.
- Daily re-embedding: 2% of 400,000 is 8,000 documents, or about 56,000 chunks a day.
- Embedding model change: all 1.2 billion tokens re-embedded, plus a parallel index while you evaluate the new one.
Change any assumption and the numbers move a lot. Halve the chunk size and you roughly double the chunks and the storage. The point is not the totals. It is that each number comes from a decision someone owns, and that the one-off cost of a model change is predictable if you work it out before you need it. CloudNala's chunking is a business decision explains why chunk size belongs to the content owner as much as to the engineer.
Scale needs plumbing
At Highveld's scale, ingestion is a distributed system. Documents arrive from a policy administration system, a claims platform, SharePoint sites and a scanning bureau. That needs:
- change-data capture or event feeds from sources, not nightly full reloads;
- queues with replay, so a parser fix can reprocess affected documents;
- dead-letter handling for documents that fail parsing, with an owner who reviews them;
- idempotent processing, so a replayed document does not create duplicate chunks;
- tenant isolation where several business units or clients share infrastructure;
- caching that respects permissions, because a cached answer to one broker's question must not be served to another broker with different access.
The last point catches many teams. A semantic cache that matches similar questions and returns a stored answer is a retrieval system with no permission check unless you add one.
Where RAG connects to the rest of the control plane
- Security (Part 6): retrieval without permission filtering and unprotected vector stores are two of the twelve leak surfaces.
- Continuity (Part 7): when the model is unavailable, a retrieval-only mode that returns ranked source passages may still be valuable. When the index is unavailable, the model should not answer from memory.
- AgentOps (Part 5): retrieval settings, chunking and embedding model are part of the release bundle.
- Evaluation (Part 3): evaluate retrieval separately from the answer, so you know which stage to fix.
The South African version
Three local conditions shape the data product.
- Uneven source quality. Scanned forms, handwritten notes and documents in several languages are normal. Multimodal extraction and language coverage need their own evaluation cases, or the assistant will quietly underperform on exactly the customers it most needs to serve.
- Residency. The index holds copies of the source text, so it holds the same personal information. Where the index and embedding service are hosted is part of the same cross-border question as the model endpoint. Part 6 covers the POPIA considerations.
- Small teams. A data product needs owners who stay after the build team leaves. Assign source owners from the business, not from the project.
Retrieval design review
Before scaling a RAG system beyond a pilot:
- Name an owner for each source collection and list its consumers.
- Confirm permissions are enforced during retrieval, test them with users of different entitlements, and record the revocation lag.
- Index effective dates and versions where content changes over time.
- Choose hybrid retrieval by default; justify graph or agentic patterns with the questions they answer.
- Work out the sizing with stated assumptions, including the cost of an embedding model change.
- Build ingestion with replay, dead-letter handling and idempotency.
- Check that any cache respects permissions.
- Evaluate retrieval and answers separately on a versioned set.
Next: Part 5, AgentOps: operating AI that can take action. Previous: Part 3, Build the evaluation system before the agent. All parts are on the series page.
How CloudNala can help
CloudNala turns RAG pilots into data products. We map your sources to owners, design the ingestion and permission model, test permission filtering and revocation lag, size the index with stated assumptions, and set up separate retrieval and answer evaluation. You leave with a retrieval architecture your data owners can sign off and your operations team can run.
Work with CloudNala
CloudNala helps organisations move from technology ambition to practical execution across cloud, AI, data, platform engineering and digital services.
Whether you are exploring AI, modernising your cloud environment, building a public-sector digital service, or turning an idea into a working MVP, we can help you shape the roadmap and deliver the next step.
Book a Retrieval Architecture Review or write to us at consult@cloudnala.co.za
