Inspiration
Every year, over 2.5 million students in India prepare for ultra-competitive national engineering and medical entrance examinations (JEE Main / Advanced and NEET UG). When students get stuck on complex multi-concept physics problems or organic chemistry mechanisms, traditional AI tools and solution apps deliver instant, spoon-fed solutions.
Reading a complete final solution gives students a false sense of understanding. On exam day, when presented with a slight variation of the problem, they freeze because they never developed the underlying problem-solving intuition. We asked ourselves a fundamental question: What if an AI didn't just give students the answer, but taught them how to think? Inspired by the classical Socratic Method, we built SocraticAI—an autonomous AI tutor that transcribes messy handwritten notebook photos, diagnoses exact conceptual blindspots, and guides students through 3 progressive micro-hints without ever spoiling the final answer.
What it does
SocraticAI transforms passive solution reading into an interactive, gamified self-correction loop:
- Multimodal Vision OCR & Transcription: Students snap a photo of any handwritten physics notebook, chemistry equation, or math proof. SocraticAI automatically transcribes raw mathematical notation into human-readable LaTeX notation (e.g., \( \vec{p} = \sum q_i \vec{r}_i \)).
- Automatic AI Error Diagnosis: Automatically classifies error types—distinguishing between Conceptual Blindspots, Formula Misapplications, Calculation Slips, and Speed Bottlenecks.
- 3-Step Progressive Socratic Hints: Prompts three micro-hints sequentially:
- Hint 1: Identifies core physical principles and governing equations.
- Hint 2: Breaks the complex problem into smaller sub-algebraic steps.
- Hint 3: Prompts dimensional consistency or base-case boundary checks (\( n = 1 \)).
- * Performance-Based XP Reward (+145 XP):** SocraticAI dynamically evaluates student progress. When a student completes more than 50% of the problem-solving steps through the Socratic hints, they unlock +145 XP and climb the All-India Leaderboard!
- Exam Goal Isolation (JEE vs NEET): Automatically switches curriculum focus:
- JEE Main & Advanced: Physics, Chemistry, Mathematics (PCM)
- NEET UG: Physics, Chemistry, Biology (PCB)
How we built it
SocraticAI is built on a modern, decoupled full-stack architecture optimized for high-speed inference and real-time responsiveness:
- Frontend: Built with React 18, Vite, Framer Motion for micro-animations, and Vanilla CSS Design Tokens featuring dark-mode glassmorphism.
- Backend API Gateway: Developed using FastAPI (Python 3.13) hosted on Render with CORS configuration and Pydantic validation schemas.
- AI & Computer Vision Engine: Powered by Google Gemini 3.6 Flash / 1.5 Pro Multimodal Vision with custom system prompts enforcing JSON structured output schemas.
- Database & Persistence: Supabase PostgreSQL for storing diagnostic tickets, user XP streaks, and question histories.
Challenges we ran into
- Eliminating Solution Spoilers: Large Language Models naturally want to solve problems completely. Engineering system prompts to enforce strict Socratic constraints—forbidding the model from stating final numeric answers in hints—required extensive prompt iteration.
- Handwritten Mathematical OCR: Notebook handwriting often contains shorthand symbols (\( \vec{r}_1 = -3a\hat{j} \)). Combining OpenCV image preprocessing with Gemini Vision ensured accurate LaTeX transcription across various lighting conditions.
- Decoupled Production Deployment: Configuring CORS headers and handling cross-origin API communication between a static Vercel frontend build and a serverless FastAPI Render backend service.
Accomplishments that we're proud of
- Full-Stack Live Production Deployment: Successfully deployed and connected our React frontend on Vercel with a live FastAPI backend on Render, Gemini API, and Supabase Database.
- Zero-Spoiler Pedagogical Logic: Perfected strict JSON schema outputs from Gemini Vision that deliver effective Socratic hints without giving away final answers.
- Performance-Based Gamification: Engineered an XP evaluation algorithm that rewards students with XP only when they successfully complete more than 50% of the problem steps.
What we learned
- Pedagogical Prompt Engineering: Structuring LLM outputs using Pydantic schemas guarantees deterministic, parseable JSON responses for complex educational workflows.
- Gamification Psychology: Rewarding progress thresholds (>50% step completion, streaks, rank badges) significantly increases student engagement compared to static answer keys.
- Production Cloud Decoupled Architecture: Managing production environment variables across Vercel and Render for seamless deployment.
What's next for SocrateAI
- 🎙️ Voice-Interactive Socratic Dialogues: Real-time speech-to-speech Socratic questioning using Gemini Multimodal Live API.
- 📊 Diagram & Graph Diagnostic OCR: Expanding vision processing to parse ray-optics diagrams, organic reaction mechanisms, and circuit schematics.
- 🏫 Institutional Dashboard for Educators: Providing teachers with diagnostic analytics to identify common class-wide conceptual blindspots.
Built With
- ai
- computer-vision
- cors
- css3
- fastapi
- framer-motion
- gemini-api
- git
- github
- google-cloud
- google-gemini
- html5
- javascript
- latex
- opencv
- postgresql
- pydantic
- python
- react
- render
- rest-api
- supabase
- uvicorn
- vercel
- vite


Log in or sign up for Devpost to join the conversation.