mustafac0des/Multi-Document-RAG-Agent
0
๐ฅ Role-Based Access Control RAG Agent
A powerful and secure AI chatbot that allows employees to query internal company documents with strict role-based access control.
โจ Features
- ๐ Role-Based Access Control (RBAC) - Users only see information they are authorized to access based on their simulated role
- ๐ Multi-Document Ingestion - Processes Markdown files and extracts valuable metadata for precise querying
- ๐ง Local LLM & Embeddings - Fully local generation and embeddings using open-source HuggingFace models for data privacy
- ๐๏ธ Vector Database - Utilizes ChromaDB for fast, efficient, and persistent document retrieval
- ๐ฌ Gradio Interface - An easy-to-use, interactive web UI for chatting with the AI
๐ Getting Started
Installation
- Clone the repository
- Install the required dependencies:
pip install gradio transformers sentence-transformers langchain-core langchain-chroma pyyaml python-dotenv torch - Create or configure your
.envfile in the root directory
Running the App
- Open your terminal in the project folder
- Run the application:
python app.py - Access the web interface via the local URL provided (usually
http://127.0.0.1:7860)
๐ฏ Quick Tips
- Use the role dropdown to test how different roles (e.g., HR, Executive, Engineer) affect the AI's responses
- Ensure your Markdown documents in the
company_documentsfolder have correct YAML frontmatter for roles - Ask specific, detailed questions for the best response from the LLM
- If the AI says "I cannot help you with that!", try changing your simulated role to one with higher clearance
โ Questions?
- Can I add new documents? - Yes, place new Markdown files in the
company_documentsfolder and restart the app - How do I change roles? - Select a different role from the dropdown menu in the Gradio UI
- Is my data sent to the cloud? - No, the app uses local embeddings and a local LLM (
google/flan-t5-base) to keep data secure - Why is the AI not answering my question? - You either lack the required role to view the source document, or the answer isn't in the knowledge base
๐ ๏ธ Tech Stack
- UI Framework: Gradio
- Vector Store: ChromaDB
- Embeddings: SentenceTransformers (
all-MiniLM-L6-v2) - LLM: HuggingFace Transformers (
google/flan-t5-base) - Orchestration: Langchain Core
