Logo Lanfrica

wagari-endalew/doc-chat

Domain:

natural language processing

Record type:

software
Creator:
wag
Host:
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 | |--------|------|-- …