AI Tutor & Mobile AI Mentor Architecture
LearnWay distinguishes between two complementary AI personas:- The In-Lesson AI Tutor: A micro-contextual teaching assistant embedded into every lesson slide.
- The Mobile AI Mentor: A persistent companion guiding long-term career growth, consistency, and skill milestones.
1. In-Lesson AI Tutor
The AI Tutor is designed for immediate, zero-friction help while a learner is actively consuming a lesson.Preset Interaction Modes
Learners can choose predefined one-tap prompts or submit custom questions:System Prompt & Context Assembly
The AI Tutor enforces strict guardrails directly in the Gemini system instruction:Response Caching Strategy
Because many students ask identical preset questions (explain_simply, summarize) on standard lessons, responses are deterministically cached in Redis with a 24-hour TTL:
- Preset Prompts: 100% cache hit rate for subsequent learners, reducing Gemini API costs to near zero and delivering
< 15msresponse times. - Custom Questions: Bypasses the preset cache, performs profanity and rate-limit checks, calls Gemini Flash with a 5000ms race timeout, and logs to
ai_analytics_logs.
2. Mobile AI Mentor
The AI Mentor is a persistent, motivational guide residing on the mobile client. It understands the student’s broader journey, course progress, daily streaks, and career aspirations.Strict Course Catalog Guardrail
To prevent the model from inventing imaginary topics or external university curricula, the mentor prompt is injected with the verified LearnWay course catalog as its single source of truth:The Foundation-First Rule
Regardless of whether a student’s long-term goal is AI Engineering, Blockchain, or Web Development, the AI Mentor enforces that all foundational tracks must be completed before specialized elective tracks are unlocked:Journey Telemetry & Scoring
The AI Mentor computes structured diagnostic scoring for every learner:- Consistency Score (
0-100): Evaluates streak stability, weekly active days, and learning cadence. - Engagement Score (
0-100): Tracks quiz battle participation, lesson completion velocity, and interactive exercises. - Employability Score (
0-100): Measures practical project completions, capstone submissions, and verified certificates. - Actionable Next Steps: Generates 3 prioritized next actions directly linked to concrete lessons in the catalog.