Permission-Aware Agentic RAG
A reference implementation of a permission-aware Agentic RAG system for enterprise document knowledge bases, enforcing folder-level access control through every step of retrieval, reranking, and citation.
This project is a reference implementation of a Retrieval-Augmented Generation system for shared enterprise documents where access control, not the model or agent, decides what a user may see. Folder-level ACLs, including user, group, and parent-directory inheritance, are computed as a real-time allowed scope in MySQL and enforced as a hard filter on every Qdrant vector search, with a second verification pass against MySQL before results are used; an agent can only route within folders the current user can read and can only call read-only tools on an allow list.
It ingests Markdown, PDF, DOCX, and DOC files, including image extraction, scanned-page detection, and Chinese and English OCR, and combines dense and sparse Qdrant retrieval with reciprocal rank fusion and pluggable external embedding, reranking, and LLM providers. Citations resolve to a Markdown line number or PDF page and are re-checked for permission at open time, and access is invalidated immediately after a document is deleted, moved, or a folder's permissions change, without needing to rewrite every affected vector.
It runs on Python, FastAPI, MySQL, MinIO, and Qdrant, deployed with Docker Compose.