Inspiration: The Illusion of Competence
Traditional educational AI tools act like automated answer keys. A student gets stuck, prompts an LLM, skims a generated explanation, and experiences what cognitive psychologists call the "illusion of competence"—mistaking familiarity with understanding.
Nobel laureate Richard Feynman famously argued that true mastery is demonstrated when you can teach a concept in plain language without hiding behind rote formulas or academic jargon. We wanted to build a platform that turns the traditional AI tutoring paradigm completely upside down: instead of the AI teaching the student, the student must teach an inquisitive, slightly confused AI classmate named Alex.
What It Does
FeynmanAI implements a reverse-Socratic classroom powered by the Google Gemini API:
- Role Inversion: The user acts as the teacher. Alex (Agent 1) acts as an inquisitive peer who responds with realistic intuitive misconceptions (e.g., "If action and reaction forces are equal, why doesn't everything cancel out to zero acceleration?").
- Dynamic Comprehension HUD: A background pedagogy evaluator (Agent 2) tracks the depth of the user's explanation, scoring mastery in real-time from 0% to 100%.
- Targeted Misconception Traps: When a topic is loaded, the engine dynamically isolates common cognitive pitfalls. As the user dismantles these through intuition and physical mechanics, the traps flip from ❌ Pending to ✅ Resolved.
- LaTeX Math Rendering: Native support for mathematical notation, from Newton's momentum relations ( \vec{F}_{net} = \frac{d\vec{p}}{dt} ) to quantum wavefunctions.
- Mastery Celebration & Synthesis Export: Upon reaching ( \ge 90\% ) mastery, the platform fires a celebration animation and compiles the transcript into downloadable Markdown synthesis notes.
How We Built It
FeynmanAI is engineered with a modular, resilient Python architecture:
- Frontend / Interface: Built entirely in Python using Streamlit, featuring a custom dark-mode HUD with live metrics, progress meters, and dynamic state reactivity.
- LLM Engine: Powered by the new Google GenAI SDK (
google-genai), taking advantage of Gemini Flash (gemini-3.8-flash) for rapid reasoning and conversational generation. - Single-Pass Agent Bundling: To cut round-trip latency to sub-3-seconds, we unified Agent 1 (Alex's dialogue) and Agent 2 (Pedagogical Evaluator & Misconception Tracker) into a single, structured JSON API payload.
- Resilient Multi-Model Failover: Implemented exponential backoff with a tiered model fallback (
gemini-3.8-flash$\rightarrow$gemini-3.1-pro-preview$\rightarrow$gemini-3.5-flash) to gracefully bypass transient 503 gateway surges without user interruption.
Challenges We Faced
- The Latency Trap: Running two sequential LLM calls per turn (one to generate Alex's reply and another to score pedagogy) originally introduced unacceptable network latency. We re-engineered the architecture to bundle both tasks into a single structured schema, dropping response times by over 70%.
- Handling Free-Tier Traffic Surges: During peak cloud demand, endpoints occasionally threw transient
503 UNAVAILABLEerrors. We implemented a custom client wrapper with exponential backoff and automated endpoint failover to maintain high availability. - Calibrating Alex's Persona: Early versions of Alex either yielded too easily or behaved like an aggressive debate bot. We carefully tuned system instructions to strike an authentic balance: a curious high school peer who asks sharp, intuitive questions without being pedantic.
What We Learned
- Prompt Isolation Matters: Separating Alex's persona logic from the evaluator's scoring criteria prevents the conversational persona from breaking character while still allowing clinical pedagogical feedback.
- Active Retrieval in EdTech: Testing the system on physics topics like Newton's Third Law and Bohr's Atomic Model revealed how quickly teaching an AI exposes gaps in one's own conceptual clarity.
What's Next for FeynmanAI
- Multimodal Visual Blackboard: Allowing students to upload hand-drawn diagrams or whiteboard sketches for Alex to interpret and critique.
- Voice-to-Voice Socratic Mode: Integrating low-latency audio streaming for real-time oral teaching simulations.
- Classroom Dashboards: Enabling STEM educators to assign topics and view students' misconception-resolution rates across entire cohorts.
Log in or sign up for Devpost to join the conversation.