The Open-Source AI University
What if Coursera was rebuilt from scratch, with AI agents instead of pre-recorded lectures?
Education shouldn't be locked behind logins, paywalls, or a single vendor.
LearnOS is an AI university you run yourself. Name any subject and it writes you a real course: lessons planned in order, worked examples, practice with solutions, labs that check your code, quizzes checked by an independent examiner, and a tutor that has read the lesson you are on. Run it on your Claude plan (through Claude Code) or any model on OpenRouter. No accounts, no paywall, no lock-in.
A generated lesson: course outline on the left, LaTeX, runnable code, worked examples, practice with folded solutions
The tutor sits beside the lesson it has read; select any passage to ask about it
A course: what you will be able to do, what you need first, and one button to the next lesson
Online education is broken:
- πΈ Expensive, Coursera, edX, and Udacity charge per course, per certificate, per degree
- πΉ Static, Pre-recorded lectures from 2019 teaching a 2026 world
- π§± One-size-fits-all, Same content whether you're a beginner or an expert
- ποΈ Isolated, You learn alone, drop out alone (completion rates: ~5-15%)
LearnOS is an AI-native university platform where:
| Traditional Platforms | LearnOS |
|---|---|
| Pre-recorded lectures, the same for everyone | Courses written for your goal and level, on any subject |
| Questions go to a forum, answered days later | A tutor beside every lesson that has read it |
| Content nobody checks after it ships | Every lesson reviewed, every example run, every quiz answer checked, before you see it |
| Locked to one vendor | Your Claude plan, or any model on OpenRouter |
| Your progress lives on their servers | Everything stays on your machine |
Read the full VISION.md for where this is headed.
LearnOS isn't "a platform with an AI chatbot." It's a system of specialized AI agents that collaborate to deliver a complete university experience. Every agent is a real module under ai/agents/:
| Agent | Role |
|---|---|
| πΊοΈ Curriculum Agent | Designs personalized learning roadmaps from your goals |
| βοΈ Course writer | Writes each lesson in order, told what came before, and revises it against review and code runs |
| π Reviewer | Reads every lesson like a subject expert and answers every quiz question without the key |
| π§βπ« Tutor | Sits beside the lesson you are reading, knows it and what you got wrong |
| π Assessment Agent | Writes quizzes, labs and graded work from the lessons, and grades submissions against rubrics |
| π Research Agent | Pulls in supporting resources from the open web |
| π Analytics Agent | Tracks learning patterns and surfaces habit insights |
| π― Profiling Agent | Models your level, style, and goals during onboarding |
All agents run through a single LLM layer (ai/llm.js) with two providers: your Claude plan through Claude Code (ai/providers/claudeCode.js, no API key, no per-token bill) or OpenRouter, where one key unlocks every major model. Models are routed per agent, so you can, for example, write with a fast model and review with a strong one. Every call is metered.
- π Courses that teach. Every lesson opens with a concrete question, builds intuition before formalism, works a full example, names the common mistake, and ends with practice problems whose solutions stay folded until you have tried.
- π§βπ« A tutor that has read the lesson. Open it beside any lesson, or select a passage and ask about exactly that. It knows the course, your level and what you got wrong in the quiz, and gives hints before answers.
- π§ͺ Labs that check your work. Code runs on your machine against tests; the tests themselves were proven against a reference solution before the course reached you.
- β Quizzes, then graded work. Practice quizzes with every answer explained, graded assignments with rubrics, and spaced review of what you missed.
- π Your Claude plan or any model. Use your Claude Pro or Max plan through Claude Code (no API key, nothing extra to pay), or one OpenRouter key for any model, set per agent.
- π€ Courses are files. Export a course as a single
.learnos.json, send it, import it. - πΎ Yours. Runs on your computer, stores everything in one SQLite file, no account and no telemetry.
A course is not one big prompt. ai/agents/courseBuilder.js runs a pipeline where every step is checked by something other than the model that wrote it:
- Plan. The syllabus assigns every lesson its objectives and the concepts it introduces, each concept exactly once across the course, plus one notation and one running example the course keeps extending.
- Write, in order. Each lesson is written alone and told what earlier lessons covered and how the previous one ended, so lessons build instead of repeating.
- Run the code. Every Python and JavaScript example is executed, notebook style. Failures go back to the writer with the real traceback.
- Review. A reviewer agent reads each lesson like a subject expert (accuracy, notation, skipped steps, filler) and the lesson is revised against its findings.
- Assess what was taught. Quizzes, labs and graded work are written from the finished lessons. An independent examiner answers every quiz question without the key, and disputed questions are dropped. Lab tests take their expected values from running the reference solution, and a lab whose starter already passes is rejected.
- Cite what exists. Further reading is checked to load and to be what it claims to be.
Each build stores a report of revisions, review findings and code runs. A build that leaves modules empty says so, and Finish building completes them with the same pipeline.
- Node.js 22.13 or newer (SQLite is built in, nothing native to compile)
- A model: either Claude Code signed in with your Claude plan, or an OpenRouter key. You choose in the app.
- Optional: Python 3 for Python labs and examples (numpy and pandas recommended)
git clone https://github.com/Abelo9996/LearnOS.git
cd LearnOS
npm install
npm startOpen http://localhost:3001. The first npm start builds the app; after that it starts in a second. There is no login: LearnOS runs as you, on your machine, listening on localhost only (set HOST=0.0.0.0 to open it to your network).
Onboarding asks how to connect a model. If Claude Code is installed and signed in, one click uses your Claude plan; otherwise paste an OpenRouter key. You can change this any time in Settings β API keys, per agent or for all of them.
npm run dev # API on :3001 (restarts on change) + Vite with hot reload on :3000
npm testOPENROUTER_API_KEY=sk-or-... docker compose up -dOpen http://localhost:3210. This adds Judge0, so labs run in sandboxed containers across many languages. Judge0 needs privileged containers and cgroups; it runs best on a Linux host.
Single Node service: Express serves both the REST API and the built React SPA.
LearnOS/
βββ server.js # Express 5 entry point, API + static SPA
βββ routes/ # REST endpoints (courses, roadmaps, sessions, β¦)
βββ middleware/ # local-user resolver, logger, url-safety (SSRF guard)
βββ db/ # node:sqlite (sqlite.js), schema.sql, database.js
βββ ai/
β βββ llm.js # provider-agnostic LLM layer (Claude) + metering
β βββ jobs.js # async AI job runner
β βββ schemas.js # structured-output schemas
β βββ agents/ # curriculum, assessment, research, analytics, profiling
βββ src/ # React 18 frontend (Vite)
β βββ screens/ # Landing, Auth, Dashboard, Courses, Roadmap, Session, β¦
β βββ ...
βββ uploads/ # user uploads (avatars, etc.)
βββ tests/ # Vitest suite
βββ docs/ # architecture, specs, status
Frontend talks to the backend via a /api proxy in dev (vite.config.js) and same-origin in production.
A course you generate is not trapped in your install. Courses β Import or export
writes the whole thing (modules, lessons, labs, the question bank) to a single
.learnos.json file. Anyone with that file gets the entire course by dropping it into
their own LearnOS. No server, no account, no network involved. Nothing imported is
trusted: links are re-checked, and imported questions arrive unverified.
LearnOS is meant to be self-hosted for your own use, so it ships without accounts by design. It still keeps real hardening, an SSRF guard on outbound fetches, magic-byte validation on uploads, Helmet headers, encrypted-at-rest API keys, CORS locked to APP_URL in production, and rate limiting. See SECURITY.md to report a vulnerability.
LearnOS is open-source because education should be free. We welcome contributions of all kinds, code, agents, courses, and docs. See CONTRIBUTING.md and look for issues labeled good first issue.
MIT, because knowledge should be free.
β Star this repo if you believe education should be free and AI-native.
Built with conviction that the next university won't have a campus, it'll have a GitHub repo.