Inspiration

We started from a simple observation: most study tools still rely on the debunked "learning styles" myth — the idea that labeling someone as "visual" or "auditory" improves outcomes. Decades of research, including Pashler et al. and the EEF's metacognition guidance, show that effective adaptation comes from demonstrated performance, not self-reported preferences. We wanted to build something that actually works: an AI tutor that learns from what you know, not how you click.

What it does

CogniPath generates short AI-powered lessons and quizzes on any topic, then adapts based on real performance:

  • Adaptive lesson generation — AI creates explanations, key points, and examples tailored to the current difficulty level.
  • Adaptive quizzes — 3–7 questions per quiz; count and difficulty adjust based on content and past performance.
  • Spaced review — incorrect answers are scheduled for future review using an SM-2-inspired algorithm with dynamic intervals.
  • Privacy-first design — server-held answer keys, AI disclosure on every lesson, privacy consent, data export, and learning-data deletion.
  • Resilient AI layer — circuit breaker, multi-model failover across OpenRouter free models, and graceful fallbacks when the gateway is rate-limited.

The entire app runs as a single Inertia SPA: Laravel 13 on the backend, React 19 + TypeScript on the frontend, Tailwind 4 for styling.

How we built it

  • Stack: React 19 + Inertia 3 + Laravel 13 + Tailwind 4 (RILT). No separate API layer — controllers return Inertia::render() directly to React components.
  • AI: laravel/ai SDK routed through OpenRouter's openai-compatible driver. We verified 18 free models and selected 4 reliable failover models for content, quizzes, and grading.
  • Adaptation: DifficultyEstimator uses a weighted moving average of recent quiz performance to adjust per-topic difficulty. ReviewScheduler implements SM-2 with ease factors, interval growth, and relearning triggers.
  • Security/Privacy: Answers are never sent to the browser before submission. AI content is labeled as machine-generated. Privacy consent, export, and deletion endpoints are built in.
  • Testing: Pest for backend logic; Playwright MCP for end-to-end verification of auth, onboarding, topic creation, lesson generation, quiz submission, and review flow.

Challenges we ran into

  • AI reliability: Free OpenRouter models are rate-limited and occasionally return empty or non-JSON responses. We solved this with a circuit breaker (5 strikes → 60s cooldown), 4-model failover, and safe placeholder content so the UI never hard-crashes.
  • Assessment integrity: Early versions sent answer keys to the frontend. We moved all correct answers server-side, normalized client inputs before scoring, and validated every generated question schema.
  • Review scheduling: Nothing created ReviewItem records at first, and the scheduler ignored due_at for reviewed items. We backfilled review state from existing sessions and rewrote the scheduler to respect SM-2 intervals.
  • Model routing: The generic openrouter/free router sometimes dispatched to content-safety classifiers instead of chat models. We pinned the app to verified working free models after testing each candidate directly against the OpenRouter API.

Accomplishments that we're proud of

  • A complete, working study loop: topic → lesson → quiz → review, with no behavioral profiling.
  • Server-held answer keys and full submission validation — no peeking at answers before submit.
  • Spaced review that actually schedules and updates items based on recall.
  • Circuit breaker + multi-model failover that keeps the app usable even when free models misbehave.
  • Privacy controls baked in from the start: consent, export, and deletion.
  • All tests pass, and the core flows are verified with Playwright end-to-end.

What we learned

  • Evidence beats hype. Learning-style personalization is a persistent myth; performance-based adaptation is both simpler to implement and more defensible.
  • Free AI is free for a reason. Rate limits, empty responses, and model misclassification are daily realities. Building resilience into the service layer — circuit breakers, failover, caching, fallbacks — is non-negotiable.
  • Inertia 3 is a sweet spot. Sharing one Laravel + React codebase without a separate API layer kept development fast while preserving a modern SPA feel.
  • Security is a feature, not an afterthought. Holding answer keys server-side and showing AI disclosure upfront builds trust and prevents whole categories of bugs.

What's next for CogniPath - AI Educational Tool

  • Offline demo mode — pre-generated content seeded via laravel/ai fakes so the app works without live API access during presentations.
  • Richer diagnostics — confidence ratings, misconception tracking, and per-concept mastery maps instead of single scalar scores.
  • Real-time collaboration — study rooms with shared quizzes and review sessions via Laravel Reverb/WebSockets.
  • Mobile PWA — installable homescreen app with push notifications for review reminders.
  • More providers — extend laravel/ai configuration to support additional free-model catalogs and local LLM backends.

Built With

Share this project:

Updates

Submission history