Supercharge your local LLMs with powerful RAG capabilities! 🚀
A modern, user-friendly interface for document-enhanced conversations
Explore Features »
·
Quick Start »
·
Setup Guide »
OllamaRAG brings the power of Retrieval-Augmented Generation (RAG) to your local environment, seamlessly integrating with Ollama's local LLMs. It's designed to make document-enhanced AI conversations accessible and efficient.
- 🏠 Fully Local Operation: All processing happens on your machine, ensuring data privacy
- 🔄 Hybrid Search: Combines vector similarity and keyword matching for better context retrieval
- 💾 Persistent Memory: Save and manage conversation history across sessions
- 📊 Smart Document Processing: Intelligent chunking and embedding of your documents
- 🎯 Context-Aware Responses: LLM outputs enhanced with relevant document snippets
- 🔬 Researchers: Quickly query and analyze large document collections
- 💼 Professionals: Enhance productivity with document-aware AI assistance
- 🎓 Students: Learn and explore topics with AI-powered document analysis
- 🧪 Developers: Experiment with different RAG implementations
OllamaRAG leverages the best open-source technologies:
- 🦙 Ollama - Run LLMs locally
- 🔗 LangChain - Build LLM applications
- 🌊 Streamlit - Create web interfaces
- 🎨 ChromaDB - Embed and store documents
Want to test OllamaRAG without any local setup? We've got you covered!
Our Colab notebook offers:
- 🔥 Instant Setup: Get started in minutes with zero local installation
- 📚 Interactive Tutorial: Step-by-step guide to all features
- 📖 Learning about RAG implementations
- 🧪 Quick prototyping and testing
Click the badge above to launch the notebook and start exploring!
Note: The Colab notebook includes detailed installation steps and usage examples to help you get the most out of OllamaRAG.
- Python 3.8+ installed on your system
- Ollama installed and running on your system
- Install from Ollama's official website
- Make sure the Ollama service is running before starting the app
- Clone the repository:
git clone [repository-url]
cd OllamaRAG
- Create and activate a virtual environment (recommended):
# Windows
python -m venv venv
.\venv\Scripts\activate
# Linux/Mac
python -m venv venv
source venv/bin/activate
- Install required packages:
pip install -r requirements.txt
Create a requirements.txt
file with the following dependencies:
streamlit
langchain
langchain-ollama
chromadb
pypdf
ollama
python-dotenv
- Make sure Ollama is running on your system
- Start the Streamlit application:
streamlit run Home.py
The application consists of four main pages:
- Home (
Home.py
): Landing page with system status and quick start guide - Model Settings (
pages/1_🦙_Model_Settings.py
): Configure Ollama models and parameters - RAG Config (
pages/2_🔗_RAG_Config.py
): Set up document processing and retrieval settings - Chat (
pages/3_💬_Chat.py
): Interactive chat interface with RAG capabilities
- Go to the "Model Settings" page
- Select or download an Ollama model
- For general use, we recommend starting with
llama2
- For embedding, we recommend
nomic-embed-text
- For general use, we recommend starting with
- Configure model parameters:
- Temperature (default: 1.0)
- Context Window (default: 2048)
- Max Tokens (default: 2048)
- Set your system prompt
- Click "Apply Settings"
- Navigate to the "RAG Config" page
- Select an embedding model
- Configure document processing:
- Chunk size (default: 1000)
- Chunk overlap (default: 200)
- Retrieved documents count (default: 3)
- Upload PDF documents
- Click "Rebuild Database"
- Go to the "Chat" page
- Start asking questions
- The system will retrieve relevant context from your documents
- Responses are generated using your selected Ollama model
- Chat history is automatically saved
- Conversations are automatically saved in SQLite database
- Access previous conversations from the sidebar
- Delete individual conversations
- Clear current chat history
- PDF document support
- Automatic text chunking
- Configurable chunk size and overlap
- Vector embeddings for semantic search
- Optional BM25 retrieval for keyword matching
- Hybrid search combining vector and keyword matching
- Contextual retrieval with AI-generated context
- Configurable number of retrieved documents
- Document reference tracking
This project is built upon the amazing work of several open-source projects:
- Ollama - For providing powerful local LLM capabilities
- Streamlit - For their excellent web application framework
- LangChain - For comprehensive LLM tools and utilities
- ChromaDB - For the efficient vector database implementation
- Langchain-Ollama - For seamless Ollama integration with LangChain
-
Ollama Connection Issues
- Ensure Ollama is running (
ollama serve
) - Check if the selected model is downloaded
- Verify no firewall blocking localhost connections
- Ensure Ollama is running (
-
Database Issues
- Check if
chroma_db
directory exists and is writable - Rebuild database if encountering embedding errors
- Clear database and reupload documents if issues persist
- Check if
-
Memory Issues
- Reduce chunk size in RAG configuration
- Lower the number of retrieved documents
- Use a smaller model if available
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License
Copyright (c) 2024 OllamaRAG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.