Upload your PDF notes · Ask anything · Get instant AI-powered answers
StudyMind is a full-stack AI teaching assistant that lets students upload their PDF notes and ask natural language questions about them. It uses a RAG (Retrieval-Augmented Generation) pipeline to find the most relevant section of your notes and generate a precise, context-grounded answer — no hallucinations, no generic responses.
- 📄 PDF Upload — Upload any text-based PDF; text is extracted and chunked automatically
- 🔍 Semantic Search — Questions are matched to notes by meaning, not just keywords
- 🤖 AI Answers — LLaMA 3.3 70B (via Groq) generates clear, concise answers
- 💬 Chat Interface — Clean chat UI with message history and loading indicators
- ⚡ Fast Inference — Groq's LPU hardware delivers answers in seconds
- 🌐 Fully Deployed — Live on Vercel + Render, accessible from any device
┌─────────────────────────────────────────────────────────────┐
│ USER │
│ (Browser / Mobile) │
└───────────────────────┬─────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ FRONTEND — React + Tailwind CSS │
│ Deployed on Vercel │
│ studymindv2-xi.vercel.app │
└───────────────────────┬─────────────────────────────────────┘
│ HTTP (REST API)
▼
┌─────────────────────────────────────────────────────────────┐
│ BACKEND — FastAPI + Python │
│ Deployed on Render │
│ studymind-jqmn.onrender.com │
│ │
│ POST /upload POST /ask GET / │
│ ───────────── ───────── ────── │
│ Extract text Embed question Health │
│ Chunk (500w) Cosine similarity check │
│ Embed chunks Find best chunk │
│ Store in DB Prompt LLaMA │
└──────┬────────────────────────┬────────────────────────────┘
│ │
▼ ▼
┌──────────────┐ ┌─────────────────────────────────────┐
│ PostgreSQL │ │ External APIs │
│ (Render) │ │ │
│ │ │ HuggingFace Inference API │
│ chunks + │ │ sentence-transformers/ │
│ embeddings │ │ all-MiniLM-L6-v2 │
│ (JSONB) │ │ → 384-dim embeddings │
└──────────────┘ │ │
│ Groq Cloud API │
│ llama-3.3-70b-versatile │
│ → Answer generation │
└─────────────────────────────────────┘
PDF Upload Question Asked
│ │
▼ ▼
Extract Text Embed Question
(pdfplumber) (HuggingFace API)
│ │
▼ ▼
Split into 384-dim vector
500-word chunks │
│ ▼
▼ Cosine Similarity
Embed each chunk vs all stored embeddings
(HuggingFace API) │
│ ▼
▼ Best matching chunk
Store in PostgreSQL │
as JSONB ▼
Prompt = chunk + question
│
▼
Groq LLaMA 3.3 70B
│
▼
Final Answer
| Layer | Technology | Purpose |
|---|---|---|
| Frontend | React.js + Tailwind CSS | Chat UI, PDF upload, state management |
| Backend | FastAPI (Python) | REST API, PDF processing, RAG orchestration |
| Embeddings | HuggingFace — all-MiniLM-L6-v2 | 384-dim semantic embeddings for chunks & queries |
| LLM | Groq — llama-3.3-70b-versatile | Answer generation from retrieved context |
| Database | PostgreSQL 18 | Stores text chunks + embeddings as JSONB |
| PDF Parsing | pdfplumber | Multi-page text extraction from PDF files |
| Similarity | NumPy cosine similarity | Finds most relevant chunk for each question |
| Frontend Deploy | Vercel | Auto-deploys React on every git push |
| Backend Deploy | Render | Persistent Python web service + managed PostgreSQL |
studymind/
├── backend/
│ ├── main.py # FastAPI app — all routes & RAG logic
│ └── requirements.txt # Python dependencies
│
├── frontend/
│ └── src/
│ ├── App.jsx # Main React component — full chat UI
│ ├── App.css # Global styles
│ └── index.js # React entry point
│
└── README.md
- Python 3.10+
- Node.js 18+
- PostgreSQL (local or cloud)
- HuggingFace API key → huggingface.co/settings/tokens
- Groq API key → console.groq.com
# Clone the repo
git clone https://github.com/anshhh1101/studymind.git
cd studymind/backend
# Install dependencies
pip install -r requirements.txt
# Create .env file
echo "HF_KEY=your_huggingface_token" >> .env
echo "GROQ_KEY=your_groq_key" >> .env
echo "DATABASE_URL=postgresql://user:password@localhost/studymind" >> .env
# Run the server
uvicorn main:app --reload --port 8000Backend runs at: http://localhost:8000
API docs at: http://localhost:8000/docs
cd studymind/frontend
# Install dependencies
npm install
# Point to local backend (edit App.jsx line 3)
# const API = "http://localhost:8000";
# Start dev server
npm run devFrontend runs at: http://localhost:5173
| Service | Platform | URL |
|---|---|---|
| Frontend | Vercel | studymindv2-xi.vercel.app |
| Backend | Render | studymind-jqmn.onrender.com |
| Database | Render PostgreSQL | Internal (Singapore region) |
| Key | Description |
|---|---|
HF_KEY |
HuggingFace API token (hf_...) |
GROQ_KEY |
Groq API key (gsk_...) |
DATABASE_URL |
Render internal PostgreSQL connection string |
Health check
{ "status": "StudyMind API is running" }Upload a PDF file
- Body:
multipart/form-datawithfilefield - Response:
{ "message": "PDF uploaded successfully. 6 chunks stored." }Ask a question about the uploaded PDF
- Body:
{ "question": "What are the key features of the dashboard?" }- Response:
{ "answer": "The dashboard includes KPI cards, a sentiment slicer, a Bing Map..." }- Single document — uploading a new PDF replaces the previous one
- No conversation memory — each question is independent
- Free tier cold starts — first request after inactivity may take ~50 seconds
- No authentication — app is publicly accessible
- Top-k retrieval — use 3 best chunks instead of 1 for richer context
- Streaming responses — stream LLM output token by token
- Multi-document support — query across multiple uploaded PDFs
- Conversation history — maintain context across questions
- pgvector — replace JSONB with native vector similarity for scale
- User authentication — secure per-user document storage
- Mobile responsive improvements
Anshuman Dev
- GitHub: @anshhh1101
- B.Tech | Roll No: 23051168
Built with ❤️ using RAG Pipeline · FastAPI · HuggingFace · Groq · PostgreSQL · React
⭐ Star this repo if you found it useful!