A Retrieval-Augmented Generation (RAG) system that enhances the capabilities of Large Language Models (LLMs) by providing them with accurate, up-to-date, and relevant information from a document database.
- Document Management: Upload, process, and index documents using Docling and Qdrant
- RAG Pipeline: Enhance Gemini LLM responses with relevant document context using LangChain
- Interactive UI: Intuitive Streamlit interface for document management and interaction
- Relevance Dashboard: Evaluate response quality with document citations and relevance metrics
- Document Cleanup: Simple mechanism to delete all documents from the database
- Language: Python 3.10+
- RAG Framework: LangChain
- Vector Database: Qdrant Cloud
- Document Processing: Docling
- LLM: Google Gemini Flash (version 2.0)
- Embeddings: Google text-embedding-004
- UI: Streamlit
The system follows a modular architecture with the following components:
- Document Processing Module: Uses Docling to parse, transform, and chunk documents
- Embedding Module: Processes document chunks using text-embedding-004
- Vector Storage Module: Manages the interaction with Qdrant Cloud
- RAG Pipeline Module: Orchestrates the retrieval and generation process using LangChain
- UI Module: Provides the Streamlit interface for user interaction
- Relevance Dashboard Module: Displays document relevance metrics for generated responses
- Python 3.10 or higher
- Qdrant Cloud account
- Google AI API key
-
Clone the repository:
git clone https://github.com/yourusername/rag-intelligent-agent.git cd rag-intelligent-agent -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install the dependencies:
pip install -r requirements.txt -
Create a
.envfile with your API keys:GOOGLE_API_KEY=your_google_api_key QDRANT_API_KEY=your_qdrant_api_key QDRANT_URL=your_qdrant_url
-
Start the Streamlit application:
streamlit run src/ui/streamlit_app.py -
Use the left panel to upload and manage documents
-
Enter natural language queries in the center panel
-
View document relevance metrics in the right panel
.
├── src/ # Source code
│ ├── models/ # Model-related code
│ ├── data/ # Data processing utilities
│ ├── utils/ # Helper functions
│ ├── api/ # API interfaces
│ └── ui/ # Streamlit UI code
├── config/ # Configuration files
├── tests/ # Unit and integration tests
├── docs/ # Documentation
├── .env.example # Example environment variables
├── requirements.txt # Python dependencies
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.
- LangChain for the RAG framework
- Qdrant for vector database capabilities
- Docling for document processing
- Google for Gemini LLM and embedding models
- Streamlit for the UI framework