π Live Demo: https://askmynotes-algorise.vercel.app
Important
Note: Responses may occasionally fail with a "something went wrong" message due to the daily 20-request quota limit of the Gemini API free tier.
Stop asking general AI. Ask your notes.
The AI tutor that actually knows your curriculum, provides citations, and prevents hallucinations.
AskMyNotes is a full-stack RAG (Retrieval-Augmented Generation) study app built with Next.js 16, Gemini 2.0 Flash, ChromaDB, and Supabase Auth. Upload your lecture notes (PDF or text), and get an AI copilot that answers questions only from your material β with confidence scores, citations, and source snippets.
| Feature | Description |
|---|---|
| π Auth | Supabase email/password authentication with middleware-protected routes |
| π PDF & Text Upload | Upload study material (PDF or paste text) β chunked and embedded into ChromaDB |
| π¬ RAG Chat | Ask questions and get answers grounded in your notes with confidence badges and citations |
| π Study Mode | Generate MCQs (5) or Short Q&A (3) directly from your uploaded material |
| ποΈ AI Voice Assistant | Speak your questions and hear AI answers using Web Speech API |
| πΎ Chat Persistence | Chat history saved per subject via localStorage β survives page reloads |
| π Dark / Light Mode | Full theme toggle with smooth transitions |
| π€ Profile Modal | View user profile with study stats |
| π¨ Premium UI | Glassmorphism, gradient accents, micro-animations, Bricolage Grotesque font |
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ
β Next.js ββββββΆβ Gemini β β Supabase β
β Frontend β β 2.0 Flash β β Auth β
β (App Router)β β (LLM + β β β
β β β Embeddings)β β β
ββββββββ¬ββββββββ ββββββββββββββββ ββββββββββββββββ
β
βΌ
ββββββββββββββββ
β ChromaDB β
β Vector β
β Store β
β (Persisted) β
ββββββββββββββββ
- Upload β PDF/text is chunked (500 chars, 50 overlap) β embedded via Gemini β stored in ChromaDB with
{userId, subject}metadata - Ask β Question is embedded β top-k similar chunks retrieved (filtered by user + subject) β Gemini generates answer with citations
- Study β Context chunks retrieved β Gemini generates MCQs or short-answer questions grounded in the material
src/
βββ app/
β βββ api/
β β βββ ask/route.js # RAG Q&A endpoint
β β βββ study/route.js # MCQ & Short Q&A generator
β β βββ upload/route.js # PDF/text upload + chunking + embedding
β βββ auth/
β β βββ actions.js # Supabase login/signup/logout server actions
β β βββ auth.css # Auth page styles
β β βββ page.js # Login / Sign-up page
β βββ dashboard/
β β βββ dashboard.css # Dashboard styles (incl. voice assistant)
β β βββ page.jsx # Dashboard with subjects, AI tools, voice panel
β βββ subject/[id]/
β β βββ page.jsx # Subject page: upload, chat, study mode
β β βββ subject.css # Subject page styles
β βββ globals.css # Design system: tokens, components, animations
β βββ layout.js # Root layout with Google Fonts
β βββ page.js # Landing page
βββ components/
β βββ dashboard/
β βββ Header.jsx # Dashboard header with theme toggle
β βββ Sidebar.jsx # Sidebar with workspace subjects
βββ lib/
β βββ gemini.js # Gemini LLM + embeddings singleton
β βββ vectorStore.js # ChromaDB connection + collection management
βββ utils/
β βββ supabase/
β βββ client.js # Browser Supabase client
β βββ server.js # Server-side Supabase client
βββ middleware.js # Auth route protection
- Node.js β₯ 18
- Python β₯ 3.8 (for ChromaDB)
- A Google AI Studio account (aistudio.google.com) for the Gemini API key
- A Supabase project (supabase.com) for authentication
git clone https://github.com/YOUR_USERNAME/AskMyNotes.git
cd AskMyNotesnpm install --legacy-peer-deps
--legacy-peer-depsis needed because@langchain/communityexpectspdf-parse@2.xas an optional peer, but we use1.1.1for Turbopack compatibility.
pip install chromadbCreate a .env.local file in the project root:
# Supabase (get these from your Supabase project β Settings β API)
NEXT_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT.supabase.co
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
# Google Gemini (get from https://aistudio.google.com/apikey)
GEMINI_API_KEY=your_gemini_api_key
# ChromaDB
CHROMA_URL=http://localhost:8000- Go to your Supabase project dashboard
- Navigate to Authentication β Providers
- Ensure Email provider is enabled
- (Optional) Disable email confirmation for dev: Authentication β Settings β Confirm Email β toggle off
chroma run --host 0.0.0.0 --port 8000 --path /tmp/chroma_dataChromaDB will persist data at
/tmp/chroma_data. Change the path if you want a permanent location.
npm run devOpen http://localhost:3000 π
Navigate to /auth and create an account with email and password.
From the dashboard, click Create Subject and give it a name (e.g., "Physics", "Biology").
Click on a subject β choose Paste Text or Upload PDF β your material is chunked, embedded, and stored.
Type a question in the chat bar. The AI will answer using only your uploaded notes, showing:
- Confidence badge (High / Medium / Low)
- Citations (file name + chunk ID)
- Supporting snippets (collapsible)
Click the π button in the prompt bar β choose:
- MCQ Practice β 5 multiple-choice questions with explanations
- Short Q&A β 3 short-answer questions with answers
From the dashboard, click the AI Voice Assistant card β select a subject β tap the mic β speak your question β hear the AI response.
| Route | Method | Description |
|---|---|---|
/api/upload |
POST | Upload PDF/text, chunk, embed, store in ChromaDB |
/api/ask |
POST | RAG query β retrieve relevant chunks + generate answer |
/api/study |
POST | Generate MCQs (type: "mcq") or short Q&A (type: "short") |
All routes are auth-gated β they verify the Supabase session and scope queries by userId + subject.
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router, Turbopack) |
| Language | JavaScript (React 19) |
| LLM | Google Gemini 2.0 Flash (gemini-2.0-flash) |
| Embeddings | Google Gemini Embedding (text-embedding-004) |
| Vector Store | ChromaDB (persistent, self-hosted) |
| Auth | Supabase (email/password) |
| PDF Parsing | pdf-parse v1.1.1 |
| Text Splitting | LangChain RecursiveCharacterTextSplitter |
| Styling | Vanilla CSS (glassmorphism, dark mode) |
| Font | Bricolage Grotesque (Google Fonts) |
- Make sure ChromaDB is running (
chroma run ...) - Check that
pdf-parseis v1.1.1:npm ls pdf-parse - Clear the
.nextcache:rm -rf .next && npm run dev
- Verify your Supabase keys in
.env.local - Make sure you're logged in (session cookies must be present)
- Upload material to the subject first before generating study questions
- Use Chrome β
SpeechRecognitionAPI is not supported in all browsers - Allow microphone permissions when prompted
MIT