{"id":48448602,"url":"https://github.com/crewaiinc/course-generator","last_synced_at":"2026-04-06T19:02:54.192Z","repository":{"id":344173025,"uuid":"1143435907","full_name":"crewAIInc/course-generator","owner":"crewAIInc","description":"A production-ready example of CrewAI's Flow + Crew hybrid pattern for educational content","archived":false,"fork":false,"pushed_at":"2026-01-27T15:24:12.000Z","size":21,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-14T00:45:12.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crewAIInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-27T15:24:05.000Z","updated_at":"2026-02-04T22:09:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/crewAIInc/course-generator","commit_stats":null,"previous_names":["crewaiinc/course-generator"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/crewAIInc/course-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Fcourse-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Fcourse-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Fcourse-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Fcourse-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crewAIInc","download_url":"https://codeload.github.com/crewAIInc/course-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crewAIInc%2Fcourse-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31485516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-06T17:22:55.647Z","status":"ssl_error","status_checked_at":"2026-04-06T17:22:54.741Z","response_time":112,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-06T19:02:39.980Z","updated_at":"2026-04-06T19:02:54.184Z","avatar_url":"https://github.com/crewAIInc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎓 Course Generator Flow\n\n**A production-ready example of CrewAI's Flow + Crew hybrid pattern** — demonstrating how to combine orchestration logic with multi-agent collaboration.\n\nGive it a topic, get a complete lesson package: curriculum, content, quizzes, and reviewed code examples.\n\n[![CrewAI](https://img.shields.io/badge/Built%20with-CrewAI-coral)](https://crewai.com)\n[![Python 3.10+](https://img.shields.io/badge/Python-3.10+-blue.svg)](https://python.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n\n---\n\n## 🎯 What This Demonstrates\n\nThis project showcases the **Flow + Crew hybrid pattern** — the recommended architecture for production CrewAI applications:\n\n- **Flow** handles orchestration: validation, routing, retries, state management\n- **Crew** handles execution: multi-agent collaboration on complex tasks\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                         FLOW LAYER                          │\n│  ┌──────────┐    ┌──────────┐    ┌──────────┐              │\n│  │ Validate │ →  │  Route   │ →  │ Finalize │              │\n│  └──────────┘    └────┬─────┘    └──────────┘              │\n│                       │                 ↑                   │\n│                       ▼                 │                   │\n│              ┌────────────────┐         │                   │\n│              │   CREW LAYER   │─────────┘                   │\n│              │                │                             │\n│              │  ┌──────────┐  │                             │\n│              │  │ Architect│  │                             │\n│              │  └────┬─────┘  │                             │\n│              │       ↓        │                             │\n│              │  ┌──────────┐  │                             │\n│              │  │  Writer  │  │                             │\n│              │  └────┬─────┘  │                             │\n│              │       ↓        │                             │\n│              │  ┌──────────┐  │                             │\n│              │  │Quiz Master│ │                             │\n│              │  └────┬─────┘  │                             │\n│              │       ↓        │                             │\n│              │  ┌──────────┐  │                             │\n│              │  │ Reviewer │  │                             │\n│              │  └──────────┘  │                             │\n│              └────────────────┘                             │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Why This Pattern?\n\n| Challenge | Flow Solves It | Crew Solves It |\n|-----------|---------------|----------------|\n| Input validation | ✅ Pre-flight checks | |\n| Complex multi-step work | | ✅ Agent collaboration |\n| Quality control loops | ✅ Conditional routing | |\n| Error recovery | ✅ Graceful fallbacks | |\n| State persistence | ✅ Typed state management | |\n| Specialized expertise | | ✅ Role-based agents |\n\n---\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/crewAIInc/course-generator-flow.git\ncd course-generator-flow\n\n# Create virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # or `.venv\\Scripts\\activate` on Windows\n\n# Install dependencies\npip install -e .\n\n# Set your API key\nexport OPENAI_API_KEY=\"your-key-here\"\n```\n\n### Generate Your First Course\n\n```bash\n# Basic generation (Crew mode)\npython -m src.main \"Building Custom Tools in CrewAI\"\n\n# With Flow orchestration (recommended)\npython -m src.main \"Building Custom Tools in CrewAI\" --flow\n\n# Advanced options\npython -m src.main \"Agent Memory Systems\" --flow --difficulty advanced --output lesson.md\n```\n\n---\n\n## 🏗️ Architecture\n\n### The Crew (4 Specialized Agents)\n\n| Agent | Role | Responsibility |\n|-------|------|----------------|\n| 📐 **Curriculum Architect** | Instructional Designer | Plans structure, defines learning objectives |\n| ✍️ **Content Writer** | Technical Writer | Creates lessons, explanations, code examples |\n| 🎯 **Quiz Master** | Assessment Specialist | Designs questions and hands-on exercises |\n| 🔍 **Code Reviewer** | Senior Engineer | Ensures code quality and correctness |\n\n### The Flow (Orchestration Layer)\n\n```python\nclass CourseGeneratorFlow(Flow[CourseFlowState]):\n    \n    @start()\n    def validate_topic(self):\n        \"\"\"Pre-flight validation before spending tokens.\"\"\"\n        \n    @listen(\"valid\")\n    def generate_content(self):\n        \"\"\"Run the Crew to generate content.\"\"\"\n        \n    @router(generate_content)\n    def check_quality(self):\n        \"\"\"Route based on code review results.\"\"\"\n        \n    @listen(\"needs_revision\")\n    def revise_content(self):\n        \"\"\"Re-run with review feedback.\"\"\"\n        \n    @listen(or_(\"quality_passed\", \"max_retries\"))\n    def finalize_content(self):\n        \"\"\"Package output with metadata.\"\"\"\n```\n\n### State Management\n\n```python\nclass CourseFlowState(BaseModel):\n    # Input\n    topic: str = \"\"\n    difficulty: str = \"intermediate\"\n    \n    # Processing\n    topic_validated: bool = False\n    review_attempts: int = 0\n    code_review_passed: bool = False\n    \n    # Output\n    final_content: str = \"\"\n    errors: list[str] = []\n```\n\n---\n\n## 📖 Usage\n\n### Command Line\n\n```bash\n# Simple (Crew mode - direct execution)\npython -m src.main \"Your Topic Here\"\n\n# Flow mode (recommended for production)\npython -m src.main \"Your Topic Here\" --flow\n\n# All options\npython -m src.main \"Topic\" \\\n    --flow \\                    # Use Flow orchestration\n    --difficulty advanced \\     # beginner/intermediate/advanced\n    --output lesson.md \\        # Custom output path\n    --max-retries 3 \\          # Quality retry attempts\n    --quiet                     # Less verbose output\n```\n\n### Programmatic\n\n```python\n# Crew mode (simple)\nfrom src import CourseGeneratorCrew\n\ncrew = CourseGeneratorCrew(topic=\"Building Custom Tools\")\nresult = crew.run()\n\n# Flow mode (production)\nfrom src import CourseGeneratorFlow\n\nflow = CourseGeneratorFlow()\nresult = flow.kickoff(inputs={\n    \"topic\": \"Building Custom Tools\",\n    \"difficulty\": \"intermediate\"\n})\n\n# Access state after completion\nprint(f\"Review passed: {flow.state.code_review_passed}\")\nprint(f\"Attempts: {flow.state.review_attempts}\")\n```\n\n---\n\n## 📁 Project Structure\n\n```\ncourse-generator-flow/\n├── README.md\n├── pyproject.toml\n├── src/\n│   ├── __init__.py         # Package exports\n│   ├── agents.py           # Agent definitions (roles, goals, backstories)\n│   ├── tasks.py            # Task definitions (descriptions, expected outputs)\n│   ├── crew.py             # Crew assembly (agents + tasks + process)\n│   ├── flow.py             # Flow orchestration (validation, routing, state)\n│   └── main.py             # CLI entry point\n├── output/                 # Generated content\n└── examples/               # Sample outputs\n```\n\n---\n\n## 🎨 Output Example\n\nGenerated content includes:\n\n```markdown\n# Course Content: Building Custom Tools in CrewAI\n\n\u003e Generated by CrewAI Course Generator (Flow Mode)\n\u003e Review Passed: ✅ Yes\n\u003e Attempts: 1\n\n---\n\n## Learning Objectives\n1. Understand when and why to create custom tools\n2. Implement a basic custom tool using the @tool decorator\n3. Build tools that interact with external APIs\n...\n\n## Introduction\nTools are what give your agents superpowers...\n\n## Code Examples\n\n### Example 1: Simple Calculator Tool\n```python\nfrom crewai.tools import tool\n\n@tool\ndef calculate(expression: str) -\u003e str:\n    \"\"\"Evaluate a mathematical expression.\"\"\"\n    return str(eval(expression))\n```\n\n...\n\n## Quiz Questions\n1. What decorator is used to create a custom tool?\n   - [ ] @agent\n   - [x] @tool\n   - [ ] @task\n...\n```\n\n---\n\n## 🔧 Customization\n\n### Using Different Models\n\n```python\n# In src/agents.py\nfrom crewai import Agent, LLM\n\nllm = LLM(model=\"gpt-4o\")  # or claude-3-5-sonnet, etc.\n\nreturn Agent(\n    role=\"Curriculum Architect\",\n    llm=llm,\n    # ...\n)\n```\n\n### Adding New Agents\n\n```python\n# In src/agents.py\ndef create_visual_designer() -\u003e Agent:\n    return Agent(\n        role=\"Visual Designer\",\n        goal=\"Create diagrams and visual aids for lessons\",\n        backstory=\"You are a technical illustrator who...\",\n    )\n```\n\n### Extending the Flow\n\n```python\n# In src/flow.py\n@listen(\"finalize_content\")\ndef generate_visuals(self):\n    \"\"\"Add a visual generation step.\"\"\"\n    # Use the visual designer agent\n    pass\n```\n\n---\n\n## 💡 Example Topics\n\n**Beginner:**\n- \"Introduction to CrewAI Agents\"\n- \"Your First Crew: Hello World\"\n- \"Understanding Tasks and Goals\"\n\n**Intermediate:**\n- \"Building Custom Tools in CrewAI\"\n- \"Agent Memory and Context\"\n- \"Multi-Agent Collaboration Patterns\"\n\n**Advanced:**\n- \"Flow-Based Orchestration Patterns\"\n- \"Production Deployment Strategies\"\n- \"Advanced Task Delegation\"\n\n---\n\n## 🤝 Contributing\n\nContributions welcome! Areas of interest:\n\n- [ ] Additional agent types (e.g., Visual Designer, Translator)\n- [ ] More output formats (HTML, PDF, SCORM)\n- [ ] Integration with LMS platforms\n- [ ] Caching for faster regeneration\n- [ ] Parallel task execution where possible\n\n---\n\n## 📄 License\n\nMIT License - Use freely in your own projects.\n\n---\n\n## 🔗 Resources\n\n- [CrewAI Documentation](https://docs.crewai.com)\n- [CrewAI Flows Guide](https://docs.crewai.com/concepts/flows)\n- [CrewAI GitHub](https://github.com/crewAIInc/crewAI)\n- [CrewAI Discord](https://discord.gg/crewai)\n\n---\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eBuilt with ❤️ using \u003ca href=\"https://crewai.com\"\u003eCrewAI\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewaiinc%2Fcourse-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrewaiinc%2Fcourse-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrewaiinc%2Fcourse-generator/lists"}