MedhaSpark AI: Personalized Learning with AI-Powered Tutoring
Discover MedhaSpark AI, an open-source platform for personalized learning roadmaps, spaced repetition flashcards, and AI-powered educational content.
VERSION 3.0 | POWERED BY CEREBRAS AI
MedhaSpark AI
Supercharge Your Learning Journey with an AI-Powered Personalized Tutor
Personalized Roadmaps
Spaced Repetition
Multi-AI Fallback
MIT Licensed β’ Open Source
THE PROBLEM
The Learning Crisis
β
Students lack personalized learning paths
β οΈ
Generic courses ignore individual pace & gaps
β
Information overload with no structured progression
β οΈ
No smart repetition β knowledge fades quickly
β
Traditional education is one-size-fits-all
THE SOLUTION
MedhaSpark AI
Your Personal AI Tutor
MedhaSpark AI generates personalized learning roadmaps, spaced-repetition flashcards, AI-powered quizzes, and intelligent content analysis for ANY topic β adapting dynamically to YOUR unique learning style, pace, and knowledge gaps.
πΊοΈ
Personalized Roadmaps
π
Smart Flashcards
π§©
Adaptive Quizzes
π¬
AI Content Analysis
CORE FEATURES
7 Powerful Features
πΊοΈ
#3776AB
AI Learning Roadmaps
π
#7C3AED
Spaced Repetition Flashcards
π§©
#06B6D4
AI-Powered Quizzes
π¬
#4F46E5
AI Studio
πΈοΈ
#8B5CF6
Conceptual Weaver
π§
#3776AB
Cognitive Load Modulator
π
#475569
Secure Multi-Auth System
FEATURE 01
AI-Generated Learning Roadmaps
Input any topic β get a structured hierarchical learning path
Create from syllabus text or upload files (.txt, .pdf, .docx)
Auto-generates explanations, YouTube videos & exercises per subtopic
Web-enhanced: enriches content with live search results
Track progress: Not Started β In Progress β Completed
ROADMAP FLOW
How Roadmaps Work
π
Topic Input
π€
AI Structure Generation
π
Subtopic Content
Explanations + Videos + Exercises
π
Web Enhancement
Optional live search enrichment
π
Progress Tracking
Not Started β In Progress β Done
Powered by Cerebras AI (2100 tok/s)
FEATURE 02
Spaced Repetition Flashcards
Create manually or AI-generate from any text
SM-2 algorithm optimizes review intervals for maximum retention
Quality ratings (0β5) dynamically adjust ease factor & scheduling
Due date management ensures reviews happen at the right time
Linked to roadmap items and topics for learning context
EF' = EF + (0.1 - (5-q)(0.08 + (5-q)Γ0.02))
FEATURE 03
AI-Powered Quizzes
Two modes: Multiple-Choice (4 options) & Fill-in-the-Blank
Generated from YOUR learning content for maximum relevance
Automatic grading with detailed score tracking
Full question history stored for later review
Powered by Cerebras AI at 2100 tokens/second
π―
π€
β
π
β‘
Which of the following neural network architectures is primarily used for sequence-to-sequence tasks like language translation?
Convolutional Neural Networks (CNN)
Transformer Networks
Generative Adversarial Networks (GAN)
Multilayer Perceptrons (MLP)
FEATURE 04
AI Studio
Comprehensive Text Analysis
Paste any text β get instant summary & key concept extraction
ELI5 mode: Explain Like I'm 5 for instant simplification
Analogy generation for complex & abstract topics
Mermaid diagram generation for visual learners
Context-aware Q&A on your analyzed content
FEATURE 05
Conceptual Weaver
Connect New to Known
πΈοΈ
Analyzes new text and maps concepts to YOUR existing knowledge
π
Pulls context from your personal roadmaps and flashcards
π
Generates 'knowledge bridges' explaining new β known connections
πΊοΈ
Builds a personalized knowledge graph over time
π
The more you learn, the smarter the connections become
FEATURE 06
Cognitive Load Modulator
Adaptive Learning Made Easy
Breaks complex content into bite-sized digestible chunks
Simplifies for different audience levels: Beginner β Expert
Dynamically identifies prerequisite concepts
Adds reflection prompts, summaries & visual diagrams
Suggests video topics for visual reinforcement
System Architecture
TECH ARCHITECTURE
HTML/CSS/JS + Jinja2 Templates
FastAPI (Async Python)
AI Providers: Cerebras / Groq / Gemini
External APIs: YouTube + Serper + Tavily
SQLAlchemy Async ORM β PostgreSQL (prod) / SQLite (dev)
Firebase Admin SDK + Google OAuth + JWT
AI PROVIDER SYSTEM
Multi-AI Fallback Architecture
API Request
π Cerebras AI
PRIMARY
2100 tok/s
β‘ Groq
FALLBACK
π€ Gemini
FALLBACK
β Response
FAILOVER
β±οΈ
Auto-failover on rate limits
π§
In-memory cooldown tracking
π
OpenAI-compatible API format
π¦
Cerebras SDK + HTTP fallback
TECH STACK
Technology Stack
βοΈ Backend
π Auth & Security
π Infrastructure
π€ AI / ML
π§° Utilities & Extras
Python 3.10+
FastAPI
SQLAlchemy 2.0 (async)
PostgreSQL
SQLite
Firebase Admin SDK
Google OAuth
JWT (python-jose)
bcrypt
Render.com
Gunicorn
Uvicorn
Health Checks
Cerebras AI
Groq
Gemini
httpx
cerebras_cloud_sdk
BeautifulSoup4
pypdf
python-docx
Mermaid.js
YouTube API
Serper API
Tavily API
DATABASE DESIGN
Data Models
π€
User
> id > email > firebase_uid > profile
πΊοΈ
LearningRoadmap
> topic > json_structure > content
π
Flashcard
> ease_factor > interval_days > due_at
π
QuizAttempt
> quiz_data > score > timestamp
π
Topic
> title > description > user_id
πΎ
SavedResource
> url > type > topic_id
π‘
CodingSuggestion
> code > language > context
π
UserActivityLog
> action > timestamp > metadata
π
UserNote
> content > roadmap_id > created_at
9
Core Models
Async SQLAlchemy 2.0
SECURITY
Security & Best Practices
XSS, clickjacking & MIME sniffing prevention headers
SSRF protection: URL validation + private IP blocking
CORS restricted to known origins β no wildcard + credentials
JWT with configurable expiration + bcrypt password hashing
Environment validation at startup with clear error reporting
Security headers middleware applied on every single response
DEPLOYMENT
Production Deployment
Deployed on Render.com (Python runtime)
Gunicorn + Uvicorn workers for async production serving
PostgreSQL via Aiven with SSL certificate support
Health check endpoint at /health
Environment-based config: development vs production
Auto-generated API docs at /docs (dev only)
Internet
Render.com
Gunicorn + Uvicorn
FastAPI App
Aiven PostgreSQL
API REFERENCE
RESTful API β 25+ Endpoints
π AUTH ENDPOINTS
/register
/token
/auth/google
/auth/firebase/token
π€ USERS ENDPOINTS
/users/me
/users/me/focus
/users/me/stats
πΊοΈ ROADMAPS ENDPOINTS
/roadmaps
/roadmaps/from-syllabus
/roadmaps/from-file
/roadmaps/{id}
π FLASHCARDS ENDPOINTS
/flashcards
/flashcards/review
/flashcards/due
/flashcards/count
π€ AI ENDPOINTS
/ai/explain-topic
/ai/generate-flashcards
/ai/generate-quiz
π¬ ADVANCED AI ENDPOINTS
/ai-studio/analyze
/conceptual-weaver/analyze
/cognitive-modulator/analyze
25+ endpoints β’ Full OpenAPI docs β’ JWT authenticated
PROJECT STRUCTURE
Modular Codebase
Clean separation of concerns
medhaspark-ai/
Settings & env config
Database, auth, security
API endpoint handlers
Business logic layer
Helper functions
Jinja2 templates
CSS, JS, images
App entry point
ποΈ
Layered Architecture
Clear separation between routing, logic, and data access layers.
π
Dependency Injection
Enhances testability and promotes loose coupling between components.
β‘
Async First
Leverages non-blocking I/O for high-performance concurrent processing.
π
Security by Default
Built-in protection against vulnerabilities with strict validation guidelines.
π
Type-Safe APIs
Ensures strictly typed data exchange with comprehensive schemas.
π§ͺ
Environment Aware
Seamless configuration management across local, dev, and production.
MedhaSpark AI
Learn Smarter, Not Harder
Built with β€οΈ for learners everywhere
7
AI Features
25+
API Endpoints
9
Data Models
3
AI Providers
MIT
Licensed
github.com/yourusername/Medha-Spark-AI
β Contributions Welcome!
v3.0
- ai-tutoring
- personalized-learning
- educational-technology
- open-source
- spaced-repetition
- fastapi
- artificial-intelligence