AI Help
How do I make my RAG chatbot search only documents from a selected department?
Apply department filtering using trusted metadata and authorization checks outside the model, then verify the returned documents.
Steps to follow
- Tag indexed files or chunks with department and access metadata supported by your retrieval system.
- Determine permitted departments from the authenticated user's permissions and apply the documented retrieval filter.
- Test an allowed question and a cross-department question. Inspect returned IDs and apply access checks before sending context to the model.
Example in practice
Illustrative example. A sales user can retrieve sales guidance while an HR-only document remains outside that user's retrieval scope.
Related AI help
- How do I check that a newly uploaded file is fully indexed before querying it?
- How do I add citations to an AI chatbot’s answers from a vector store?