╔══════════════════════════════════════════════════════════════════════════════╗
║ ║
║ ██████╗ ██████╗ ██████╗██╗ ██╗███╗ ███╗██╗███╗ ██╗██████╗ ║
║ ██╔══██╗██╔═══██╗██╔════╝██║ ██║████╗ ████║██║████╗ ██║██╔══██╗ ║
║ ██║ ██║██║ ██║██║ ██║ ██║██╔████╔██║██║██╔██╗ ██║██║ ██║ ║
║ ██║ ██║██║ ██║██║ ██║ ██║██║╚██╔╝██║██║██║╚██╗██║██║ ██║ ║
║ ██████╔╝╚██████╔╝╚██████╗╚██████╔╝██║ ╚═╝ ██║██║██║ ╚████║██████╔╝ ║
║ ╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝╚═════╝ ║
║ ║
║ Multi-PDF RAG Intelligence System v1.0.0 ║
║ FastAPI · Streamlit · Gemini 2.5 Flash · ChromaDB · BM25 · RAGAS · Docker ║
╚══════════════════════════════════════════════════════════════════════════════╝
┌────────────────────────────────────────────┐
│ Streamlit Frontend (8501) │
│ Premium UI • Chat • Metrics • Upload │
└──────────────────┬─────────────────────────┘
│ HTTP REST
┌──────────────────▼─────────────────────────┐
│ FastAPI Backend (8000) │
│ Upload • Query • Metrics • Cache │
└──────────────────┬─────────────────────────┘
│
┌────────────────────▼────────────────────┐
│ Document Processing Pipeline │
│ │
│ PDF Upload (Multiple PDFs) │
│ │ │
│ PDFPlumber Extraction │
│ │ │
│ Semantic Chunking │
│ │ │
│ Gemini Embedding-001 (3072 Dimensions) │
│ │ │
└───────┬───────────────┬──────────────────┘
│ │
▼ ▼
ChromaDB Vector DB BM25 Index
│ │
└──────┬────────┘
▼
Reciprocal Rank Fusion (RRF)
│
▼
CrossEncoder Re-ranking
│
▼
Gemini 2.5 Flash Generator
│
▼
Citation-aware Answer + Confidence Score
│
┌────────────┴────────────┐
▼ ▼
Semantic Cache RAGAS Evaluation
│ │
└────────────┬────────────┘
▼
SQLite Metrics
- Multi-PDF Upload & Indexing
- PDFPlumber Text Extraction
- Semantic-aware Chunking
- Gemini Embedding-001 (3072-Dimensional Embeddings)
- ChromaDB Vector Database
- BM25 Sparse Retrieval
- Hybrid Retrieval Pipeline
- Reciprocal Rank Fusion (RRF)
- CrossEncoder Re-ranking
- Gemini 2.5 Flash Answer Generation
- Citation-aware Responses
- Confidence Score
- Semantic Cache
- RAGAS Evaluation
- SQLite Metrics Dashboard
- FastAPI REST API
- Streamlit Premium Dashboard
- LangSmith Tracing Support
- Apify Web Context (Optional)
- Docker & Docker Compose Support
- Dark Premium Responsive UI
- Upload multiple PDF documents.
- Extract text page-by-page using PDFPlumber.
- Perform semantic-aware chunking.
- Generate Gemini Embedding-001 vectors.
- Store embeddings in ChromaDB.
- Build BM25 sparse index.
- Receive user question.
- Check Semantic Cache.
- Dense Retrieval (ChromaDB Top-20)
- Sparse Retrieval (BM25 Top-20)
- Reciprocal Rank Fusion
- CrossEncoder Re-ranking
- Context Assembly
- Gemini 2.5 Flash Response Generation
- Citation Generation
- Confidence Score Calculation
- Background RAGAS Evaluation
- Store Metrics in SQLite
- Python 3.11+
- Docker Desktop
- Google Gemini API Key
git clone <repository-url>
cd documind-procp .env.example .envFill your API keys.
python -m venv .venv
# Windows
.venv\Scripts\activate
pip install -r requirements.txtuvicorn api.main:app --reloadBackend
http://localhost:8000
Swagger
http://localhost:8000/docs
streamlit run frontend/app.pyFrontend
http://localhost:8501
docker compose up --build| Method | Endpoint | Description |
|---|---|---|
| POST | /upload | Upload and index PDFs |
| POST | /query | Ask questions |
| GET | /documents | List indexed documents |
| DELETE | /documents/{doc_id} | Delete document |
| GET | /metrics | Evaluation metrics |
| GET | /cache/stats | Cache statistics |
| DELETE | /cache | Clear semantic cache |
| GET | /health | Health check |
| Environment Variable | Service | Required |
|---|---|---|
| GOOGLE_API_KEY | Google Gemini | Yes |
| LANGCHAIN_API_KEY | LangSmith | Optional |
| APIFY_API_TOKEN | Apify | Optional |
- Copy
.env.example→.env - Add Google Gemini API Key.
- Start Backend.
- Start Frontend.
documind-pro/
├── api/
├── cache/
├── evaluation/
├── frontend/
├── pipeline/
├── rag/
├── retrieval/
├── workflows/
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── .env.example
└── README.md
| Layer | Technology |
|---|---|
| Backend | FastAPI |
| Frontend | Streamlit |
| LLM | Gemini 2.5 Flash |
| Embeddings | Gemini Embedding-001 |
| Orchestration | LangChain |
| Dense Retrieval | ChromaDB |
| Sparse Retrieval | BM25 |
| Re-ranking | HuggingFace CrossEncoder |
| Evaluation | RAGAS |
| Database | SQLite |
| Web Context | Apify (Optional) |
| Observability | LangSmith |
| Containerization | Docker |
| Language | Python 3.11 |
Verify your GOOGLE_API_KEY in .env.
Use:
models/gemini-embedding-001
Wait for the free-tier quota to reset or use another API key.
Delete the local data/chroma directory and re-index your documents.
Reconnect Gmail OAuth inside n8n.
Ensure the backend is running on port 8000 before starting Streamlit.
MIT License
Aman Nanda
B.Sc. Artificial Intelligence
Generative AI • RAG Engineering • LLM Applications • AI Automation • FastAPI • Streamlit • LangChain • Gemini • ChromaDB • Docker