Course Factory
Last updated: 2026-07-06
What is Course Factory?
Course Factory is the AI-powered automated course generation system on HaMi Code Việt. The system uses AI to research topics, create outlines, write lesson content, generate quizzes, and perform safety checks — all within a 5-stage pipeline that can resume if interrupted.
5-Stage Pipeline
| Stage | Description | AI Model |
|---|---|---|
| 1. Research | AI researches the topic, identifies key concepts | Llama |
| 2. Outline | Creates course structure: lessons, order, objectives | Claude Haiku / Llama |
| 3. Content | Writes bilingual Vietnamese-English lesson content | Claude Haiku / Llama |
| 4. Quiz | Generates quiz questions and exercises | Llama |
| 5. Safety check | Child safety filter, content review | Safety classifier |
Key Features
- Resumable — Each stage persists its state to the database. If an error occurs, the pipeline can resume from the last completed stage.
- Cost tracking — The system records AI token usage for each stage, helping manage costs.
- Safety check — All content passes through a safety filter before publishing.
- Bilingual content — Each lesson has both Vietnamese and English versions.
- Admin approval — AI-generated courses must be approved by an admin before publishing.
Course Factory Admin Interface
Admins can access the Course Factory interface at /admin/factory. Here, admins can:
- Create new course generation requests
- Track the progress of each stage
- Preview generated content
- Approve or reject courses
- View AI token costs
API Endpoints
# Create a new Course Factory request
POST /factory/generate
{
"topic": "Python basics for beginners",
"level": "beginner",
"ageRange": "8-13",
"lessonCount": 10
}
# Check status
GET /factory/generations/:id
# Approve course
POST /factory/generations/:id/approveAccess control
Course Factory is restricted to admins and content_admins. See roles & permissions for details.
Creators and Course Factory
Creators can use Creator Studio to create content with AI assistance, but this process differs from Course Factory. Creator Studio is for Creators building content manually with AI help, while Course Factory generates complete courses automatically.