Automation & AI

How to design a business knowledge assistant with RAG, permissions and citations

Design a knowledge assistant that retrieves approved evidence, checks access, shows sources, and declines questions it cannot answer.

Define which questions the assistant should answer

A staff assistant answering questions about leave needs the current policy. A sales assistant needs approved product specifications. A service desk assistant needs the procedure that applies to the case. Each needs different documents, permissions and tests, even when the model is the same.

Write down the questions the assistant should answer, the ones it should decline, and who should receive questions it cannot resolve. Use examples the business is authorized to process and remove personal details you do not need. Send requests for individual salary details, legal interpretations or decisions to the appropriate person according to the business's policy.

Retrieval-augmented generation (RAG) gives a language model relevant material at answer time. Lewis and colleagues described the method in 2020. In a knowledge assistant, you can refresh the indexed material as policies change and give users references they can inspect. The answer still needs to be checked against the evidence. For the choice of method, see RAG, fine-tuning and prompting.

Assign an owner to every source

Record the owner, approval status, effective date and next review date for each source. Leave drafts and superseded documents out of normal retrieval. When two sources disagree, have the content owner settle which text applies.

Capture the department, document type, language, revision and access rules during ingestion. Preserve a link to the original section or page. This information helps the system filter search results and show where each answer came from.

Retrieve enough context to answer the question

Split documents into passages that make sense in search. Keep a heading with its paragraphs, a table with its title, and a procedure step with the step it depends on. Test the resulting passages with the questions users ask. For scanned PDFs, use optical character recognition (OCR) and have someone check the extracted text where the scan is the authoritative copy. Keep rate and approval tables structured. If a slide deck holds only fragments of a procedure, ask its owner to prepare a complete source.

An embedding is a numerical representation that helps search find passages with related meanings. Check exact product codes, policy identifiers, names and dates separately. Results that are close in meaning can still contain the wrong identifier.

For both kinds of matching, evaluate hybrid search. Azure AI Search runs keyword and vector queries in parallel and combines their ranked lists with Reciprocal Rank Fusion (RRF). Other engines can combine similar signals. Test whether reranking the top results improves the passages the model receives.

Check each language the assistant supports. For Arabic documents, test Arabic search analysis as well as the embedding model. Azure AI Search documents the available language analyzers. Include questions whose evidence is written in a different language. See Arabic AI assistants and retrieval for dialect and mixed-language examples.

Layers of a business knowledge assistant

  1. InterfaceWeb, Teams or WhatsApp, with citations and a way to reach a person
  2. AnswerThe assistant answers from authorized evidence or declines
  3. RetrievalKeyword and vector search with document-level access checks
  4. IndexPassages with source links, revision dates, languages and access rules
  5. IngestionApproved sources only, with updates, permission changes and deletions applied
  6. SourcesPolicies, procedures and specifications with named owners
Retrieval checks access before it supplies any passage to the answer step.

Apply access rules before a passage reaches the model

A correct answer that exposes material the user is forbidden to read is a security failure. When you connect a shared drive, include document permissions in the ingestion design. A folder can contain approved policies alongside confidential finance or personnel records.

OWASP's guidance on vector and embedding risks recommends fine-grained access controls. For each indexed passage, preserve the effective permissions of its source using trusted permission metadata. At query time, apply those rules to the authenticated user's identity. Microsoft documents several approaches to document-level access, including application-managed filters for a custom identity system. Confirm that the approach supports your source and distinguishes the application account from the person asking the question.

Agree how quickly the index reflects edits, access revocations and deletions. If you cannot confirm access, withhold the affected material. Check that cached answers, citation previews, conversation history and handoffs follow the same access rules.

Show citations readers can verify

For material claims, show the source title, section, version or effective date, and a link to the passage where possible. An answer about a travel policy, for example, should make clear which version it follows. Show a short extract if the user can read it and it helps explain the claim.

Verify that a citation refers to a retrieved passage and that the passage supports the claim. Being about the same topic is insufficient. Where an answer depends on two sources, cite both.

Decline when the evidence is missing or the question needs judgment

The assistant can say it could not find an answer in the approved documents. It should decline when relevant passages are absent or conflict, the question is outside scope, or a person needs to make a decision.

Offer a handoff to the topic owner where possible. Share the question and relevant passages only with people authorized to see them. Tell the user who will respond and give a response time if one has been agreed. Repeated declines on one topic can tell the owner where documents are missing, stale or hard to find. Our WhatsApp assistant and human handover guide gives customer support examples.

Measure search, evidence, correctness and refusals separately

Before launch, build a versioned test set of realistic questions. A few hundred can cover a broad rollout. Ask content owners to approve the expected answers and supporting passages. Include questions that should be declined, ordinary user phrasing and questions in every supported language. Add cases when you find failures in use.

Four measures for a knowledge assistant

  • Retrieval recallWhat share of the required passages appeared among the top search results?
  • Evidence supportDoes each material claim follow from the retrieved passages?
  • Answer correctnessDoes the answer match the content owner's agreed reference?
  • Appropriate refusalDid the assistant decline when it should and answer when it could?
Score each separately so the team can trace a failure to search, the sources or the answer step.

Suppose an employee asks how much notice to give before taking annual leave. The content owner confirms the answer is in section 4 of the current policy. If that is the only required passage and it appears in the top results, retrieval recall is complete for that case. An answer that reports and cites the current notice period is supported and correct. An answer citing the old policy may be supported by the retrieved text and still be wrong. The index may need to exclude the outdated revision.

Find where the failure occurred before changing the system. If search missed the right passage, check the source, permissions or search settings. If the right passage reached the model and the answer still failed, inspect the answer generation and citations. Check citation accuracy alongside support for the claim.

Use human review as the reference. If a model scores a larger set, compare its judgments with a human-graded sample and repeat that check when the grading model changes. Rerun the tests when documents, passage splitting, search, instructions or model versions change. Compare with the prior run before release.

Protect the assistant from untrusted input and excessive access

The model receives text from users and retrieved documents. OWASP's prompt injection guidance distinguishes input from a user and instructions embedded in an external source. RAG and fine-tuning cannot eliminate the risk. The OWASP Top 10 for LLM Applications also covers sensitive information disclosure (LLM02), vector and embedding weaknesses (LLM08), misinformation (LLM09) and unbounded consumption (LLM10).

Ingest only approved sources and treat retrieved text as data. Enforce access and action limits in application code. If the assistant can create tickets or send messages, grant narrowly scoped permissions and require human approval for high-risk actions. Test these protections in an authorized environment with synthetic documents. Record enough to investigate a failure, with restricted access, tamper-evident records and defined retention. Set usage limits that fit the service and monitor them.

Assign maintenance responsibilities

Content owners keep documents current and review unanswered questions on their topics. The system owner monitors ingestion, permissions, tests and costs. The sponsor approves changes in scope, such as adding a department.

Set a schedule that fits how often the sources change. For example, sync documents daily or after a change, test weekly as well as after releases, and review a small sample of conversations with content owners each month. Apply the organization's access and retention rules to those reviews. Publish the assistant's scope, usage limits and how to reach a person.

Our knowledge search and assistants service uses approved sources, citations and a route to a person when evidence is insufficient. To discuss a project, send us a few recurring questions and tell us where the answers are kept.

Questions buyers ask

What is a RAG chatbot?

A chatbot using retrieval-augmented generation looks for relevant passages and gives them to a language model to help answer a question. It can cite the source documents. An index refresh makes changed documents available without retraining the model.

How can we protect private documents?

Enforce the signed-in user's permissions in retrieval before any protected passage reaches the model. Preserve trusted access rules on each indexed passage, update them when the source changes, and withhold material if access cannot be confirmed.

How can we decide whether the assistant is ready to launch?

Ask content owners to agree reference answers and supporting passages for realistic questions. Test whether retrieval finds the evidence, whether the answer is supported and correct, and whether the assistant declines when appropriate. Set acceptance criteria before launch and run the checks after changes.

Can RAG eliminate unsupported answers?

RAG helps by making relevant evidence available. The model can still misread evidence, combine facts incorrectly or answer without enough support. Check citations, test when the system declines, and track errors over time.

Sources

  1. Lewis et al. (2020), Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
  2. Microsoft Learn, hybrid search in Azure AI Search
  3. Microsoft Learn, document-level access in Azure AI Search
  4. Microsoft Learn, language analyzers in Azure AI Search
  5. OWASP, Top 10 for LLM Applications 2025
  6. OWASP, LLM01 Prompt Injection
  7. OWASP, LLM08 Vector and Embedding Weaknesses

Your next chapter

Let’s build
something useful.

A product to launch. A system to improve.
An idea worth exploring. Start with a conversation.