openmaic-classroom
OpenMAIC — Open Multi-Agent Interactive Classroom platform for generating immersive AI-powered learning experiences with slides, quizzes, simulations, and multi-agent discussions.
What this skill does
# OpenMAIC — Multi-Agent Interactive Classroom
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
OpenMAIC (Open Multi-Agent Interactive Classroom) is a Next.js 16 / React 19 / TypeScript platform that converts any topic or document into a full interactive lesson. A multi-agent pipeline (LangGraph 1.1) generates slides, quizzes, HTML simulations, and project-based learning activities delivered by AI teachers and AI classmates with voice (TTS) and whiteboard support.
---
## Project Stack
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router) |
| UI | React 19, Tailwind CSS 4 |
| Agent orchestration | LangGraph 1.1 |
| Language | TypeScript 5 |
| Package manager | pnpm >= 10 |
| Runtime | Node.js >= 20 |
---
## Installation
```bash
git clone https://github.com/THU-MAIC/OpenMAIC.git
cd OpenMAIC
pnpm install
```
### Environment Configuration
```bash
cp .env.example .env.local
```
Edit `.env.local` — at minimum one LLM provider key is required:
```env
# LLM Providers (configure at least one)
OPENAI_API_KEY=$OPENAI_API_KEY
ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY
GOOGLE_API_KEY=$GOOGLE_API_KEY
# Recommended default model (Gemini 3 Flash = best speed/quality balance)
DEFAULT_MODEL=google:gemini-3-flash-preview
# Optional: MinerU for advanced PDF/table/formula parsing
PDF_MINERU_BASE_URL=https://mineru.net
PDF_MINERU_API_KEY=$MINERU_API_KEY
# Optional: access code for hosted mode
ACCESS_CODE=$OPENMAIC_ACCESS_CODE
```
### Provider Config via YAML (alternative to env vars)
Create `server-providers.yml` in the project root:
```yaml
providers:
openai:
apiKey: $OPENAI_API_KEY
anthropic:
apiKey: $ANTHROPIC_API_KEY
google:
apiKey: $GOOGLE_API_KEY
deepseek:
apiKey: $DEEPSEEK_API_KEY
# Any OpenAI-compatible endpoint
custom:
baseURL: https://your-proxy.example.com/v1
apiKey: $CUSTOM_API_KEY
```
---
## Running the App
```bash
# Development
pnpm dev
# → http://localhost:3000
# Production build
pnpm build && pnpm start
# Type checking
pnpm tsc --noEmit
# Linting
pnpm lint
```
---
## Docker Deployment
```bash
cp .env.example .env.local
# Edit .env.local with your API keys
docker compose up --build
# → http://localhost:3000
```
---
## Vercel Deployment
```bash
# Fork the repo, then import at https://vercel.com/new
# Set env vars in Vercel dashboard:
# OPENAI_API_KEY or ANTHROPIC_API_KEY or GOOGLE_API_KEY
# DEFAULT_MODEL (optional, e.g. google:gemini-3-flash-preview)
```
One-click deploy button is available in the README; it pre-fills env var descriptions automatically.
---
## Lesson Generation Pipeline
OpenMAIC uses a two-stage pipeline:
| Stage | Description |
|---|---|
| **Outline** | AI analyzes topic/document and produces a structured lesson outline |
| **Scenes** | Each outline item is expanded into a typed scene: `slides`, `quiz`, `interactive`, or `pbl` |
### Scene Types
| Type | Description |
|---|---|
| `slides` | AI teacher lectures with TTS narration, spotlight, laser pointer |
| `quiz` | Single/multiple choice or short-answer with AI grading |
| `interactive` | HTML-based simulation (physics, flowcharts, etc.) |
| `pbl` | Project-Based Learning — choose a role, collaborate with agents |
---
## API Usage — Generating a Classroom
### REST: Start Generation Job
```typescript
// POST /api/generate
const response = await fetch('/api/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
topic: 'Quantum Entanglement',
// Optional: attach document content
document: markdownString,
// Optional: model override
model: 'google:gemini-3-flash-preview',
}),
});
const { jobId } = await response.json();
```
### REST: Poll Job Status
```typescript
// GET /api/generate/status?jobId=<jobId>
const poll = async (jobId: string) => {
while (true) {
const res = await fetch(`/api/generate/status?jobId=${jobId}`);
const data = await res.json();
if (data.status === 'completed') {
console.log('Classroom URL:', data.classroomUrl);
break;
}
if (data.status === 'failed') {
throw new Error(data.error);
}
// status === 'pending' | 'running'
await new Promise(r => setTimeout(r, 3000));
}
};
```
### REST: Export Slides
```typescript
// GET /api/export/pptx?classroomId=<id>
const exportPptx = async (classroomId: string) => {
const res = await fetch(`/api/export/pptx?classroomId=${classroomId}`);
const blob = await res.blob();
const url = URL.createObjectURL(blob);
// trigger download
const a = document.createElement('a');
a.href = url;
a.download = 'lesson.pptx';
a.click();
};
// GET /api/export/html?classroomId=<id>
const exportHtml = async (classroomId: string) => {
const res = await fetch(`/api/export/html?classroomId=${classroomId}`);
const html = await res.text();
return html;
};
```
---
## OpenClaw Integration
OpenMAIC ships a skill for [OpenClaw](https://github.com/openclaw/openclaw), enabling classroom generation from Feishu, Slack, Discord, Telegram, etc.
### Install the Skill
```bash
# Via ClawHub (recommended)
clawhub install openmaic
# Manual install
mkdir -p ~/.openclaw/skills
cp -R /path/to/OpenMAIC/skills/openmaic ~/.openclaw/skills/openmaic
```
### Configure OpenClaw
Edit `~/.openclaw/openclaw.json`:
```jsonc
{
"skills": {
"entries": {
"openmaic": {
"config": {
// Hosted mode — get access code from https://open.maic.chat/
"accessCode": "$OPENMAIC_ACCESS_CODE",
// Self-hosted mode — local repo + server URL
"repoDir": "/path/to/OpenMAIC",
"url": "http://localhost:3000"
}
}
}
}
}
```
### OpenClaw Skill Lifecycle
| Phase | What Happens |
|---|---|
| Clone | Detect existing checkout or clone fresh |
| Startup | Choose `pnpm dev`, `pnpm build && pnpm start`, or Docker |
| Provider Keys | Guide user to edit `.env.local` |
| Generation | Submit async job, poll, return classroom link |
---
## Custom Scene Development Pattern
Scenes are typed React components. To add a new scene type:
```typescript
// types/scene.ts
export type SceneType = 'slides' | 'quiz' | 'interactive' | 'pbl' | 'custom';
export interface CustomScene {
type: 'custom';
title: string;
content: string;
// your fields
metadata: Record<string, unknown>;
}
```
```typescript
// components/scenes/CustomScene.tsx
'use client';
import { type CustomScene } from '@/types/scene';
interface Props {
scene: CustomScene;
onComplete: () => void;
}
export function CustomSceneComponent({ scene, onComplete }: Props) {
return (
<div className="flex flex-col gap-4 p-6">
<h2 className="text-2xl font-bold">{scene.title}</h2>
<div dangerouslySetInnerHTML={{ __html: scene.content }} />
<button
className="mt-4 rounded-lg bg-blue-600 px-6 py-2 text-white"
onClick={onComplete}
>
Continue
</button>
</div>
);
}
```
---
## Multi-Agent Interaction Modes
| Mode | Trigger | Description |
|---|---|---|
| Classroom Discussion | Automatic | Agents proactively start discussions; user can jump in or get called on |
| Roundtable Debate | Scene config | Multiple agent personas debate a topic with whiteboard illustrations |
| Q&A | User asks question | AI teacher responds with slides, diagrams, or whiteboard drawings |
| Whiteboard | During any scene | Agents draw equations, flowcharts, or concept diagrams in real time |
---
## MinerU Advanced Document Parsing
For complex PDFs with tables, formulas, or scanned images:
```env
# Use MinerU hosted API
PDF_MINERU_BASE_URL=https://mineru.net
PDF_MINERU_API_KEY=$MINERU_API_KEY
# Or self-hosted MinerU instance (Docker)
PDF_MINERU_BASE_URL=http://localhost:8888
```
Without MinerU, OpenMAIC falls back to standard PDF text extraction.
---
## Supported LLM Providers & Model Strings
```typescript
// Model string format: "provider:model-name"
const models = {
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.