Skip to content
AI Foundations

RAG Explained: How AI Systems Use Enterprise Knowledge

How retrieval-augmented generation connects language models to organisational information, and why finding the right evidence is only part of producing a reliable answer.

Share this article

LinkedInXWhatsApp
On this page

Key Takeaways

  • RAG combines two capabilities: retrieval, which finds potentially relevant information, and generation, which uses a language model to compose a response from the question and supplied context.
  • Authorisation must be enforced before restricted content reaches the model or the user. Relevance alone is not permission to disclose a passage.
  • A citation is useful, but its presence does not prove that the cited passage supports the claim.
  • Retrieval coverage belongs to search design and evaluation. Faithfulness belongs to assessing the generated answer against the actual evidence.

The knowledge a language model does not have

A language model may be capable of explaining a complicated procurement policy, interpreting contractual language or summarising a technical manual. Yet it may know nothing about the policy an organisation approved last week, the contract it signed yesterday or the operating procedure that changed this morning.

Consider a multinational engineering company with thousands of documents distributed across procurement portals, SharePoint libraries, contract repositories and internal knowledge bases. An employee in Germany asks its AI assistant: "What approvals are required before onboarding a new supplier in Germany?"

A useful answer may depend on supplier risk classification, contract value, country-specific rules and current approval thresholds. A general-purpose language model might provide a plausible account of supplier onboarding, but that is not the same as identifying the policy that actually applies.

One approach is to make the relevant information available to the model when the question is asked. This is the idea behind retrieval-augmented generation, or RAG.

What RAG actually does

RAG combines two capabilities: retrieval, which finds potentially relevant information, and generation, which uses a language model to compose a response from the question and supplied context.

Some information becomes represented in a language model's parameters during training. That learned capability does not automatically give it access to a company's latest or private documents. RAG supplies external information at the time of the request, without necessarily changing the model's parameters.

A typical interaction follows five steps:

  1. Receive the question. An employee asks about German supplier approvals.

  2. Search authorised sources. The application searches knowledge available to that employee.

  3. Retrieve evidence. It identifies passages likely to address the question.

  4. Construct context. Selected passages accompany the question and instructions sent to the model.

  5. Generate the answer. The model composes a response, ideally with traceable source references.

The distinction is useful because organisational information changes frequently. But the ability to retrieve documents does not, by itself, guarantee that an answer is accurate, current or authorised.

Document preparation and question-time retrieval form two connected RAG flows.

Inside a RAG application

Figure 1. Inside a RAG application Document preparation and question-time retrieval are distinct but connected processes.

Data are illustrative.

Before a question is asked: preparing enterprise knowledge

Imagine a forty-page supplier-onboarding policy containing approval thresholds, tables, country exceptions and links to other procedures. A search application needs to make that material retrievable without losing the details that determine what the policy means.

How enterprise documents become searchable

  1. Ingest documents. Collect material from approved repositories and systems.

  2. Extract content. Preserve meaningful text, tables, headings and document relationships.

  3. Create chunks. Divide larger documents into retrievable sections.

  4. Generate embeddings where useful. Convert chunks into numerical representations for semantic search.

  5. Build an index. Preserve searchable content, document identity, versions, dates and relevant access metadata.

These stages are common design patterns, not universal requirements. A document might contain an approval threshold in a table with a footnote explaining an exception for high-risk suppliers. If extraction loses that footnote, retrieval may never provide the full evidence needed to answer correctly.

Chunking creates a similar trade-off. Small chunks can lose important context; large chunks can bury relevant information and consume the model's context budget. There is no universally correct chunk size. Metadata matters too: a passage can match the question perfectly while belonging to a superseded policy.

Document preparation is therefore part of information governance, not merely a technical conversion exercise.

Supplier policy chunks retain metadata and optional embeddings.

From documents to searchable knowledge

Figure 2. From documents to searchable knowledge Policy chunks retain source information and may include numerical embeddings. Identifiers and vectors are illustrative.

How the system finds relevant information

Keyword search remains valuable when employees know a policy number, supplier identifier or exact term. But people do not always ask questions using the same language as the source documents. Someone might ask who must "sign off" a supplier when the policy describes "onboarding authorisation requirements".

Semantic retrieval addresses this difference by using learned numerical representations, often called embeddings. An embedding model represents questions and passages as vectors, allowing the system to find potentially related material through similarity calculations. Similarity is a way of finding candidates, not proof that two passages mean the same thing.

Retrieval methodUseful for
Keyword searchExact identifiers, terms and policy names
Vector searchConceptually related wording
Hybrid searchCombining exact and semantic matches

RAG does not require a vector database. Some implementations use lexical search, structured queries or combinations of techniques. Search results may also be constrained by jurisdiction, policy version or document type.

Authorisation must be enforced before restricted content reaches the model or the user. Relevance alone is not permission to disclose a passage.

From search results to model context

Retrieval may produce several candidates, including duplicates, incomplete passages and sections that mention the topic without answering the question. The application must decide what to pass to the language model.

A representative sequence is:

  1. Retrieve candidate passages using appropriate search methods.

  2. Enforce permissions and apply relevant metadata constraints.

  3. Optionally rerank candidates by relevance.

  4. Select sufficient evidence without filling the context with unnecessary text.

  5. Construct the prompt from the question, evidence and appropriate instructions.

  6. Generate an answer and attach verifiable source references where possible.

Actual systems may perform these operations in a different order. Permission enforcement must remain effective throughout. Providing more retrieved text does not necessarily produce a better answer, especially when passages conflict or obscure an important exception.

Keyword and semantic retrieval lead to authorised filtering, reranking and evidence selection.

How retrieval selects evidence

Figure 3. How retrieval selects evidence Keyword and semantic search lead to permission-aware evidence selection and context construction.

Data are illustrative.

Why a working RAG system can still give the wrong answer

A RAG application can fail in several ways even when every component appears to function.

Outdated source: An old policy remains indexed while the new version has not been processed. The model may faithfully describe the wrong policy.

Incomplete retrieval: The system finds the standard approval rule but misses a separate exception for high-risk suppliers.

Unfaithful generation: The correct passages are retrieved, but the model confuses a recommendation with a mandatory requirement.

These failures require different remedies. Source freshness and authority belong to information management. Retrieval coverage belongs to search design and evaluation. Faithfulness belongs to assessing the generated answer against the actual evidence.

A citation is useful, but its presence does not prove that the cited passage supports the claim. An application can retrieve the right document and still produce the wrong answer.

Evaluating retrieval and generation separately

A meaningful test should use questions with known source documents and expected answers. Evaluation needs to distinguish:

  • Retrieval relevance and coverage: Did the system find the required passages and exceptions?

  • Answer faithfulness: Does the response accurately represent the retrieved evidence?

  • Factual correctness: Is the response correct even if a retrieved document is outdated?

  • Authorisation: Did the system respect the user's permissions?

  • Business usefulness: Can the employee understand and appropriately act on the answer?

Collapsing these into a single accuracy score makes diagnosis difficult. A highly relevant passage might be incomplete; a faithful summary might rely on obsolete information; and an apparently helpful answer might contain unsupported claims.

The level of assurance should reflect the consequences of the task. A low-risk knowledge lookup and a contractual approval decision do not necessarily justify the same review process.

What makes RAG enterprise-ready?

A demonstration might require little more than a small document collection, search and a language model. A dependable enterprise service needs accountable owners and controls across the system:

  1. Trusted sources: Authoritative documents, ownership, versions, provenance and updates.

  2. Authorised retrieval: Identity, permissions and controls against inappropriate disclosure.

  3. Grounded generation: Evidence use, traceable citations, uncertainty handling and evaluation.

  4. Operational assurance: Monitoring, feedback, incident investigation, index updates and clear responsibility.

Retrieved documents are not automatically trustworthy instructions. They may contain malicious text intended to redirect the model, a risk often called prompt injection. The application must treat external content as data rather than automatically obeying it.

An assistant that admits insufficient evidence and directs an employee to the responsible team may be more useful than one that always provides a confident response.

Four reliability controls: trusted sources, authorised retrieval, grounded answers and operational assurance.

Enterprise RAG reliability

Figure 4. Enterprise RAG reliability Enterprise reliability depends on source quality, authorised retrieval, grounded generation and operational assurance.

Data are illustrative.

When RAG is the right approach, and when it is not

RAG is useful when an application needs to explain or generate content using external information such as policies, manuals or research repositories. It is not the right default for every task.

If employees only need to locate documents, well-designed search may be enough. If they need the current status of a transaction, a direct authorised query to the relevant business system may be more dependable than retrieving document chunks. Fine-tuning, meanwhile, changes model parameters and can adapt behaviour, but it does not automatically create a current connection to changing enterprise knowledge.

Some applications combine retrieval, structured queries and language generation. The architecture should follow the work being done, not a preference for a particular technique.

Finding information is not the same as knowing what to trust

For years, organisations have invested in collecting, storing and organising information. They have built document repositories, knowledge portals and search systems, yet employees still spend considerable time trying to find the right information, establish whether it is current and understand how it applies to their work.

RAG offers a different way to interact with that knowledge. Instead of requiring employees to search through documents and assemble the answer themselves, an AI application can retrieve relevant material and help explain it in the context of a question.

But this convenience introduces a responsibility that organisations cannot afford to overlook.

When an employee reads a policy directly, they can examine its title, date, author and surrounding provisions. When an AI assistant produces an answer, much of that underlying process becomes less visible. The employee may receive a clear explanation without knowing which documents were consulted, what information was omitted or whether an important exception was missed.

The more natural and convenient these systems become, the easier it is to mistake a well-written answer for a well-supported one.

This is why building an effective RAG application requires more than connecting a language model to a document repository. It requires an organisation to decide which information is authoritative, how access should be controlled, how answers will be verified and who remains accountable when the system gets something wrong.

The real measure of success is not whether an AI assistant can answer thousands of questions. It is whether people can make better decisions because the answers are relevant, reliable and supported by evidence they can trust.

An organisation's knowledge becomes more valuable when people can use it with confidence, not merely when they can retrieve it faster.

Sources and further reading

  1. Lewis, P. et al. (2020). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. https://arxiv.org/abs/2005.11401

  2. Gao, Y. et al. (2023). Retrieval-Augmented Generation for Large Language Models: A Survey. https://arxiv.org/abs/2312.10997

  3. Yu, H. et al. (2024). Evaluation of Retrieval-Augmented Generation: A Survey. https://arxiv.org/abs/2405.07437

  4. NIST (2024). Artificial Intelligence Risk Management Framework: Generative Artificial Intelligence Profile. https://doi.org/10.6028/NIST.AI.600-1

  5. Microsoft Learn. Azure AI Search documentation. https://learn.microsoft.com/en-us/azure/search/

Editorial note: The engineering organisation and supplier-onboarding scenario are fictional.