A simple Retrieval-Augmented Generation (RAG) project that lets you upload a PDF, create a vector database, and ask questions using the document content.
- Upload a PDF through a Streamlit interface
- Split the document into chunks and store embeddings in Chroma
- Retrieve relevant context with MMR search
- Ask questions and get AI-powered answers based on the uploaded document
- app.py - Main Streamlit application for uploading PDFs and asking questions
- main.py - Command-line RAG demo using the existing Chroma database
- create_database.py - Script to generate the vector database from a PDF
- documents/ - Sample document files and loaders
- retrievers/ - Example retriever implementations
- vector store/ - Additional Chroma-related experiments
- Python 3.12
- Streamlit
- LangChain
- Chroma DB
- Mistral AI and Google Gemini embeddings
- PyPDF / LangChain PDF loader
- Python 3.10+
- A virtual environment
- API keys for the AI providers used in your setup
- Create and activate a virtual environment
bash python -m venv .venv .\.venv\Scripts\Activate.ps1 - Install dependencies
bash pip install -r requirements.txt - Create a .env file using .env.example and add your API keys.
Start the Streamlit interface:
bash python -m streamlit run app.py
If you want to create or refresh the Chroma database from a PDF:
bash python create_database.py
- The app uses the chroma_db/ directory to persist embeddings.
- Make sure your environment variables are available before running the app.
- The current setup is intended for local development and experimentation.
