- Frontend:
- Next.js (React 18 App Router), Tailwind CSS, React Query
- Backend:
- FastAPI for API endpoints and cross-origin interaction
- Database:
- PDFs stored securely in Supabase buckets
- SQLite database for metadata
- Local storage for FAISS vector indices
- NLP and Retrieval:
- LangChain and LlamaIndex for context retrieval
- Embedding Model:
- togethercomputer/m2-bert-80M-32k-retrieval (Together AI API)
- LLM Model:
- mistralai/Mixtral-8x7B-Instruct-v0.1 (Together AI API)
- FastAPI Endpoints:
- /upload: Upload PDF documents, save to Supabase Storage, and index locally.
- /ask: Submit questions and receive streamed answers.
- PDF Processing:
- Extract text using PyMuPDF.
- Store temporary vectors using FAISS.
- NLP Handling:
- LangChain and LlamaIndex manage context retrieval and LLM interaction.
- Next.js App Router based pages and layouts
- React Query for robust asynchronous API handling
- Tailwind CSS for responsive and clean UI
- Error Handling: Client-side notifications for upload or server failures
git clone https://github.com/ArshanKaudinya/PDFhelper
cd PDFhelperCreate a .env file inside the backend folder with the following:
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
OPENAI_API_KEY=your_together_ai_token
Create a .env.local file inside the frontend folder with:
NEXT_PUBLIC_API_BASE=http://localhost:8000
(Replace localhost:8000 if backend hosted elsewhere.)
cd backend
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install -r requirements.txtcd backend
uvicorn app.main:app --reloadcd frontend
pnpm dev
# or
npm run dev- Frontend deployed on Vercel
- Backend hosted on Railway
- Storage handled by Supabase buckets
- Upload PDFs directly from your browser
- Embeddings are generated and stored locally
- Ask natural questions about uploaded PDFs
- Search within chat by keywords
- Fully responsive design with mobile support
- Upload a PDF document.
- Ask any question related to the uploaded document.
- Receive concise and accurate answers powered by the Mixtral LLM.
- Search across previous conversation messages.
