What Are the Two Stages of the Lesson Generation Process in OpenMAIC?
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.
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 exposinggenerateSceneContentthat orchestrates the pipeline.packages/@openmaic/generation/README.md– Documentation overview of the two-stage generation architecture.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) creates the pedagogical structure, defining topics, sub-topics, and milestones. - Scene Generation (
scene-generator.ts) produces concrete learning objects such as slides, quizzes, and videos based on the outline. - The
generateSceneContentfunction inindex.tsserves 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, 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, 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.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →