Here’s your updated README.md with architecture included and clean structure (single copy-ready format):
A production-ready full-stack Retrieval-Augmented Generation (RAG) application that enables users to upload multiple PDFs, store embeddings in a vector database, and perform intelligent agentic reasoning using Google Gemini AI through a modern, interactive UI.
- Frontend: Next.js 14 (App Router), Tailwind CSS, Framer Motion, React Markdown
- Backend: FastAPI,
google-generativeai,pymupdf,sentence-transformers - Database: Endee Vector Database (Docker)
┌──────────────────────────────┐
│ Frontend │
│ Next.js + Tailwind + FM │
│ (Chat UI + Upload UI) │
└──────────────┬───────────────┘
│
│ API Calls (/api/*)
▼
┌──────────────────────────────┐
│ FastAPI Backend │
│ │
│ • PDF Processing (PyMuPDF) │
│ • Chunking │
│ • Embeddings (MiniLM) │
│ • Query Orchestration │
└──────────────┬───────────────┘
│
┌─────────────────┴─────────────────┐
│ │
▼ ▼
┌──────────────────────────┐ ┌──────────────────────────┐
│ Endee Vector DB │ │ Gemini 1.5 Pro AI │
│ (Embeddings Storage) │ │ (Reasoning + Response) │
└──────────────────────────┘ └──────────────────────────┘
│
▼
Retrieved Context Chunks
│
▼
Final Answer + Sources
│
▼
Frontend UI
Backend (backend/.env)
GEMINI_API_KEY="your_google_ai_studio_api_key_here"
ENDEE_HOST="localhost"
ENDEE_PORT="8080"
docker run \
--ulimit nofile=100000:100000 \
-p 8080:8080 \
-v ./endee-data:/data \
--name endee-server \
--restart unless-stopped \
endeeio/endee-server:latestcd backend
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload --port 8000Backend runs on: 👉 http://localhost:8000
cd frontend
npm install
npm run devFrontend runs on: 👉 http://localhost:3000
Note:
/api/*routes are proxied to FastAPI via Next.js rewrites.
-
Accepts:
multipart/form-datawith one or more PDF files -
Process:
- Extract text using PyMuPDF
- Chunk content
- Generate embeddings (
MiniLM-L6-v2) - Store in Endee vector database
- Accepts:
{
"query": "your question",
"history": []
}-
Returns:
- AI-generated answer (Gemini)
- Source metadata (file name + page references)
- User uploads PDFs
- Backend extracts & chunks text
- Embeddings are generated and stored in Endee
- User asks a query
- Relevant chunks are retrieved from Endee
- Context + query sent to Gemini
- Gemini generates grounded response
- Answer + sources displayed in UI
- Multi-PDF upload and semantic search
- Agentic reasoning with Gemini AI
- Context-aware conversational memory
- Source citation for transparency
- Smooth animated UI (Framer Motion)
- Fully local vector database (Endee)