PDF-Assit_RAG / README.md
Param20h's picture
Changes Pro max
26a0c00 unverified
metadata
title: Document AI Analyst
emoji: 🧠
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: true
license: mit
short_description: Enterprise Agentic RAG β€” upload PDFs and chat with AI

🧠 Document AI Analyst β€” Enterprise Agentic RAG System

Upload complex PDFs, financial reports, legal contracts, or research papers and chat with an AI agent that provides accurate, cited insights powered by Retrieval-Augmented Generation.

✨ Features

  • Multi-Format Upload β€” PDF, DOCX, TXT, Markdown with smart chunking
  • Semantic Search β€” Two-stage retrieval with cross-encoder reranking
  • Streaming Chat β€” Real-time AI responses with inline source citations
  • Data Isolation β€” Per-user vector collections for complete privacy
  • Open-Source LLMs β€” Powered by Mistral-7B and HuggingFace ecosystem

πŸ—οΈ Architecture

Layer Technology
Frontend Next.js 16, Tailwind CSS v4, Shadcn UI v2
Backend FastAPI, SQLAlchemy, JWT Auth
Embeddings sentence-transformers/all-MiniLM-L6-v2 (local)
Vector Store ChromaDB (persistent, per-user collections)
Reranker cross-encoder/ms-marco-MiniLM-L-6-v2
LLM Mistral-7B-Instruct via HuggingFace Inference API
Deployment Docker multi-stage build on HuggingFace Spaces

πŸš€ Quick Start

  1. Register an account
  2. Upload a PDF document
  3. Wait for processing (chunking + embedding)
  4. Ask questions and get cited answers!

πŸ”§ Local Development

# Backend
cd backend && python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --port 7860

# Frontend
cd frontend && npm install && npm run dev

πŸ“¦ Environment Variables

Variable Required Description
HF_TOKEN βœ… HuggingFace API token for LLM inference
SECRET_KEY βœ… JWT signing secret
DATABASE_URL ❌ SQLite path (default: sqlite:///./data/app.db)

πŸ› οΈ Tech Stack

Built with: FastAPI β€’ LangChain β€’ ChromaDB β€’ HuggingFace β€’ Next.js 16 β€’ Tailwind CSS β€’ Shadcn UI