CoolFace
Apppublic

jaivardhan2409/document-ai-analyst

sourceHugging Facemitupdated 5mo agoView on Hugging Face
0likes
App README

๐Ÿง  Document AI Analyst โ€” Enterprise Agentic RAG System

Upload complex PDFs, DOCX files, CSVs, or text documents and chat with an AI agent that provides accurate, cited insights powered by Retrieval-Augmented Generation.

โœจ Features

  • โ€”Multi-Format Upload โ€” PDF, DOCX, TXT, CSV, and Markdown with smart chunking
  • โ€”Semantic Search โ€” High-precision vector retrieval using Google Gemini embeddings
  • โ€”Streaming Chat โ€” Real-time AI responses with inline source citations
  • โ€”Data Isolation โ€” Per-user knowledge bases and vector collections for complete privacy
  • โ€”Persistent Sessions โ€” Seamless authentication with secure JWT tokens
  • โ€”Premium UI โ€” Custom dark-themed Streamlit interface with glassmorphism and micro-animations

๐Ÿ—๏ธ Architecture

LayerTechnology
FrontendStreamlit, Custom CSS Injection, SSE
BackendFastAPI, SQLAlchemy, JWT Auth
EmbeddingsGoogle Gemini (gemini-embedding-001)
Vector StoreChromaDB (persistent, per-user collections)
DatabasePostgreSQL (User metadata, Document tracking)
LLMGoogle Gemini (gemini-2.5-flash-lite)
DeploymentDocker Compose multi-container orchestration

๐Ÿš€ Quick Start

  1. 1.Clone the repository and create your .env file:
bash
   cp .env.example .env
  1. 1.Add your Gemini API Key to the .env file.
  2. 2.Start the application using Docker Compose:
bash
   docker compose up -d --build
  1. 1.Access the UI at http://localhost:7860. Register an account, upload a document, and start chatting!

๐Ÿ”ง Local Development

Backend

bash
cd backend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --port 8000 --reload

Frontend

bash
cd frontend
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
streamlit run app.py

๐Ÿ“ฆ Environment Variables

VariableRequiredDescription
GEMINI_API_KEYโœ…Google Gemini API key for LLM and embeddings
POSTGRES_USERโœ…PostgreSQL database user
POSTGRES_PASSWORDโœ…PostgreSQL database password
POSTGRES_DBโœ…PostgreSQL database name
SECRET_KEYโœ…JWT signing secret string

๐Ÿ› ๏ธ Tech Stack

Built with: FastAPI โ€ข Streamlit โ€ข ChromaDB โ€ข Google Gemini โ€ข PostgreSQL โ€ข Docker Compose