AI Transforms LMS: Towards Customized Learning
Le brief IA que les pros lisent chaque soir
Les 7 actus IA du jour, décryptées en 5 min. Gratuit.
Inclus dès l'inscription : notre sélection des meilleurs guides & comparatifs IA.
Choisis ton rythme
Gratuit · Pas de spam · Désabonnement en 1 clic
Imagine signing up for an online course, going through 40 slides, passing a quiz for which you searched the answers on Google, and receiving a certificate. Did you actually learn anything? This is the reality of most online learning platforms today. They track clicks, not comprehension. They measure completion, not capability.
The good news? Artificial intelligence has made it possible to create learning systems that truly adapt to each individual. Systems that know what you already understand, identify where you struggle, and guide you toward mastery rather than just crossing the finish line.
In this tutorial, you will learn how to build an AI-powered Learning Management System (LMS) from scratch. We will use free and open-source tools — no need for expensive API subscriptions. By the end, you will have a functional system with four smart features:
- A learning path that adjusts to each learner
- AI-generated quizzes
- A live chat tutor powered by a local language model
- A dashboard that tracks actual progress
You can clone the complete project repository here and don’t forget to give it a star!
What is an AI-powered LMS?
A Learning Management System (LMS) is software that delivers, manages, and tracks educational content. Traditional examples include Moodle, Canvas, and Blackboard.
An AI-powered LMS goes further. Instead of showing the same content to every learner in the same order, it uses artificial intelligence to:
- Personalize the learning sequence based on what a learner already knows
- Dynamically generate assessments rather than drawing from a fixed question bank
- Answer questions in plain language via a conversational tutor
- Analyze performance data to highlight weaknesses and suggest next steps
Think of it as the difference between a textbook and a private tutor. The textbook provides the same content to everyone. A tutor adjusts in real-time.
Why are traditional LMS platforms insufficient?
Before building something better, it’s important to understand why existing platforms struggle.
-
Standardized content: Most LMS platforms push everyone through the same content in the same order. A senior developer taking a beginner Python course wastes time on concepts they already know. A complete beginner in an advanced course gets lost immediately.
-
Static question banks: Pre-written quiz questions are shared online within days of a course launch. Learners memorize answers rather than understanding concepts. Assessment becomes meaningless.
-
No real-time support: When a learner is stuck at 11 PM, there’s no instructor to ask. They either give up or move on without understanding the material, leading to bigger problems later.
-
Vanity metrics rather than actual learning: Completion rates are easy to inflate. Progress bars and checkmarks seem gratifying but do not measure whether knowledge has actually been transferred.
These are not minor issues. According to research from the Institute of America, learners retain only 8 to 10% of the content delivered by traditional e-learning. This figure rises to 25 to 60% with active and personalized learning methods. Our AI-powered LMS is designed to bridge this gap.
The tech stack we are using
We built this system entirely with open-source tools, meaning you can run it on your own machine at no cost.
- Ollama + Mistral 7B: Runs the language model locally
- FastAPI (Python): API routes and WebSocket tutor
- In-memory (Python dictionary): Learner profiles and progress
Ollama allows you to download and run open-source language models directly on your computer. You don’t need a cloud account, API key, or usage fees. You simply pull a model and call it via a local HTTP endpoint. It supports models like Mistral, LLaMA 3, and Phi-3.
Why Mistral 7B?
Mistral 7B is a small yet capable model that works well on most modern laptops. It accurately follows instructions, produces clean JSON output, and reliably handles conversational Q&A — exactly what our four modules need.
FastAPI is a modern Python web framework designed for speed. It natively supports asynchronous code and WebSockets, which is important for streaming tutor responses live to the browser.
Step 1: Adaptive learning path
The problem it solves: A beginner and an experienced developer signing up for the same Python course should not follow the same path. The adaptive learning module reads each learner's knowledge profile and builds a personalized sequence.
When a learner enters their learning goal, the system sends a prompt to Mistral that includes:
- The learner's mastery scores by subject (stored from previous quiz results)
- A list of all available course modules with their difficulty levels
- A set of rules: skip mastered topics, prioritize weak areas, respect the order of difficulty
Mistral responds with an ordered list of module IDs — the learner's personalized path.
Simplified example of main.py:
You are a curriculum expert. Return a JSON array of node IDs in the best learning order for this learner. Goal: {req.goal} Mastery scores: {profile["mastery"]} Completed modules: {profile["completed"]} Available modules: {nodes_summary} - Skip completed modules - Prioritize weak areas - Order from easiest to hardest - Return ONLY a JSON array, no explanation.
The path is not fixed. Each time a learner completes a quiz, their mastery scores update and the path recalculates. A learner who suddenly performs well receives advanced material sooner. A learner who is struggling is redirected to foundational content.
What the learner sees
In the Learning Path tab, learners enter their goal (e.g., "Learn Python for data science") and click Generate Path. Within seconds, a personalized sequence of modules appears, each with its topic, difficulty level, and buttons to access a quiz or the AI tutor directly.
Step 2: AI-generated quizzes and assessments
The problem it solves: Static quiz banks quickly become outdated. Learners share answers, memorize without understanding, and still pass. AI-generated quizzes are different each time, making it impossible to cheat without actually learning.
When a learner requests a quiz for a module, the backend retrieves the course content for that module and sends it to Mistral with a strict instruction to return a structured JSON quiz.
Simplified example of main.py:
Based on the following course content, generate 3 multiple-choice questions. Topic: {node["title"]} Content: {node["content"]} Return ONLY a valid JSON in this format: "question": "...", "options": ["A) ...", "B) ...", "C) ...", "D) ..."], "explanation": "Short reason why this is correct."
Each quiz request produces a new set of questions drawn from the actual course material. Learners receive different questions on retries, reinforcing learning through varied exposure.
Assessment and feedback
After submission, each incorrect answer comes with an explanation — not just a red ✗. This matters. Research in cognitive science consistently shows that explanatory feedback promotes deeper retention than merely marking answers as correct or incorrect (Hattie & Timperley, 2007). A score of 75% or higher marks the module as complete and unlocks the next steps in the learning path.
Step 3: The AI tutor in natural language
The problem it solves: Being stuck is the number one reason learners drop out of online courses. Without someone to ask, a small moment of confusion becomes a wall. The AI tutor removes that wall — available 24/7, infinitely patient, and always grounded in the actual course content.
The tutor operates via a WebSocket connection — a persistent two-way channel between the browser and the backend. This allows the AI's response to come back to the user word by word, as if it were being typed, rather than making the learner wait for a full response to load.
The tutor uses a technique called Retrieval-Augmented Generation (RAG). Before responding, it pulls relevant course content into the prompt as context. This anchors Mistral's responses in the actual course material rather than general knowledge, reducing the risk of incorrect or irrelevant answers.
Simplified prompt structure:
You are a concise and helpful programming tutor. Respond based on the context below. If the answer is not in the context, say so and provide a general answer. Course context: {node_content} Conversation history: {conversation_history} Learner: {user_message}
The conversation history is included in each message, so the tutor remembers what has been said earlier in the same session, making the conversation natural rather than repetitive.
What the learner sees
In the AI Tutor tab, learners see a familiar chat interface. They type a question, hit Enter, and watch the response stream in word by word. If they navigate from a specific module, the tutor is already aware of that module's content as context.
Step 4: Progress tracking and analytics
The problem it solves: Most dashboards show you a percentage bar that fills up as you click through content. This is not a measure of learning; it’s a measure of clicks. Our dashboard tracks mastery by subject, built from actual quiz performance over time.
Each quiz submission triggers two things:
-
Update of mastery score using an Exponential Moving Average (EMA)
New mastery = 30% of recent score + 70% of historical mastery new_mastery = 0.3 * quiz_score + 0.7 * current_masteryThe Exponential Moving Average gives more weight to recent performance while considering history. A learner who has consistently struggled but recently improved will see their mastery score rise, but not instantaneously from a single good result. This makes the metric honest.
-
Progress event recorded: Every action — from starting a module to submitting a quiz, to passing or failing — is logged with a timestamp. This creates a comprehensive record of learning activity that feeds into the dashboard.
What the learner sees
The Dashboard tab displays:
- Modules completed out of the total available
- Completion rate as a percentage
- Average mastery across all subjects studied
- Mastery bars by subject — color-coded green (strong), yellow (medium), and red (weak) to indicate skill levels. Learners can thus see at a glance where they excel and where they need to improve.
This AI-powered Learning Management System represents a significant advancement in personalizing online education. By adapting content to individual learners' needs, providing dynamic assessments, and offering constant support, it promises to transform the way we approach digital learning.
Brief IA — L'actualité IA en français
L'essentiel de l'actualité de l'intelligence artificielle, décrypté et expliqué chaque jour.