karthik.dev
Back to blogAI Engineering

LearnOS AI: Building a Personalized AI Learning Operating System

2026-07-28 · 5 min read

The Problem with Generic Learning Platforms

Udemy, Coursera, YouTube — they all offer the same content to everyone. Whether you're a Java developer trying to transition to AI engineering or a fresh graduate targeting a backend role, you get the same Python Beginner course.

What learners actually need is a personalized path that answers: "Given my background and my target role, what do I learn next, in what order, building what projects?"

LearnOS AI is my answer to that question.

What "Learning OS" Means

An OS manages resources and coordinates processes. A Learning OS manages a learner's knowledge resources (what they know and don't know) and coordinates the learning process (what to study, when, how to practice).

LearnOS AI has four subsystems:

  1. Roadmap Generator — sequences milestones based on background and target role
  2. Project Recommender — suggests hands-on projects matched to roadmap stage
  3. Workspace Generator — creates a guided coding environment for each project
  4. Interview Preparation Track — generates role-specific questions and model answers

The Roadmap Generator

The hardest part was generating roadmaps that are genuinely personalized rather than generic. The key: inject learner context directly into the generation prompt.

async function generateRoadmap(learner: LearnerProfile): Promise<Roadmap> {
  const prompt = `
    You are a senior engineering mentor creating a personalized learning roadmap.
    
    Learner Background:
    - Current role: ${learner.currentRole}
    - Years of experience: ${learner.yearsOfExperience}
    - Current skills: ${learner.skills.join(", ")}
    - Strongest areas: ${learner.strongAreas.join(", ")}
    - Known gaps: ${learner.gapAreas.join(", ")}
    
    Target Role: ${learner.targetRole}
    Target Timeline: ${learner.timelineWeeks} weeks
    Hours per week available: ${learner.hoursPerWeek}
    
    Create a week-by-week learning roadmap with:
    - Specific topics to study each week
    - A concrete project to build that week
    - Resources (book chapters, docs, tutorials)
    - A mini-assessment to confirm understanding before moving on
    
    Return as JSON: { weeks: [{ week, topic, project, resources, assessment }] }
  `;
  
  const response = await openai.chat.completions.create({
    model: "gpt-4o",
    messages: [{ role: "user", content: prompt }],
    response_format: { type: "json_object" },
  });
  
  return JSON.parse(response.choices[0].message.content!);
}

The JSON schema enforcement (response_format: json_object) is critical — it prevents the LLM from returning a formatted narrative instead of a structured roadmap.

Project Recommender

Projects are matched to roadmap stage. A week-3 learner building their first REST API gets a different project than a week-8 learner adding authentication:

async function recommendProject(
  week: number,
  topic: string,
  learnerBackground: LearnerProfile,
): Promise<Project> {
  const prompt = `
    Recommend a hands-on project for:
    - Week ${week} of the learning roadmap
    - Topic: ${topic}
    - Learner's background: ${learnerBackground.currentRole}, ${learnerBackground.yearsOfExperience} years
    
    The project should:
    - Be completable in ${learnerBackground.hoursPerWeek} hours
    - Directly apply the topic concepts from this week
    - Build on skills from previous weeks
    - Have clear success criteria
    
    Return as JSON: { name, description, steps, successCriteria, estimatedHours }
  `;
  // ...
}

AI Workspaces

Each workspace is a guided coding environment pre-configured for the project. Instead of a blank editor, the learner gets:

  • A repository scaffold with the relevant files
  • Inline documentation explaining each file's role
  • Guided TODO comments at each implementation step
  • A test suite that passes when the implementation is correct
async function generateWorkspace(project: Project): Promise<Workspace> {
  // Generate file structure
  const scaffold = await generateScaffold(project);
  
  // Add guided TODOs to each implementation file
  const guidedFiles = await Promise.all(
    scaffold.implementationFiles.map(async (file) => ({
      ...file,
      content: await addGuidedTodos(file, project),
    }))
  );
  
  // Generate test suite
  const tests = await generateTests(project, scaffold);
  
  return { files: guidedFiles, tests, instructions: project.steps };
}

Interview Preparation Track

At the end of the roadmap, the interview prep track generates role-specific questions:

async function generateInterviewTrack(targetRole: string, roadmap: Roadmap): Promise<InterviewTrack> {
  const coveredTopics = roadmap.weeks.map(w => w.topic).join(", ");
  
  const prompt = `
    Generate an interview preparation track for: ${targetRole}
    
    Topics covered in the learning roadmap: ${coveredTopics}
    
    Create 20 interview questions covering:
    - Technical fundamentals (5 questions)
    - System design (5 questions)
    - Coding problems aligned to topics covered (5 questions)
    - Behavioral questions for the target role (5 questions)
    
    For each question, provide: question, difficulty, expected answer, common mistakes, follow-up questions.
    
    Return as JSON: { questions: [...] }
  `;
  // ...
}

PostgreSQL Schema

CREATE TABLE learners (
    id UUID PRIMARY KEY,
    email TEXT UNIQUE NOT NULL,
    current_role TEXT,
    target_role TEXT,
    years_experience INTEGER,
    created_at TIMESTAMPTZ DEFAULT NOW()
);

CREATE TABLE roadmaps (
    id UUID PRIMARY KEY,
    learner_id UUID REFERENCES learners(id),
    generated_at TIMESTAMPTZ DEFAULT NOW(),
    timeline_weeks INTEGER,
    content JSONB NOT NULL  -- stores the full generated roadmap
);

CREATE TABLE progress (
    learner_id UUID REFERENCES learners(id),
    roadmap_id UUID REFERENCES roadmaps(id),
    week INTEGER,
    status TEXT CHECK (status IN ('not_started', 'in_progress', 'completed')),
    completed_at TIMESTAMPTZ,
    PRIMARY KEY (learner_id, roadmap_id, week)
);

GitHub: github.com/karthikrshet/LearnOS-ai