This project is an implementation of Retrieval-Augmented Generation (RAG) using LangChain, ChromaDB, and Ollama to enhance answer accuracy in an LLM-based (Large Language Model) system. The system performs document-based retrieval and answers user questions using data stored in the vector database.
- Integration with Ollama as the LLM model.
- ChromaDB as a vector storage for documents.
- RAG pipeline for document retrieval and processing.
- PDF ingestion support to add documents to the vector database.
- Interactive system for answering user queries.
Ensure Python is installed (recommended version 3.8+).
git clone https://github.com/username/rag-langchain-ollama.git
cd rag-langchain-ollama
pip install -r requirements.txt
Ensure the Ollama server is running locally (example with WSL):
ollama serve
You can change model by modified code at models.py
# Model LLM Ollama
self.model_ollama = ChatOllama(model="put your model LLM here", temperature=0, base_url=ollama_host)
python ingest.py
PDF files in the data/
folder will be processed and stored in ChromaDB.
python main.py
Use this chatbot to ask questions based on indexed documents.
├── data/ # Folder for PDF documents
├── db/ # ChromaDB storage folder
├── models.py # Ollama model used (can be customized)
├── ingest.py # Script for processing documents
├── chat.py # Interactive chatbot
├── requirements.txt # List of dependencies
└── README.md # Project documentation