A Retrieval-Augmented Generation (RAG) chatbot that allows users to upload PDF, DOCX, and TXT documents and ask natural language questions about their content.
The application uses semantic search with FAISS and Hugging Face embeddings to retrieve relevant document chunks, while Ollama (Llama 3.2) generates context-aware answers.
- Upload PDF, DOCX, and TXT files
- Automatic document indexing
- Semantic search using FAISS
- Local LLM using Ollama (No API key required)
- Source document citation
- Chat history stored in SQLite
- Flask web interface
- Responsive UI
- Python
- Flask
- LangChain
- Ollama
- FAISS
- Hugging Face Sentence Transformers
- HTML
- CSS
- JavaScript
- SQLite
rag-document-chatbot/
│
├── app.py
├── ingest.py
├── rag.py
├── config.py
├── requirements.txt
│
├── data/
├── database/
├── vectorstore/
│
├── static/
│ ├── style.css
│ └── app.js
│
├── templates/
│ └── index.html
│
├── utils/
│ ├── loader.py
│ ├── splitter.py
│ └── database.py
│
└── README.md
git clone https://github.com/rahulbansalcs/rag-document-chatbot.git
cd rag-document-chatbotMac/Linux
python3 -m venv .venv
source .venv/bin/activateWindows
python -m venv .venv .venv\Scripts\activate
pip install -r requirements.txt
Download and install Ollama.
Then pull the model:
ollama pull llama3.2
Start Ollama:
ollama serve
python app.py
Open your browser:
http://127.0.0.1:5000
Supported formats
- DOCX
- TXT
Upload a document using the web interface.
- LangChain
- Ollama
- Hugging Face Embeddings
- FAISS
- SQLite
- Flask
- JavaScript
- Conversation memory
- Streaming responses
- ChromaDB support
- Authentication
- Docker support
- GitHub Actions CI/CD
- Multi-user support
Rahul Bansal