A sophisticated RAG-powered chatbot using Google Gemini AI, FAISS vector search, and 716 document chunks from official RBI guidelines.
sequenceDiagram
participant User
participant Streamlit as Web UI
participant App as FastAPI/App layer
participant RAG as RAG Chain
participant VectorDB as FAISS (Vector Store)
participant LLM as Google Gemini
User->>Streamlit: Asks question
Streamlit->>App: Sends text
App->>RAG: Invokes Chain
RAG->>VectorDB: Query similar chunks (Top-4)
VectorDB-->>RAG: Returns context
RAG->>LLM: Prompt + Context + Question
LLM-->>RAG: Generated Answer
RAG-->>App: Answer + Source Metadata
App-->>Streamlit: Display result
Streamlit-->>User: Shows answer & sources
-
Build the image
make docker-build # OR docker build -t rbi-bot .
-
Run the container
# Ensure .env exists with GOOGLE_API_KEY make docker-run # OR docker run -p 8501:8501 --env-file .env rbi-bot
-
Access Open http://localhost:8501
-
Setup
make install cp .env.example .env # Add your GOOGLE_API_KEY -
Run
make run
✨ 330-page RBI Master Direction → 716 smart chunks → Accurate answers with citations
| Interface | Command | Use Case |
|---|---|---|
| 🌐 Web UI | make run |
Best for demonstrations |
| 💬 Interactive CLI | python examples/demo_interactive.py |
Quick Q&A sessions |
| 🔌 REST API | python examples/demo_api.py |
Integration, automation |
This project uses modern Python tooling.
# Linting (Ruff + Mypy)
make lint
# Testing (Pytest)
make test- LLM: Google Gemini 2.5 Flash
- Embeddings: Google text-embedding-004 (768-dim)
- Vector DB: FAISS (716 chunks)
- Framework: LangChain 0.2.16
- Container: Docker Multi-stage Build
chatbot-langchain/
├── .github/ # CI/CD Workflows
├── src/ # Source code
│ └── rbi_nbfc_chatbot/
│ ├── chains/ # RAG pipeline logic
│ ├── utils/ # Document processing
│ └── api/ # FastAPI server endpoints
├── tests/ # Pytest suite
├── data/ # Vector store & documents
├── Dockerfile # Container definition
├── Makefile # Task runner
└── pyproject.toml # Tool configuration
- ⚡ 2-5 seconds per query
- 🎯 716 chunks searchable
- 🔍 Top-4 document retrieval
- 💾 ~600MB Docker Image size (Optimized)
Built with ❤️ using Google Gemini, LangChain, and FAISS