Inspiration
Traditional tutoring is expensive ($30-$80/hour), making personalized academic guidance unavailable to millions of students, particularly in underserved regions and non-English speaking communities. Meanwhile, modern AI shortcuts like photo-solvers often bypass learning entirely by displaying instant answers without explaining why or how. We were inspired to build a tutor that refuses to give away final answers outright, but instead asks guiding questions, emulating the Socratic Method used by the best human educators.
What it does
AndaaTutor is a 24/7 personal Socratic AI STEM tutor in your pocket. It breaks down complex math, physics, linear algebra, and coding problems into manageable step-by-step interactive micro-lessons. Key capabilities include:
- Interactive Socratic Dialogue: Never reveals the direct answer upfront; leads students through targeted prompts, hints, and error verification.
- MathJax & LaTeX Rendering: Beautifully renders complex formulas like logarithms $\log_3\left(\frac{x^2}{x+6}\right) = 1$, quadratic equations $x = \frac{-b \pm \sqrt{\Delta}}{2a}$, and matrices in real time.
- Native Bilingual Tutor: Instant switching between English and French with localized mathematical idioms and pedagogical styles.
- Quick Action Chips: One-tap triggers for "Indice SVP" (Hint please), "Détailler" (Elaborate), and "Étape suivante" (Next step).
- Offline Local Storage & Play Billing: Local Room persistence for full session history and Google Play Billing for Pro tier subscriptions and credit refills.
How we built it
AndaaTutor was built from the ground up as a modern, reactive Android app using Kotlin and Jetpack Compose following Clean Architecture and MVVM patterns:
- UI Layer: Jetpack Compose with Material Design 3, custom edge-to-edge screens, dynamic animations, and custom markdown rendering supporting mathematical LaTeX equations via native MathJax WebViews.
- Network & AI Engine: OkHttpClient streaming Server-Sent Events (SSE) connected to Google’s Agent Platform API and Gemini API endpoints (
gemini-2.5-flash,gemini-2.5-pro,gemini-3.6-pro). - Persistence & State: Room Database with KSP for offline chat logs, local user state, and seamless device synchronization via Firebase Firestore.
- Security & Monetization: Encrypted secrets via BuildConfig, modularized API error boundaries, and Google Play Billing Library for subscription tiers and consumable AI credits.
Challenges we ran into
- Socratic Guardrails: Instructing LLMs to strictly withhold direct final answers required meticulous prompt engineering. For instance, when solving quadratic equations: $$\Delta = b^2 - 4ac$$ $$x = \frac{-b \pm \sqrt{\Delta}}{2a}$$ The AI must check student inputs at each stage (e.g., computing $\Delta = (-14)^2 - 4(3)(5) = 136$) rather than revealing $x_1 = \frac{7 + \sqrt{34}}{3}$ immediately.
- Real-time LaTeX Rendering in Chat Streams: Streaming SSE chunks containing partial LaTeX blocks (like
\log_3\left(\frac{x^2}{x+6}\right) = 1) required smooth incremental parser buffering to prevent UI flickering during active AI generation. - Resilient API Fallbacks: Engineering multi-candidate model retries (
gemini-2.0-flash$\rightarrow$gemini-1.5-flash$\rightarrow$gemini-1.5-pro) and informative error propagation when network connectivity drops or API keys are misconfigured.
Accomplishments that we're proud of
- True Pedagogical Guardrails: Successfully building an AI model interaction layer that reliably avoids answer-dumping and maintains empathetic Socratic tutoring across bilingual sessions.
- Flawless SSE LaTeX Streaming: Streaming complex mathematical expressions and rendering them seamlessly in Jetpack Compose without lag or UI glitches.
- Production-Grade Native Android Polish: Building an ultra-responsive M3 UI complete with custom adaptive app icon, onboarding flows, Google Play Billing, and local Room persistence.
- Bilingual Equity: Achieving total feature parity between English and French curricula to empower students across developing regions.
What we learned
- Prompt Architecture for Education: How to engineer system instructions with strict temperature controls ($0.4$) to maximize logical and mathematical accuracy while preserving a warm, encouraging tone.
- Incremental Stream Parsing: Techniques for chunk-buffering partial Markdown and LaTeX markup during live Server-Sent Events streams in Kotlin Coroutines.
- Designing AI-Native Mobile UX: That mobile AI experiences are vastly improved when pairing open chat text fields with adaptive micro-action chips ("Give a hint", "Break down step") to reduce student typing friction.
Log in or sign up for Devpost to join the conversation.