# What Are the Two Stages of the Lesson Generation Process in OpenMAIC?

> Discover the two stages of lesson generation in OpenMAIC: Outline Generation for structure and Scene Generation for rich content. Learn how OpenMAIC builds effective lessons.

- Repository: [MAIC/OpenMAIC](https://github.com/THU-MAIC/OpenMAIC)
- Tags: deep-dive
- Published: 2026-09-11

---

**OpenMAIC generates lessons through a two-stage pipeline: first constructing a structured outline (Outline Generation), then populating it with rich learning objects (Scene Generation).**

OpenMAIC is an open-source educational AI framework that automates lesson creation through a structured generation pipeline. Understanding the two stages of the lesson generation process in OpenMAIC is essential for developers extending the platform or customizing content workflows. The architecture strictly separates high-level pedagogical planning from concrete asset creation, enabling the "one-click lesson generation" experience.

## Stage 1: Outline Generation

The **Outline Generation** stage translates user prompts or uploaded materials into a high-level pedagogical plan. According to the OpenMAIC source code, `packages/@openmaic/generation/src/outline-generator.ts` implements this logic, defining topics, sub-topics, and milestones that form the lesson's logical scaffold. This stage produces a structured roadmap that dictates the flow of instruction before any media assets are created.

The outline serves as the single source of truth for the lesson's scope, ensuring that subsequent content generation adheres to a coherent educational progression.

## Stage 2: Scene Generation

Once the outline is established, the pipeline proceeds to **Scene Generation**. As implemented in `packages/@openmaic/generation/src/scene-generator.ts`, this stage consumes the outline scaffold and generates concrete learning objects—including slides, quizzes, interactive simulations, and videos. Each outline entry expands into specific AI-driven content that transforms the abstract plan into a realized classroom experience.

This stage handles the heavy lifting of rich media creation, filling the logical structure with interactive elements suitable for learner consumption.

## Orchestrating the Pipeline with generateSceneContent

The public API entry point in `packages/@openmaic/generation/src/index.ts` exposes `generateSceneContent`, which orchestrates both stages internally. Developers invoke this function with a `kind` parameter to specify which phase to execute, allowing the system to transition from abstract planning to concrete asset generation.

```typescript
import { generateSceneContent } from '@openmaic/generation'

// Stage 1: Generate the lesson outline structure
const lessonPrompt = 'Teach the fundamentals of quantum mechanics'
const outline = await generateSceneContent({
  kind: 'outline',
  prompt: lessonPrompt,
})

// Stage 2: Expand outline entries into rich media content
const fullLesson = await generateSceneContent({
  kind: 'scene',
  outline,
})

console.log(fullLesson) // → Collection of slides, quizzes, videos, etc.

```

While the example demonstrates explicit sequential calls, the `generateSceneContent` function manages the internal data flow, ensuring the outline output from Stage 1 properly feeds into the scene-generation logic of Stage 2.

## Key Implementation Files

The lesson generation pipeline is distributed across several critical files in the THU-MAIC/OpenMAIC repository:

- `packages/@openmaic/generation/src/outline-generator.ts` – Implements the outline-generation logic for Stage 1.
- `packages/@openmaic/generation/src/scene-generator.ts` – Contains the scene-generation logic for Stage 2.
- `packages/@openmaic/generation/src/index.ts` – Public entry point exposing `generateSceneContent` that orchestrates the pipeline.
- `packages/@openmaic/generation/README.md` – Documentation overview of the two-stage generation architecture.
- [`components/generation/generation-toolbar.tsx`](https://github.com/THU-MAIC/OpenMAIC/blob/main/components/generation/generation-toolbar.tsx) – React component that triggers the pipeline from the workbench UI.

## Summary

- OpenMAIC uses a **two-stage pipeline**: Outline Generation followed by Scene Generation.
- **Outline Generation** ([`outline-generator.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/outline-generator.ts)) creates the pedagogical structure, defining topics, sub-topics, and milestones.
- **Scene Generation** ([`scene-generator.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/scene-generator.ts)) produces concrete learning objects such as slides, quizzes, and videos based on the outline.
- The `generateSceneContent` function in [`index.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/index.ts) serves as the unified entry point for executing both stages.
- This separation enables "one-click lesson generation" by first creating a plan, then realizing the classroom content.

## Frequently Asked Questions

### What is the purpose of the Outline Generation stage?

The Outline Generation stage translates user prompts or uploaded materials into a structured pedagogical roadmap. According to the OpenMAIC source code in [`outline-generator.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/outline-generator.ts), this stage defines the logical flow, topics, and milestones that serve as the scaffold for the entire lesson.

### What types of content does the Scene Generation stage produce?

The Scene Generation stage generates concrete learning objects including slides, quizzes, interactive simulations, and videos. As implemented in [`scene-generator.ts`](https://github.com/THU-MAIC/OpenMAIC/blob/main/scene-generator.ts), this stage fills the outline scaffold with rich media and AI-driven educational content suitable for direct learner interaction.

### How does the generateSceneContent function handle the two stages?

The `generateSceneContent` function in `packages/@openmaic/generation/src/index.ts` orchestrates the pipeline through a `kind` parameter—accepting `'outline'` to execute Stage 1 and `'scene'` to execute Stage 2. This design allows developers to trigger stages independently while ensuring the outline output feeds correctly into scene generation when running the full pipeline.

### Where can I find the source code for the lesson generation pipeline?

The core logic resides in `packages/@openmaic/generation/src/outline-generator.ts` and `packages/@openmaic/generation/src/scene-generator.ts`, with the public API exposed through `packages/@openmaic/generation/src/index.ts`. Documentation is available in `packages/@openmaic/generation/README.md`, and the UI trigger is located in [`components/generation/generation-toolbar.tsx`](https://github.com/THU-MAIC/OpenMAIC/blob/main/components/generation/generation-toolbar.tsx).