Pouyan Jahangiri

All work

Lunaris, in 10 minutes. Choose a chapter to look at it first, or play the video from the start.

Agentic course factory

Lunaris

A course on any topic, planned and written by an agent, with nothing out of order and nothing unsupported.

Read about it

The product

An agent that plans, and code that decides what ships

Ask an AI to teach you something and it will, at once and with confidence. Two things can quietly go wrong: it can teach step five before step two, and it can state as fact something nothing supports. Lunaris is an open-source course builder made so that neither can ship. An agent plans the course and writes it, and two pieces of plain, deterministic code decide what leaves.

Let the model reason, let the code guarantee

At the centre is a planning agent that decides what to do next. Everything it can do is a tool, and each tool writes its typed result onto one shared draft of the course. Two of the tools are different: they are deterministic code. One orders the concepts and one checks the facts. The agent can call them, but it cannot talk its way past them.

The stages of a build, who does each, and what it hands on
StageDone byWhat it hands on
Interpret ModelThe request read as a goal, for a learner, at a level.
Research ModelWhat that level really demands, with the pages it read kept as seeds.
Model the learner ModelThe learner's frontier: what they already know and can skip.
Extract concepts ModelOnly the concepts in the gap, each with a difficulty.
Prerequisite graph CodeAn acyclic graph and a teaching order.
Design the curriculum ModelModules worked backward from the goal, with objectives and assessments.
Ground Code and modelA private corpus of evidence for this one course.
Author ModelLessons, with every factual claim pulled out sentence by sentence.
Verify CodeEach claim supported with its citation, or cut.
Curate ModelVetted outside resources attached to the lessons.
Finalize CodeThe course assembled behind a critic's gate: published, or held for review.

The right course before the right order

A course can be perfectly ordered and perfectly sourced and still useless. Ask a naive generator to improve your English to CLB 10, the top advanced band, and it starts you at the alphabet. So the first four stages do what a good tutor does first: read the request as a goal for a learner at a level, research what the level really demands, model what the learner already knows, and extract only the concepts in the gap between the two.

Nothing out of order

The prerequisite graph asks a model one small question at a time: is this concept a prerequisite of that one? It asks only from easier to harder, so five concepts make ten pairs, and every yes comes back with a strength. From there on no model is involved.

  • Loops broken. If the judgements ever form a loop, it is broken at its weakest edge, the judgement most likely to be wrong.
  • Shortcuts removed. If comparison leads to sorted order and sorted order to binary search, a direct edge from comparison to binary search adds nothing. A transitive reduction takes it out.
  • Known ground pruned. Anything the learner already knows is cut away.
  • A teaching order. What remains is sorted topologically, easiest first. The code asserts the graph is acyclic before it returns: by proof, not by promise.

Nothing unsupported

Before a lesson is written, the build fills a corpus, a private library for this one course: documents you hand it, pages a discovery agent searches and reads, and the pages the research stage already fetched. Every source is graded as it arrives. Official bodies start at 0.9, sources you vouch for at 0.85, reputable institutions at 0.75; the open web starts at 0.5 and can never climb past 0.65, and blocked domains are never fetched.

A subagent writes each lesson and pulls out every factual claim, sentence by sentence, and each claim faces the verifier alone, so one bad sentence cannot hide inside a good paragraph.

  • Retrieve. The closest evidence in the corpus, by vector similarity.
  • Score. An independent model scores how well the evidence supports the claim. It sees only the text, never where it came from.
  • Decide, in code. The score must clear 0.65 on a low-risk course and 0.85 on a high-risk one. At high risk the evidence must also be curated with a credibility of at least 0.7, or agree across two independent domains.

A claim that passes ships with its citation; one that fails is cut, and so is one checked while the database is down or the model has timed out. Cut claims go back to the author for one round of revision at low risk and three at high, and whatever still cannot be grounded is dropped. In one documented run, with almost no evidence to check against, the author wrote 59 claims, the verifier cut all 59, and the course was held for review instead of published: the system working as designed.

From a lesson to a video

Every lesson follows the same arc: activate what you already know, see it demonstrated, apply it, integrate it, and check your understanding. Any lesson can then become a short animated explainer, under the same discipline.

  • A contract first. A model plans the video as scenes, beats and narration.
  • A factual gate. Before anything renders, every number spoken in the narration must appear in a verified claim.
  • Rendered in a sandbox. Each scene is written as Manim code and rendered in isolation. If it crashes, the stack trace goes back for repair.
  • Looked at, then listened to. A vision model inspects the frames for layout defects, and once the voice is added a sync gate samples the middle of every spoken beat to confirm the picture shows what the words say.
  • The cover too. An art director, an image model and a vision check that rejects anything off-brand.

Lunaris Live

The same repository holds a second product. Where the studio builds a course you read, Live teaches you in a session. It compiles your topic into a concept map on the same graph algebra, and interviews you while it compiles, to find where you stand. Then the loop begins: you answer, a grader scores the answer against one explicit criterion, your belief score for the concept moves, and a director decides what happens next.

  • Rules, not a model. The director is an ordered list of rules. The clock comes first, a stuck learner is never abandoned, and a review that is due beats new material.
  • Spaced reviews. Concepts that hold climb a ladder of spaced reviews; the ones still forming come back tomorrow.
  • Simulators, verified. For ideas you have to touch, a model writes a small simulator, an isolated browser checks its behaviour, and a separate model reviews real screenshots before it runs, sandboxed, in your session.

Keys optional, guarantees portable

Every external key is optional. Bring your own and you get the full agent, with real search and real citations. Bring none and it still builds, on a small local model, local embeddings and free search, clearly labelled as a draft. And the two guarantees are not locked inside: they are published as MCP tools, build_prerequisite_graph and verify_claims, so any agent can call them.