An AI chatbot with Retrieval-Augmented Generation (RAG) capabilities, supporting document uploads (PDF/DOCX/HTML), with usage of LLaMA models, and chat history persistence.
Project is based on an example described in this article.
- Document upload and indexing
- Content-aware chat with history
- Support for LLaMA (via Ollama)
- Document deletion and management
- SQLite logging for auditability
| Component | Technology |
|---|---|
| Backend | FastAPI |
| Frontend | Streamlit |
| Vector DB | ChromaDB |
| NLP | LangChain + HuggingFace/HFEmbeddings |
| Models | LLaMA 3, LLaMA 2 |
| Database | SQLite3 |
├── application_api/ # FastAPI backend
│ ├── utils/ # Chroma/LangChain utilities
│ ├── model/ # Pydantic validation models
│ └── api.py # API endpoints
├── ui/ # Streamlit frontend
│ ├── components/ # UI components
│ ├── utils/ # UI utils
│ └── streamlit_app.py # Streamlit app
├── requirements.txt # Dependencies
└── main.py # Streamlit app entry point
| Endpoint | Method | Description |
|---|---|---|
| / | POST | Submit chat queries |
| /upload-doc | POST | Upload/index documents |
| /list-docs | GET | List uploaded documents |
| /delete-doc | POST | Delete document by ID |
git clone https://github.com/oden73/RAG_Chatbot_with_LangChain.git
cd RAG_Chatbot_with_LangChainpython -m venv venv
source venv/bin/activate # For Linux/Mac
venv\Scripts\activate # For Windowspip install -r requirements.txt- Install Ollama
- Launch Ollama with
ollama serve - Install LLaMA models with
ollama pull <model_name>
Start Backend
uvicorn application_api.api:app --reload --port 8000Start Frontend
streamlit run main.py