A Retrieval-Augmented Generation (RAG) system built with Ollama and ChromaDB, featuring a Streamlit web interface for document upload and testing.
- Document Ingestion: Upload and process PDF documents
- Vector Storage: Persistent document embeddings using ChromaDB
- RAG Query System: Ask questions about uploaded documents
- Streamlit UI: User-friendly web interface for testing
- Error Handling: Comprehensive exception handling throughout
├── config.yaml # Configuration settings
├── common_utils.py # Utility functions
├── ingestion.py # DocumentIngestion class
├── LLM.py # RAGLLMSystem class
├── streamlit_app.py # Streamlit web interface
├── requirements.txt # Python dependencies
└── README.md # This file
load_documents(doc_paths): Load PDF documentschunk_documents(docs): Split documents into chunksinit_vector_store(): Initialize ChromaDB vector storeadd_documents_to_store(chunks): Add chunks to vector storeprocess_documents(doc_paths): Complete pipeline from paths to vector store
query(question): Query the RAG systemadd_documents(doc_paths): Add new documents to knowledge baseget_vector_store_info(): Get vector store status information
- Install dependencies:
pip install -r requirements.txt- Make sure Ollama is running with the required models:
# Install Ollama if not already installed
# Then pull the required models
ollama pull nemotron-mini
ollama pull nomic-embed-text- Run the Streamlit app:
streamlit run streamlit_app.py-
Open your browser to the provided URL (usually
http://localhost:8501) -
Use the interface to:
- Initialize the RAG system
- Upload PDF documents
- Ask questions about your documents
from LLM import RAGLLMSystem
# Initialize the system
rag_system = RAGLLMSystem()
# Add documents
doc_paths = ["path/to/your/document.pdf"]
rag_system.add_documents(doc_paths)
# Query the system
response = rag_system.query("What is this document about?")
print(response)Edit config.yaml to customize:
- Ollama Models: Change LLM and embedding models
- Chunk Settings: Adjust chunk size and overlap
- Vector Store: Modify collection name and directory
- Retrieval: Set number of documents to retrieve
- System Status: Shows if RAG system is active
- Document Upload: Upload multiple PDF files
- Vector Store Info: Display current configuration
- Clear Chat: Reset conversation history
- Chat Interface: Interactive Q&A with your documents
- SideBar: To Upload Files
- Add support for more document types (DOCX, TXT, etc.)
- Implement parsing of images and tables from documents
- Add chat history persistence
- Include tools like Firecrawl, MCP Server
- Add APIs using FastAPI and Agent-ify it using LangGraph