$AI Income Hub
HomeAI StartupSaaS AI Tutoring Platform
AI Startup

Building an AI Tutoring SaaS Platform

Building a specialized AI tutoring SaaS that uses DAG-based curricula and diagnostic assessments to ensure conceptual mastery over rote memorization.

Building an adaptive learning SaaS using Directed Acyclic Graphs for curriculum generation

To build an adaptive EdTech platform that moves beyond passive video consumption, you must replace linear course lists with a Directed Acyclic Graph (DAG) of prerequisite concepts. Instead of a user clicking "Next Video," the system evaluates mastery through diagnostic practice and only unlocks the next node in the graph when a conceptual threshold is met. This approach uses LLMs to decompose a learning objective into a dependency map, then employs specialized agents to act as tutors, testers, and evaluators.

Who is this architecture for and what does it cost to ship?

  • Development Time: 3 to 5 months for a solo engineer to build the DAG engine, the code execution sandbox, and the diagnostic feedback loop.
  • LLM API Costs (OpenAI GPT-4o / Anthropic Claude 3.5 Sonnet): $0.05 – $0.20 per user session, depending on the complexity of the diagnostic reasoning and the depth of the curriculum generation.
  • Infrastructure: $100 – $300/month for hosting, including sandboxed environments (like Piston or E2B) for running user code in the browser.
  • Total Initial Capital: $5,000 – $15,000 if outsourcing specific components like UI/UX or specialized backend modules on Upwork.

Results vary wildly based on your ability to prompt the "Evaluator" agent to distinguish between a typo and a conceptual misunderstanding.

How do you generate a non-linear curriculum?

The core failure of most EdTech is the "list of videos" format. To fix this, you use an LLM to transform a high-level goal (e.g., "Understand Linear Algebra for Machine Learning") into a structured JSON object representing a DAG. Each node in this graph represents a discrete concept.

Step 1: Deconstruction
Use GPT-4o to ingest the learning objective. Instruct the model to identify the "atomic concepts" required. You must enforce a schema where each concept has a unique ID and a list of `prerequisite_ids`. For example, you cannot teach "Matrix Multiplication" without first passing "Scalar Multiplication" and "Vector Addition."

Step 2: Node Content Generation
For each node, trigger a secondary agent to generate three components:

  1. Theory: A concise explanation of the concept.
  2. Practice: An interactive task (e.g., a coding challenge or a math problem).
  3. Diagnostic Metadata: A list of common "wrong paths." For example, if the concept is "Loops in Python," a wrong path might be "Off-by-one errors" or "Infinite loops due to incorrect incrementing."

Step 3: Graph Traversal
The frontend should not show a timeline. It should show a map. The user starts at the "Root" nodes (concepts with zero prerequisites). As they master nodes, the edges to the next nodes turn from grey to active.

How do you implement diagnostic mastery instead of pass/fail?

A "Pass/Fail" metric is useless for adaptive learning because it doesn't tell the student why they failed. To implement a true diagnostic loop, you need an "Evaluator" agent that analyzes the user's attempt, not just the final answer.

Step 1: The Input Capture
Capture the user's full work. If it is a coding task, capture the code and the terminal output. If it is mathematics, capture the step-by-step derivation. Use an execution sandbox like E2B (version 0.12+) to run the code safely in an isolated environment.

Step 2: The Error Analysis
Instead of checking `if answer == correct`, send the user's work and the correct answer to a Claude 3.5 Sonnet instance. Use a prompt that specifically asks: "Identify if this error is a syntax error (low level) or a conceptual misunderstanding (high level)."

Step 3: The Feedback Loop
If the error is conceptual, the system should not move to the next node. Instead, it should trigger a "Remediation Sub-node." This is a temporary node in the DAG that re-explains the specific sub-concept the user missed. Only after the user demonstrates mastery of the sub-node does the main curriculum resume.

Where did the logic break during my implementation?

The biggest failure I encountered was "Graph Bloat." When I first tried to let the LLM generate the entire curriculum in one go, the graph became massive, redundant, and logically inconsistent. The model would suggest a concept as a prerequisite for something else, but then fail to include that prerequisite in the main tree. This left users in a "dead end" where they couldn't progress because the required node didn't exist.

To fix this, I had to implement a two-pass validation:

  1. Pass 1: Generate the concept list and dependencies.
  2. Pass 2: Run a Python script (using the NetworkX library) to check for cycles and orphaned nodes. If the graph is not a valid DAG, the system must re-prompt the LLM to fix the specific broken connection.

Another failure was "LLM Hallucination in Evaluation." In early versions, the AI would occasionally tell a user they were correct when they were actually wrong, simply because the user's code "looked" like the correct structure. I solved this by forcing the Evaluator to cite specific lines of code or specific mathematical steps as evidence for its verdict.

How does this differ from standard LMS platforms?

Most developers try to build an "AI-powered LMS" (Learning Management System). That is the wrong target. An LMS is a container for content; an adaptive tutor is a reasoning engine.

  • Structure:
    LMS uses linear sequences (Module 1 → Module 2) → Adaptive Tutor uses DAGs (Concept A + Concept B → Concept C).
  • Assessment:
    LMS uses multiple-choice quizzes → Adaptive Tutor uses diagnostic error analysis and "Viva" style oral reasoning.
  • Content:
    LMS relies on static assets (Videos/PDFs) → Adaptive Tutor relies on dynamic, generated content that adjusts to the user's level.

When should you NOT use this method?

Do not use this architecture if you are building a platform for "Soft Skills" or "General Knowledge." If the goal is to teach "How to be a better manager" or "World History," the concept dependencies are too fuzzy to map into a reliable DAG. The cost of generating and validating the graph will outweigh the value. This method is strictly for hard sciences and technical skills where the prerequisite chain is mathematically or logically provable.

#SaaS#EdTech#AI Tutoring#B2C