Knowledge assistants

RAG architecture from source document to checked answer

Reading time
8 minutes
Published
Written by
modernagents editorial teammodernagents is an AI automation agency for SMEs.
Illustration: a document, a padlock, a magnifying glass and a ticked answer in a speech bubble

A RAG architecture connects two workflows: controlled preparation of sources and answering individual questions from relevant authorized information. Searchable content, metadata and access rules sit between them. A dependable design shows ownership, update states and behavior when evidence is missing, as well as databases and models.

Key takeaways

  • For an initial company assistant, a modest architecture is usually easier to evaluate; additional retrieval stages or autonomous tools should address a demonstrated gap.
  • Restricted documents should never reach the model rather than being removed from an answer after generation.
  • Separate retrieval failures from generation failures: this shortens diagnosis and avoids unnecessary model replacement.
  • The architecture is sufficient when it fulfills the agreed task reliably and inspectably.

For an initial company assistant, a modest architecture is usually easier to evaluate. Start with a defined task, an approved source collection and repeatable questions. Additional retrieval stages or autonomous tools should address a demonstrated gap rather than serve as prerequisites for calling the design RAG.

RAG data flow showing sources, access control and supported answers

01 / 16

Derive the design from the task

State what the assistant must do for you to consider the task complete. Should the assistant find a passage, combine several documents or explain current system status? These require different information paths. A document index is not a substitute for a live inventory query.

Record user groups, allowed sources, freshness requirements and the consequences of a wrong answer. An internal handbook assistant can have different boundaries from a system whose output triggers approval. Those differences influence identity, evaluation and handoff.

Reference architectures help identify components but do not replace selection. Google publishes a managed RAG design using retrieval and model services; that does not mean every small company needs the same infrastructure. Google: RAG reference architecture.

02 / 16

Path one: how does an original source become an approved search collection?

The ingestion path of a RAG architecture runs through these steps:

  1. Ingestion begins with an identified source.
  2. A connector collects content and metadata under a defined technical identity.
  3. Extraction converts the format into usable text or structured data.
  4. The application then forms suitable passages and, where needed, numerical representations for retrieval.

Before activation, establish source identity, version, validity and access scope. Incompletely retrieved documents need an explicit state. An empty extraction result is not successfully processed business knowledge.

This path runs independently of user questions. Failures can remain invisible if monitoring covers only the chat interface. Track the last complete successful state for each source and its lag behind required changes.

03 / 16

Path two: how does a question become a supported answer?

The answer path of a RAG architecture runs through these steps:

  1. The application authenticates the caller and determines the allowed search scope.
  2. It may prepare the question for retrieval by identifying a product code or clarifying a time reference. That preparation must not silently change the user's task.
  3. Retrieve candidates, optionally rerank them and assemble a bounded context.
  4. Supply the selected evidence and answer instructions to the model.
  5. The output should contain relevant claims, source references and understandable limitations.

Downstream checks can validate formatting, source attribution or prohibited actions. They do not replace earlier authorization. Restricted documents should never reach the model rather than being removed from an answer after generation.

04 / 16

Which fields does a RAG search object need?

The following fields form a proposed minimum contract for each search object in a RAG index:

Field Why it matters
Document and chunk identity Associate and remove content reliably
Text with necessary context Preserve meaning and exceptions
Source and section Generate inspectable evidence
Version and effective period Distinguish current and historical questions
Audience and organizational scope Limit access
Processing version Trace extraction and indexing changes
Activation state Exclude drafts, blocked and incomplete objects

This is a proposed minimum contract, not a universal database schema. Add fields when the task requires them. A complex taxonomy without an actual filtering or evaluation purpose increases maintenance without necessarily improving answers.

Stable relationships matter. When replacing a document, the application must identify its chunks and derivatives. A filename alone is often insufficient because it can change or be reused.

05 / 16

Retrieval and context assembly are separate decisions

Retrieval finds candidates. Context assembly decides which candidates reach the model and how they are presented. A large result set is not automatically a useful answer context.

Text search can support exact terminology while semantic retrieval can connect different wording. Azure documents their combination as hybrid search. Whether it improves your collection needs evaluation using your own questions. Azure AI Search: hybrid search.

Limit duplication while preserving necessary neighboring content. Ten similar passages from an old manual should not displace a current exception. Context needs coverage of relevant evidence rather than the largest possible token count.

06 / 16

A synthetic service-manual trace

A fictional manual describes replacing a filter on Device A. It has an approved version, a procedure section and an adjacent shutdown requirement. An older version remains available for historical questions.

An authorized employee asks for today's process. The application filters for the device, applicable version and access rights. It supplies both the procedure and shutdown requirement to the model. The answer states prerequisites and links to the relevant section.

If extraction loses the shutdown instruction, the test should fail even when the remaining steps look correct. If the source is unavailable, the application must not improvise binding maintenance guidance from general model knowledge. This example describes intended behavior, not an executed equipment test.

07 / 16

Which source states and answer outcomes should RAG distinguish?

Distinguish the following source states in a RAG collection:

  • new
  • processing
  • reviewed
  • active
  • blocked
  • deleted

Exact labels can vary; the important point is an explicit activation rule. A failed import must not accidentally overwrite the last valid version.

RAG answers also need distinct outcomes:

  • answered
  • clarification required
  • insufficient evidence
  • conflicting sources

A generic error for all cases makes both use and operations harder.

Older versions. Define when an older version is acceptable. Labelled historical material may be suitable for general background information. Revoked access or withdrawn safety instructions may require blocking. The architecture must be capable of enforcing the business decision.

08 / 16

Preserve authorization across the whole path

Ingestion identity and caller identity have different purposes. A service account may collect many documents while individual users can read only subsets. Check whether the connection uses delegated rights or separately maintained permission metadata.

Azure documents multiple document-access mechanisms with different prerequisites. Native capabilities, preview features and application-managed filters are not interchangeable guarantees. Azure AI Search: document permissions.

Include caches, logs and conversation history. Correct filtering of a new query does not help if an earlier answer is reused for someone whose access has since been revoked. The SharePoint guide makes this boundary concrete for one source platform.

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

AI knowledge assistants →

09 / 16

Separate actions from knowledge

A knowledge assistant does not automatically need to be an acting agent. If the task is answering questions, read-only access can be sufficient and keeps many potential side effects outside the system.

Adding tools later requires separate checks for identity, destination and parameters. A retrieved document can explain a process but cannot grant additional authority. Treat imported commands and external links as source data.

Draw the action path separately: proposed operation, validation, human approval where required, execution and confirmed result. A model-generated success message does not establish that the authoritative system changed successfully.

10 / 16

Monitor a few useful signals

Record request identity, source versions, retrieval results, answer state and relevant timings. Store sensitive content only as needed for the agreed purpose and under appropriate controls. Indefinite complete conversation recording is not a prerequisite for useful troubleshooting.

Separate retrieval failures from generation failures. If the required passage is absent, inspect source, extraction and search. If it is present, inspect answer construction and evaluation. This distinction shortens diagnosis and avoids unnecessary model replacement.

Look beyond averages to slow and failed requests. An application can be fast on average while becoming unusable on important multi-part questions. Evaluate the task categories separately.

11 / 16

Deploy changes without silent regression

Version prompts, extraction, embedding models and retrieval settings where they affect behavior. Changing the numerical representation may require a new index. Do not mix old and new vectors without validating compatibility.

Evaluate a changed configuration against the same recorded questions. Significant index changes may justify parallel construction and a controlled switch. Plan reversal, including data that changed after the previous index state.

Rollback must not reactivate revoked access. Separate returning to an earlier technical configuration from returning to obsolete permissions. The current security boundary remains authoritative.

12 / 16

Choose deployment responsibilities explicitly

For every component, identify who handles failure and change. A managed search service reduces some infrastructure work but does not appoint a business owner for the source content. A custom model endpoint does not take responsibility for malformed document extraction.

Include backup, restoration and access to operating evidence. A team should be able to recover service without depending on an undocumented account or one person's memory. Keep the design proportional to the task, but make the essential responsibilities explicit.

13 / 16

How do you review the architecture before wider use?

Ask a subject specialist to trace an answer to the original source and a technical reviewer to trace the same result through ingestion, index and request handling. Both should explain why that source was selected and another excluded.

Test deletion, revocation, source outage, conflicting versions and a malicious instruction inside a document. Record which components are managed services and which your team operates. Every material failure needs an accountable owner.

The architecture is sufficient when it fulfills the agreed task reliably and inspectably. It need not anticipate every hypothetical future feature. The RAG acceptance plan connects technical checks to business outcomes, while the cost guide covers ongoing operating effort.

14 / 16

Record component decisions explicitly

For every added component, state the requirement it meets and the simpler alternative. A reranker may improve candidate ordering, but is not a targeted investment when the real problem is missing source material. A separate vector store may be useful, but should be justified against existing retrieval or database capabilities.

Also record the failure dependency. Can users still receive source links when answer generation is unavailable? Can one collection be blocked without disabling unrelated sources? Bounded fallback paths are often more practical than duplicating every component. Their suitability still depends on the actual task and the risk of presenting incomplete information.

15 / 16

Take the worksheet

Worksheet

Download the editable CSV table

LayerJobRetained metadata
SourceAuthoritative documentOwner, version, validity
PreparationText and structureOriginal and page location
IndexRetrievalDocument ID and access attributes
SearchAllowed relevant matchesUser context
AnswerSupported explanationCitations and limits
OperationChanges and failuresDeletion and review state

Columns to fill in, in the file: Your value / observation, Owner, Next action.

Download the editable CSV table (CSV). Add your own values, owners and open actions. This worksheet contains no measured client results.

16 / 16

These modernagents guides cover related decisions about AI knowledge assistants:

For a workflow review, start with the task, systems involved and typical exceptions. Discuss it with modernagents.

ShareEmail

Related reading

AI knowledge assistants

Got a workflow like this?

Tell me about it. Honest take and a rough price, usually within a day.

Robert Van Ysendyck · Founder & Managing Director