Generative AI / TECHNICAL PERSPECTIVE

RAG Architecture: How AI Can Answer Using Your Business Knowledge

Explore how RAG architecture connects AI to business knowledge, improves the grounding of answers and helps organisations manage retrieval quality, access, cost and risk.

RAG ArchitectureRetrieval-augmented generationEnterprise generative AIVector searchHybrid retrievalAI evaluationKnowledge management
REFERENCE WORKFLOW03 stages
01Prepare approved knowledge, preserve source permissions and maintain a searchable index
02Authenticate the user, retrieve and rank authorised evidence, then generate a grounded response
03Check citations and answer quality; respond, clarify or escalate and monitor outcomes
EXECUTIVE SUMMARY

Key takeaways

  • RAG connects a language model to external evidence at the time of a request without necessarily retraining it.

  • A reliable retrieval pipeline matters as much as the model that writes the answer.

  • Permissions, document versions and source authority must travel with the indexed content.

  • Hybrid retrieval and reranking can improve evidence selection, but should earn their place through evaluation.

  • A citation is useful only when the referenced evidence actually supports the claim and the user can access it.

  • Compare the full cost and accepted outcomes of RAG with existing search or other simpler approaches before scaling.

01 PRACTICAL GUIDANCE

What happens when your AI assistant reads the wrong policy?

Imagine a customer-service adviser at an insurance company asking an AI assistant whether a policyholder can claim for a cancelled journey. The assistant gives a clear, confident answer. Unfortunately, it has relied on an older version of the policy that does not contain the latest exclusions. The adviser now has an additional problem: a plausible answer that may take longer to verify than finding the original document.

The company already has the information it needs. It exists in policy schedules, endorsements, operating procedures and approved guidance. The difficulty is connecting the right information to the right question at the right moment.

This is where retrieval-augmented generation, commonly called RAG, becomes useful. A well-designed RAG architecture allows an AI application to consult relevant business knowledge before composing a response. It can also show where that information came from and acknowledge when the evidence is insufficient.

The opportunity is not simply to introduce another chatbot. It is to make organisational knowledge easier to use without giving up control over who can access it, which documents are authoritative or how important decisions are made.

02 PRACTICAL GUIDANCE

How retrieval-augmented generation actually works

A large language model (LLM) generates responses using patterns learned during training and information provided in its input. It does not automatically know a company’s current procedures, private contracts or updated product terms. RAG addresses this gap by finding relevant external information and adding it to the model’s input before generation.

The influential 2020 research by Lewis and colleagues combined a trained language model with a retrievable external document index and demonstrated improvements on knowledge-intensive tasks under the study conditions.[1] Modern enterprise implementations use a range of retrieval methods and need not reproduce that original training architecture.

Think of RAG as an open-book approach to answering questions. The retriever locates useful material; the language model interprets it and explains it in ordinary language. The application can attach references to the evidence and apply additional checks. None of these steps alone guarantees a correct answer.

In architectural terms, there are two connected paths. The knowledge-preparation path keeps business content searchable and current. The request-time path uses that prepared knowledge to answer an individual question within the user’s permitted scope.

03 PRACTICAL GUIDANCE

The knowledge pipeline: prepare evidence before anyone asks

Start with sources that have identifiable business owners. These may include document repositories, approved knowledge bases, product manuals and internal procedures. Connectors import the permitted content and capture its identity, effective date, version, classification and access permissions.

Document processing is rarely just text extraction. A scanned PDF may need optical character recognition; a table may need its column headings preserved; a contract clause may need the definitions that explain it. Poor extraction can remove the very qualification that makes a statement accurate.

Next, split larger documents into retrievable passages, often called chunks. A useful chunk contains enough information to be understood independently, while remaining focused on a particular subject. Preserve section titles, clause identifiers and links to the parent document. For policies, a rule and its exceptions should be retrievable together.

An embedding model can convert each chunk into a numerical representation of its meaning. A vector index supports similarity-based retrieval over these representations. A lexical index supports keyword matching, while metadata supports restrictions such as product, jurisdiction, effective date and user permissions. Some search services combine these capabilities in one engine.

Knowledge preparation is an ongoing process, not a one-time upload. Capture document updates and deletions, synchronise permission changes, monitor indexing delays and retire superseded versions. When the source system changes, the search layer must reflect that change within a defined service target.

04 PRACTICAL GUIDANCE

From a question to a grounded response

A request begins with authentication and authorisation. The application determines the information the user is allowed to access, then interprets the question and identifies relevant constraints. For example, a policy question may require the product, market and applicable policy version. If those details are missing, a clarification may be better than a guess.

The search layer retrieves candidate passages from authorised sources. A reranker may then assess which candidates are most useful for the specific question. The application removes duplicates and assembles an evidence package containing the selected passages, stable source identifiers and any important contextual details.

The LLM receives the question, the evidence and instructions describing the allowed response. It should distinguish what the sources establish from what remains uncertain. Where evidence conflicts or is missing, the appropriate result may be a clarification, a limited answer or referral to a person.

Finally, the application checks that citations refer to genuine, authorised source passages and tests whether substantive claims are supported by them. Such checks may combine deterministic rules, evaluation models and human review. Checking that a citation exists is easier than establishing that it proves the claim.

The request-time path is therefore: authenticated question → permission-constrained search → candidate ranking → evidence assembly → language model → citation and response checks → answer or controlled escalation. Retrieval and generation are distinct components, so failures in either can be diagnosed separately.

05 PRACTICAL GUIDANCE

Why semantic search alone can miss important information

Suppose an employee searches for an equipment failure using the phrase “motor keeps stopping”. Vector search may find a troubleshooting guide that uses the phrase “intermittent drive shutdown”. The wording differs, but the concepts are related. However, when the employee supplies the exact fault code E-417, ordinary keyword matching may be more effective.

Hybrid retrieval combines lexical and semantic search so that both kinds of evidence can be considered. Reciprocal rank fusion, for example, combines ranked result lists rather than directly comparing scores that may use different scales.[2] A subsequent reranker can further assess candidate relevance, but introduces additional processing time and cost.

There is no universally correct chunk size or number of passages to retrieve. Test alternatives using realistic questions, including exact identifiers, exceptions, ambiguous language and questions requiring evidence from more than one document. Retrieving more material can increase coverage while also adding distractions.

Research published in 2024 found that some evaluated language models performed less reliably when relevant information was placed in the middle of long inputs.[3] This is a reason to test how your chosen model uses evidence, not to assume that every modern model has the same behaviour. A large context window is not a substitute for selecting useful information.

06 PRACTICAL GUIDANCE

Which RAG design is appropriate for your business?

A small, controlled knowledge base does not necessarily need the same infrastructure as a multinational enterprise with millions of frequently changing documents. Select architectural complexity in response to a demonstrated need.

Basic RAG: Retrieve passages through a single search method and provide them to a model. Suitable for a focused, well-maintained knowledge collection. Limitation: complex questions and specialised terminology may be missed.

Hybrid RAG with reranking: Combine keyword and vector retrieval, then refine the result order. Suitable for heterogeneous enterprise documents and questions containing both exact terms and conceptual descriptions. Limitation: additional tuning and latency.

Multi-step retrieval: Decompose a complex question into smaller searches and combine the evidence. Suitable for questions spanning multiple products, documents or procedures. Limitation: incorrect decomposition, extra calls and more opportunities for error.

Graph-enhanced RAG: Use explicit relationships between entities, such as suppliers, contracts and obligations, alongside document retrieval. Suitable where those relationships are essential to answering questions. Limitation: graph construction, relationship accuracy and maintenance overhead.

Choose the simplest architecture that meets measured requirements. Advanced retrieval does not compensate for contradictory source material or missing business ownership.

07 PRACTICAL GUIDANCE

Business knowledge must not become a security loophole

An employee who cannot open a confidential document in its original repository must not be able to obtain its contents through a RAG assistant. Use trusted identity information and enforce document-level authorisation when searching and fetching evidence, before it is sent to the model. Test permission revocation, tenant separation and inherited group permissions.

Treat retrieved documents as untrusted data for instruction-following purposes, even when they come from an approved repository. A document may contain malicious instructions intended to redirect the assistant. OWASP identifies both indirect prompt injection and weaknesses in vector retrieval systems as important security concerns.[4][5]

Keep privileged actions outside the authority of retrieved text. Restrict ingestion privileges, isolate sensitive indexes where appropriate and test for cross-user disclosure. Prompt instructions and output filters can reduce some risks, but they cannot replace enforceable access controls.

Protect embeddings, source passages, logs and caches according to their sensitivity. Avoid reusing cached answers across incompatible permission scopes. Verify authorisation for source links and design for deletion of indexed content and derived artefacts under the applicable retention policy.

A useful governance arrangement assigns responsibility for document accuracy to business owners, retrieval and index health to the engineering team, and permissions and risk controls to the appropriate security and oversight functions.

08 PRACTICAL GUIDANCE

An example: helping an adviser interpret an insurance policy

Consider the hypothetical insurance service described earlier. An adviser needs to explain whether a travel claim may be covered after a cancellation. The application asks for the relevant product and policy version, then retrieves the applicable policy wording and endorsement from approved records within the adviser’s access permissions.

If the wording states that a particular event is covered only under specified conditions, the answer includes those conditions and the relevant source references. The model must not infer that the claim is approved merely because a similar event appears in a policy document.

If an endorsement changes the base wording, the application should use the applicable precedence rules configured by the business. Where the evidence remains inconsistent, it should route the case to a qualified reviewer. Customer-specific claim records should be accessed through properly authorised business systems when required.

The intended benefit is a faster route to relevant, reviewable information. The insurer should measure whether advisers actually find correct evidence sooner and whether policy-related errors decrease, without weakening existing claims assessment and approval controls.

09 PRACTICAL GUIDANCE

RAG, fine-tuning or a better search engine?

RAG is especially attractive when an answer depends on changing information, references or private documents. Fine-tuning adjusts model parameters and may be useful for consistent task behaviour, classification or output conventions. It is not an efficient general-purpose way of synchronising changing company policies or enforcing document permissions.

The two approaches can work together. A fine-tuned model may generate a consistent response format while RAG provides current evidence. For a small collection of stable documents, supplying selected documents directly to a model may be sufficient, subject to input limits, privacy requirements and evaluation.

For precise account balances, inventory counts or revenue figures, authorised database queries or business APIs are often preferable to searching text fragments. The model may explain the verified result, but the authoritative calculation should remain with the appropriate data system.

If users only need to locate original documents, improving conventional search may provide the desired outcome without generation. RAG should solve a genuine information-use problem, rather than create a conversational interface for its own sake.

10 PRACTICAL GUIDANCE

Measure retrieval, answer quality and business outcomes separately

A polished demonstration proves very little about production reliability. Build a representative evaluation set with expected answers, applicable versions, supporting passages and user permissions. Include unanswerable questions, conflicting sources, recently updated policies, multi-document questions and attempts to access restricted information.

Retrieval metrics show whether the system finds the right evidence. Recall@k measures the proportion of labelled relevant passages included among the first k results; ranking metrics such as normalised discounted cumulative gain can help assess whether the most useful evidence is near the top. Define the evaluation unit and relevance judgements consistently.

Generation metrics assess answer correctness, evidence support, completeness, citation correctness and appropriate abstention. An answer can be supported by a retrieved passage yet still be wrong if the passage is outdated or inapplicable. Subject-matter experts should review important failures and calibrate any automated evaluators.

For operational monitoring, track indexing freshness, unauthorised retrieval attempts, end-to-end latency, escalations and cost per accepted answer. The Microsoft Azure architecture guidance recommends systematic experimentation across ingestion, retrieval and evaluation choices rather than assuming an initial configuration is optimal.[6]

Measure user outcomes as well: the time needed to find an acceptable answer, the proportion of questions resolved without unnecessary escalation and the rate of material mistakes. Compare with the existing search process at equivalent acceptance standards. Maintain explicit limits for critical errors and data disclosure rather than trading them against aggregate productivity gains.

11 PRACTICAL GUIDANCE

What does an enterprise RAG system cost to operate?

The cost extends beyond the language model. Document extraction, connector maintenance, embeddings, index storage, search, reranking, model input and output, monitoring and expert review all contribute. Updating large repositories can incur additional processing costs even when few users are asking questions.

A practical measure is total attributable operating cost divided by the number of answers that meet defined acceptance criteria. Include unsuccessful searches, repeated requests and human review in the numerator. Add integration and maintenance costs when assessing the investment over its expected lifetime.

Selective indexing, targeted retrieval and a suitable model may reduce cost, but evaluate their effects on completeness, latency and accuracy. A narrowly scoped service that reliably handles a valuable workload can be a better investment than a broadly deployed assistant with poorly measured performance.

Before expanding, establish whether the current system meets agreed quality and security requirements and whether its benefits justify the incremental cost of additional sources, users or architectural components.

12 PRACTICAL GUIDANCE

Start with one knowledge problem worth solving

Choose a question type that occurs often, has a reliable source of truth and consumes meaningful employee effort. Identify the document owner and the consequences of an incorrect answer. Establish a baseline using the existing search or manual process.

Create a limited pilot using approved documents and representative questions. Test source extraction, retrieval, generation, permission enforcement and the behaviour when an answer is unavailable. Introduce hybrid retrieval or other enhancements only where the evaluation exposes a specific weakness.

If your organisation is assessing a knowledge assistant or struggling with an existing RAG implementation, a focused review of its content readiness, retrieval design, access model and evaluation approach can help identify where the next investment belongs. Explore related Generative AI perspectives at https://puneettbhatnagr.com/articles/generative-ai/.

The goal of RAG architecture is not to make AI sound more knowledgeable. It is to make answers more useful, more traceable and more accountable to the evidence on which the business relies.

13 PRACTICAL GUIDANCE

References and further reading

[1] Lewis, P., et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Advances in Neural Information Processing Systems, 33. Source: https://papers.nips.cc/paper/2020/hash/6b493230205f780e1bc26945df7481e5-Abstract.html

[2] Microsoft Learn. Relevance scoring in hybrid search using Reciprocal Rank Fusion (RRF). Source: https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking

[3] Liu, N. F., et al. (2024). Lost in the Middle: How Language Models Use Long Contexts. Transactions of the Association for Computational Linguistics, 12, 157–173. Source: https://aclanthology.org/2024.tacl-1.9/

[4] OWASP Cheat Sheet Series. LLM Prompt Injection Prevention Cheat Sheet. Source: https://cheatsheetseries.owasp.org/cheatsheets/LLM_Prompt_Injection_Prevention_Cheat_Sheet.html

[5] OWASP Gen AI Security Project. LLM09:2026 Vector and Embedding Weaknesses. Source: https://genai.owasp.org/llm2026/llm092026-vector-and-embedding-weaknesses/

[6] Microsoft Azure Architecture Center. Design and develop a RAG solution. Source: https://learn.microsoft.com/en-us/azure/architecture/ai-ml/guide/rag/rag-solution-design-and-evaluation-guide

WORKED EXAMPLE / SAMPLE DATA

Apply the approach

Illustrative pilot evaluation for an insurance knowledge assistant. The following numbers are assumed solely to explain how retrieval, answer acceptance and cost can be measured; they are not observed customer results, forecasts or industry benchmarks. The test comprises 100 questions, each with exactly one labelled relevant passage and an expected answer.

Retrieval recall@590%

Assume the required passage is among the first five retrieved results for 90 of 100 questions: 90 divided by 100. This does not establish that the generated answer is correct.

Accepted answers82%

Assume 82 of 100 answers meet the predefined correctness, completeness, citation and access criteria. The remaining 18 are not accepted, including appropriate escalations when an answer was expected.

Cost per accepted answer₹5

Assume total attributable operating cost for all 100 questions is ₹410, including retrieval, generation and allocated review costs. ₹410 divided by 82 accepted answers equals ₹5. These figures are illustrative, not a service price.

IMPLEMENTATION CHECKLIST

Put the approach into practice

  1. 01Select one valuable knowledge-intensive workflow and define the business owner, baseline and acceptance criteria.
  2. 02Inventory authoritative sources, applicable document versions, access permissions and update requirements.
  3. 03Build a minimal retrieval and generation pipeline, with traceable citations and explicit abstention behaviour.
  4. 04Evaluate representative questions, permissions, conflicting evidence, freshness and critical failure cases before rollout.
  5. 05Compare accepted-answer cost, user effort and error rates with the current process; scale only after the pilot satisfies agreed controls.
COMMON QUESTIONS

Frequently asked questions

What is the difference between RAG architecture and a vector database?

RAG is the complete pattern for retrieving evidence and generating a response using it. A vector database or vector-capable search engine is one possible component. Keyword search, structured data retrieval or hybrid search can also support RAG.

Does RAG eliminate hallucinations?

No. RAG can supply evidence that the model would otherwise lack, but retrieval may miss important information, sources may be outdated and the model may misinterpret passages. Evaluate evidence support, correctness and abstention behaviour independently.

Can a RAG system answer from private company documents?

Yes, when the organisation authorises the processing and implements effective identity, document permissions, data handling and model access controls. Private documents should not enter the model input merely because they match a search query.

How often should a RAG index be refreshed?

Set refresh requirements according to the consequences of stale information and the frequency of source changes. Use event-driven or scheduled synchronisation as appropriate, verify that changes and deletions propagate, and enforce permission updates before restricted content can be retrieved.

Do I need to fine-tune a model to implement RAG?

No. Many RAG applications use an existing language model and provide retrieved passages as context. Fine-tuning may be useful for specific behaviour or formats, but it is a separate decision that requires its own evaluation.

How much data does a business need to start with RAG?

There is no fixed minimum number of documents. A small, authoritative collection may be enough for a narrow use case. Coverage, currency, permissions, structure and the availability of representative evaluation questions are more important than document volume.

CONTINUE EXPLORING

Related articles

Continue through the same expertise domain or explore another perspective.

Generative AI
Puneett Bhatnagr · 14 min read

Advanced RAG Architecture Patterns: Beyond the Basic AI Chatbot

Discover how advanced RAG architecture patterns help enterprise AI find better evidence, handle complex questions, respect permissions and deliver more dependable answers without unnecessary complexity.

Advanced RAG architecture patternsHybrid retrievalContext engineeringHierarchical retrievalGraphRAGAgentic RAGRAG evaluation
Read article
Generative AI
Puneett Bhatnagr · 13 min read

Beyond OCR: How Multimodal AI Can Understand Enterprise Documents

Explore how multimodal AI for enterprise documents interprets text, tables and images, supports reliable extraction, and reduces manual work with human oversight.

Multimodal AI for enterprise documentsDocument intelligenceVision-language modelsOptical character recognitionMultimodal RAGHuman-in-the-loop validation
Read article
Generative AI
Puneett Bhatnagr · 14 min read

Can You Trust Your AI? Building an LLM Evaluation Framework

An LLM evaluation framework helps businesses test AI for accuracy, groundedness, safety, cost and reliability before deployment and throughout production.

LLM Evaluation FrameworkGenerative AILLM evaluationRAG evaluationLLM-as-a-judgeAI testingAI assuranceContinuous evaluation
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Embedding Model Selection: Why Your AI Must Find the Right Evidence

Choosing an embedding model shapes the quality, cost and reliability of enterprise AI search. Learn how to evaluate models, benchmark retrieval and build a dependable RAG system.

Embedding model selectionRetrieval-augmented generationSemantic searchVector embeddingsHybrid retrievalRetrieval evaluationGenerative AI
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Enterprise Context Engineering: Why Better AI Needs Better Context

Discover how enterprise context engineering helps AI use relevant, authorised business information to improve answer reliability and reduce avoidable rework.

Enterprise context engineeringGenerative AIRetrieval-augmented generationContext managementEnterprise knowledge assistantsAI evaluationAI security
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Generative AI Architecture: Building Beyond the Chatbot

Explore generative AI architecture for enterprises, from models and knowledge retrieval to security, evaluation, deployment and business value.

Generative AI ArchitectureEnterprise AI architectureLarge language modelsRetrieval-augmented generationAI orchestrationLLMOpsAI securityAI evaluation
Read article
Generative AI
Puneett Bhatnagr · 13 min read

Hybrid Search for Generative AI: Better Answers Start with Better Search

Why do AI assistants miss information your business already holds? Discover how keyword and vector search work together to improve enterprise RAG, retrieve relevant evidence and make AI answers more dependable.

Hybrid searchGenerative AIRetrieval-augmented generationBM25Vector searchSemantic rerankingEnterprise knowledge management
Read article
Generative AI
Puneett Bhatnagr · 13 min read

LLM Fine-Tuning vs RAG: Which Approach Does Your Business Need?

Should your AI learn new behaviour or retrieve better information? Explore LLM fine-tuning vs RAG through business examples, architecture choices, cost trade-offs and practical evaluation criteria.

LLM fine-tuningRetrieval-augmented generationEnterprise generative AIModel adaptationKnowledge groundingLLM evaluationLoRAAI architecture
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Prompt Injection Defence for LLMs: When AI Reads the Wrong Instructions

Learn how prompt injection threatens enterprise AI assistants and how layered security, restricted permissions and independent checks can reduce business risk.

Prompt injection defence for LLMsGenerative AI securityIndirect prompt injectionRAG securityAI guardrailsAI agent securityLeast privilege
Read article
Generative AI
Puneett Bhatnagr · 14 min read

RAG Chunking Strategies: Why Your AI Misses the Right Answer

Learn how RAG chunking strategies preserve meaning, improve document retrieval and help AI assistants deliver reliable, evidence-based answers at a manageable cost.

RAG chunking strategiesRetrieval-augmented generationSemantic chunkingDocument retrievalContext engineeringRAG evaluation
Read article
Generative AI
Puneett Bhatnagr · 13 min read

RAG Reranking Techniques: Why Finding the Right Evidence Matters

Explore how RAG reranking techniques improve the relevance of evidence behind AI answers, compare retrieval strategies and learn when a reranker is worth the investment.

RAG reranking techniquesRetrieval-augmented generationCross-encoder rerankingHybrid searchSemantic searchRetrieval evaluationContext engineering
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Structured Outputs in LLM Applications: Beyond Better Answers

Turn AI-generated language into dependable application data. Learn how JSON Schema, independent validation and safe workflow integration make structured outputs useful for business.

Structured outputsGenerative AIJSON SchemaConstrained decodingLLM applicationsOutput validationDocument intelligenceFunction calling
Read article
Generative AI
Puneett Bhatnagr · 12 min read

Synthetic Data for Generative AI: When Real Data Is Not Enough

Learn how synthetic data can strengthen generative AI training and testing, expand coverage of rare scenarios and reduce dependence on sensitive records while preserving reliability.

Synthetic dataGenerative AIInstruction tuningAI evaluationData augmentationData privacyModel collapse
Read article
Generative AI
Puneett Bhatnagr · 12 min read

When AI Sounds Certain but Is Wrong: LLM Hallucination Detection

Can your business trust its AI-generated answers? Explore how LLM hallucination detection combines evidence checks, uncertainty signals and human oversight to catch unreliable claims before they influence decisions.

LLM hallucination detectionGenerative AIAI factualityRetrieval-augmented generationSemantic entropyLLM evaluationAI reliabilityHuman oversight
Read article
LET'S CONNECT

Let’s build something with AI.

I welcome conversations about enterprise AI, strategic advisory, executive leadership and research collaboration.

Use the inquiry form below
  • AI engineering and enterprise architecture
  • Responsible AI and model risk
  • Executive opportunities and consulting
  • Research and technical collaboration
AI collaborationA message connects enterprise AI strategy, AI engineering and responsible governance.AI COLLABORATIONConnectStrategyEngineeringGovernance

Send me an inquiry

Tell me about your AI challenge, leadership opportunity or research idea.

Please do not include confidential business data.

Enter the answer to confirm you are human.
Let’s connect

Explore the portfolio

Search the eight expertise pages, selected case studies and research records.