Rag_Chat with doc/pdf that support amharic and english language
# DocChat β Bilingual RAG Web App πͺπΉ
### α ααα / English Document Intelligence
A modern, minimal, production-ready document QA platform.
**Stack:** FastAPI Β· Gemini 1.5 Flash Β· ChromaDB Β· Vanilla JS (no framework)
---
## Features
| Feature | Detail |
|---------|--------|
| π Multi-format | PDF, DOCX, TXT, PPTX |
| π Bilingual | Amharic (α ααα) + English auto-detection |
| β‘ Streaming | Token-by-token streaming like ChatGPT |
| π§ RAG Pipeline | Chunk β Embed β Vector Store β Retrieve β Generate |
| π Semantic Search | Gemini text-embedding-004 |
| π Vector DB | ChromaDB (in-memory / persistent) |
| π³ Docker | One-command deployment |
---
## Architecture
```
Browser (HTML/CSS/JS)
β Upload files β SSE stream
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β FastAPI Backend β
β β
β /upload /chat/stream β
β β β β
β Extract text Embed query β
β Chunk (800 chars) ChromaDB search β
β Embed (Gemini) Top-5 chunks β
β ChromaDB.add() Gemini generate β
β SSE yield β
βββββββββββββββββββββββββββββββββββββββββββ
```
---
## Quick Start
### 1. Clone & Configure
```bash
git clone
github.com
cd doc-chat
```
Set your Gemini API key:
```bash
export GEMINI_API_KEY="your-key-here"
```
Or create `.env`:
```
GEMINI_API_KEY=your-key-here
```
### 2a. Docker (Recommended)
```bash
docker-compose up --build
```
- Frontend:
localhost
- Backend API:
localhost
- API Docs:
localhost
### 2b. Local Dev
**Backend:**
```bash
cd backend
pip install -r requirements.txt
uvicorn main:app --reload --port 8000
```
**Frontend:**
```bash
# Any static server works
cd frontend
npx serve . -p 3000
# or: python -m http.server 3000
```
---
## API Endpoints
| Method | Path | Description |
|--------|------|-- β¦