DocChat is an AI-powered document assistant that solves a common problem: once PDFs are uploaded, finding exact information quickly is hard. This project lets users upload documents and ask natural-language questions, with answers generated from retrieved relevant chunks.
- Manual PDF searching is slow and error-prone.
- Important information is often buried across long documents.
- Teams need fast Q&A over their own files without rewriting content manually.
DocChat addresses this through a RAG pipeline backed by Pinecone and Gemini-based response generation.
- Frontend (React + Vite) for upload and chat UI
- Backend (FastAPI) with
/uploadand/chatendpoints - RAG pipeline for ingestion, retrieval, and answer generation
- Frontend: https://doc-chat-one.vercel.app
User -> React Frontend -> FastAPI Backend -> RAG Pipeline -> Pinecone / Gemini
\-> PDF Upload -> Ingestion -> Embeddings
POST /upload: receives PDFs, stores/processes them viasrc/ingestion.pyPOST /chat: receives question, runs retrieval+generation flow fromsrc/graph.py
FileUpload.jsx: handles PDF uploads to backendChatInterface.jsx: handles user questions and responsesApp.jsx: overall page layout and orchestration
config.py: environment and model/vector settingsingestion.py: PDF -> text chunks -> embeddings -> Pineconeretrieval.py: similarity retrieval from Pineconegraph.py: LangGraph flow for answer generation
git clone https://github.com/Rahul-Ganesan/DocChat.git
cd DocChat
pip install -r requirements.txtcp .env.example .envSet required values in .env:
GOOGLE_API_KEY=your_google_api_key_here
PINECONE_API_KEY=your_pinecone_api_key_here
GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account-key.jsoncd frontend
npm install
npm run devFrontend runs on http://localhost:5173.
From repo root:
uvicorn fastApi.api:app --host 0.0.0.0 --port 8000 --reloadBackend runs on http://localhost:8000.
POST /upload- Upload and process PDFPOST /chat- Ask question over indexed document content
- Frontend is suitable for Vercel deployment (
frontendas root directory). - Backend can run on a VM/container with port
8000exposed. - Set frontend
VITE_API_URLto your backend HTTPS URL in production. - Ensure backend CORS allows the deployed frontend domain.
- Backend not starting: run from repo root and confirm Python dependencies installed.
- Frontend not connecting: verify
VITE_API_URLand backend URL/port. - Upload failing: confirm backend is running and accepts multipart uploads.
- Chat empty/poor results: verify document was ingested and API keys are valid.
DocChat/
├── fastApi/
│ ├── api.py
│ └── api_vm_update.py
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── FileUpload.jsx
│ │ │ └── ChatInterface.jsx
│ │ ├── App.jsx
│ │ └── index.css
│ ├── package.json
│ └── README.md
├── src/
│ ├── config.py
│ ├── ingestion.py
│ ├── retrieval.py
│ └── graph.py
├── .env.example
├── main.py
└── requirements.txt
- Add source citations and page references in answers