Retrieval-augmented generation (RAG) can help employees ask questions over internal knowledge without relying only on a model's training data. In an enterprise setting, however, the challenge is not simply retrieving relevant text. The system must retrieve only what the requesting user is authorized to see, explain where its answer came from, and stay aligned with changing documents and permissions.
This article outlines the architecture decisions that matter when building a document-question-answering system with Azure AI Search.
Begin with identities and information boundaries
Map the business departments, document owners, classification labels, and existing identity provider before choosing a vector model. One employee may have access to operational procedures but not payroll files; another may need temporary access to a project workspace.
A useful rule is to treat the search index as a sensitive derived-data store. Copying a document into an index does not remove its confidentiality requirements.
Reference architecture
A common flow includes:
- Sources: Approved files and knowledge repositories, each with ownership and access metadata.
- Ingestion: Parse text, capture document identifiers and permissions, split content into searchable sections, and create embeddings where useful.
- Search index: Store searchable text, metadata, source references, and permission information.
- Application gateway: Authenticate the user and enforce query-level authorization.
- Retrieval: Run keyword, semantic, vector, or hybrid search within the user's permitted scope.
- Answering: Supply retrieved passages to the model with instructions to cite sources and acknowledge missing evidence.
- Audit: Record relevant request, authorization, retrieval, and quality signals under the organization's retention policy.
The ordering matters. Filtering unauthorized content only after it has been sent to the model is an avoidable design risk.
Document-level security is not one checkbox
Azure AI Search supports patterns such as application-managed security filters and native document-level permission features for certain data sources and API versions. Some native capabilities are in preview, so production teams must check current support and service-level commitments before selecting an approach.
Whatever mechanism is used, test these cases explicitly: a user with no permission, a user belonging to multiple groups, a document whose permissions were revoked, a moved file, and a removed employee account. Permission metadata must be synchronized as source access changes.
Avoid exposing raw search endpoints that permit a client to omit authorization filters. Put the enforcement in a trusted server component and test for bypass attempts.
Retrieval quality: combine lexical and semantic signals
Keyword search is strong for exact names, part numbers, and identifiers; vector search helps with semantically related wording. Hybrid retrieval can combine the strengths of both, while semantic ranking can improve ordering in supported configurations.
Chunking should reflect document structure. A policy section should not lose its heading, version, or source identifier. Splitting every document into arbitrary fixed windows is easy to implement but can separate a rule from its exception.
During evaluation, ask whether retrieved evidence is sufficient, relevant, recent, and from the correct source. Large top-k values can increase noise and context cost without improving correctness.
Handle multilingual requests deliberately
If employees ask in English, Russian, or French, decide whether to use multilingual embeddings, query translation, or both. Retain source-language passages and distinguish between a translated answer and an authoritative translated document. Test terminology and abbreviations specific to the business.
Language quality testing should include real employee questions, not just generic translated examples.
Refresh documents and revoke access promptly
An enterprise knowledge base is not a one-time upload. Design incremental ingestion around source identifiers and modification events. Handle additions, updates, deletes, and permission changes.
Set an explicit freshness objective, and monitor the time between a source update and the index becoming consistent. For sensitive data, permission-revocation delay is a security requirement, not merely a performance metric.
Evaluate more than answer fluency
Build a test set across permitted and prohibited scenarios. Measure retrieval relevance, grounded answer accuracy, citation correctness, refusal behavior, and authorization isolation. Add adversarial documents that contain instructions to the assistant, because retrieved text must be treated as untrusted data.
Document which requests can trigger an action. A question-answering agent should not silently become an approval or transaction system without additional authorization controls.
Deployment checklist
- Authenticate users with the organization's identity provider.
- Maintain permissions at document or section granularity as required.
- Restrict privileged indexing and retrieval credentials.
- Encrypt data and apply approved network boundaries.
- Log access decisions and protect logs from unnecessary sensitive content.
- Validate citations and abstention behavior.
- Test deletions and revoked permissions end to end.
- Review preview feature limitations before production adoption.
DAESAIX can help scope identity-aware retrieval and enterprise integration requirements through its AI Agents, AI Automation, and IT Architecture services.