Prompt
I'm building a chatbot for employees that needs to answer from approved sources only. What architecture should I use?
Latest observation
Oct 10, 2026
OpenAI APIWeb search: off
Use a retrieval-augmented generation (RAG) architecture with strict source grounding and access control.
Recommended architecture
-
Approved source ingestion
- Collect only sanctioned documents, wikis, policy pages, helpdesk articles, etc.
- Normalize them into chunks with metadata:
- source
- title
- URL/path
- last updated
- department
- permission level
-
Indexing layer
- Build a search index:
- vector index for semantic retrieval
- optionally keyword/BM25 for exact policy terms and names
- Store metadata separately so you can filter by source/permission.
- Build a search index:
-
Query-time retrieval
- Before generation, retrieve only from approved sources.
- Apply:
- document-level permissions
- source allowlists
- freshness filters
- Retrieve top-k passages and pass them to the model.
-
Answer generation with citations
- The LLM should answer only from retrieved context.
- Require inline citations or footnotes to the exact source chunks.
- If evidence is insufficient, the model must say:
- “I don’t know based on the approved sources.”
-
Guardrails
- Add a policy layer that:
- blocks answers without citations
- rejects unsupported claims
- prevents use of external web data unless explicitly approved
- Use a refusal template for out-of-scope or insufficient-evidence queries.
- Add a policy layer that:
-
Audit and logging
- Log:
- query
- retrieved documents
- final answer
- citations used
- This helps with compliance and debugging.
- Log:
Best practice pattern
A good pattern is:
User question → policy/permission check → retrieve from approved corpus → rerank → LLM answers with citations → post-check for groundedness → return or refuse
Key design choices
- Do not let the model browse freely unless that web content is also approved.
- Do not rely on the LLM’s memory for policy or employee info.
- Use metadata filters and ACLs so users only see what they’re allowed to see.
- Prefer “answer only with citations” for compliance-heavy environments.
If you want the simplest safe version
Start with:
- a single approved document store
- hybrid search
- a grounded-answer prompt
- citation requirement
- refusal if retrieval confidence is low
If you want, I can sketch a reference architecture diagram or propose a tech stack for this setup.