Act 2: Assemble Your Podcast Production Team ๐ฌ โ

The Plot Thickens โ
Alex (your AI assistant from Act 1) is awesome, but one agent can't run a whole podcast studio. You need a team:
- ๐ Research Agent: Scours the internet for fresh info
- โ๏ธ Script Agent: Turns research into engaging dialogue
- ๐ค You (The Editor): Approves scripts or sends them back for rewrites
Welcome to AI Agent Orchestration โ where you become the director of your own AI crew. Think Avengers, but for podcast production.
What's Agent Orchestration? (The Simple Version) โ
Imagine you're running a restaurant. You don't do everything yourself, right? You've got:
- ๐ณ A chef who cooks
- ๐จโ๐ณ A sous chef who preps
- ๐ฉโ๐ณ A server who delivers
Agent orchestration is the same idea, but with AI. Each agent has a specialty, and you coordinate them to achieve bigger goals. No single agent is overwhelmed, and the work gets done faster.
The Band Analogy ๐ธ โ
Your AI agents are like a band:
- Lead singer: The main agent handling customer-facing tasks
- Drummer: Keeps the rhythm, handles background processing
- Bass player: Supports everyone, fetches data
- You (Band Manager): Coordinate it all!
Without coordination? Just noise. With orchestration? Beautiful music.
Why This Matters โ
One AI agent trying to do everything = burnout. Specialized agents working together = efficiency unlocked! ๐
Real Talk: Remember trying to research, write, AND edit your podcast alone? Yeah, that sucks. With orchestration, each agent handles what it's best at. You just make the final calls.
Real-World Example: Customer support bots that know when to handle billing vs. tech issues vs. when to call a human. That's orchestration!
Agent vs. Workflow: What's the Difference? โ
Think of it this way:
๐ค AI Agent = Jazz Musician โ
- Makes decisions on the fly based on what it hears
- Improvises solutions using its tools
- Thinks with an LLM brain
- Adapts to whatever you throw at it
๐ต Workflow = Orchestra Playing Classical Music โ
- Follows a score (predefined steps)
- Predictable execution path
- Coordinates multiple agents, humans, systems
- Structured like a recipe
The Magic: Workflows orchestrate agents! You build a workflow that tells agents when to play their part. Best of both worlds. ๐ญ
Three Ways to Coordinate Your AI Crew โ
1. ๐ฏ Centralized (You're the Boss) โ
One main agent calls all the shots. Think of it like you managing a team โ you decide who does what and when.
Pros:
- โ Clear leadership (no confusion)
- โ Consistent decisions
- โ Easy to debug
Use it for:
- Customer service routing ("Is this billing or tech support?")
- Content approval workflows ("Does this script pass?")
- Podcast production (exactly what we're building!)
2. ๐ค Decentralized (Agents Self-Organize) โ
Agents talk directly to each other and figure things out as a group. Like a group chat where everyone coordinates.
Pros:
- โ Scales easily (add more agents anytime)
- โ No single point of failure
- โ Agents collaborate naturally
Use it for:
- Research teams (each agent explores different sources)
- Brainstorming sessions
- Distributed problem-solving
3. ๐ Hybrid (Best of Both Worlds) โ
You set the overall direction, but agents have freedom to self-organize on tasks. Like being a CEO who trusts their team.
Perfect for: Complex projects that need both control and flexibility.
Microsoft Agent Framework: Your Orchestration Toolkit ๐งฐ โ
Time to build! Here's what you'll use:
The Building Blocks โ
1. ๐งฑ Executors (Your Workers) โ
- What they are: Individual processing units โ could be agents or custom logic
- What they do: Take input, do work, produce output
- Think of them as: Stations in an assembly line
2. โก๏ธ Edges (The Connections) โ
- What they are: Paths between executors
- What they do: Control message flow ("After A, go to B")
- Think of them as: Arrows on a flowchart
3. ๐บ๏ธ Workflows (The Master Plan) โ
- What they are: The complete graph of executors + edges
- What they do: Define the entire process from start to finish
- Think of them as: Your production pipeline blueprint
Cool Features You'll Love โ
๐ก๏ธ Type Safety: Messages between agents are type-checked. No "Oops, wrong data type" surprises.
๐ Flexible Routing:
- If-then conditions ("If approved, publish; else, rewrite")
- Parallel processing (multiple agents work simultaneously)
- Dynamic paths (workflow adapts based on results)
๐ External Integration:
- Connect to APIs
- Add human-in-the-loop checkpoints (you approve before publishing)
- Build request/response flows
๐พ Checkpointing: Save progress! If something crashes, pick up where you left off.
๐ค Multi-Agent Coordination:
- Run agents in sequence (A โ B โ C)
- Run them in parallel (A + B + C at once)
- Hand off between agents
- Collaborative processing
Best Practices (Pro Tips) ๐ฏ โ
1. Keep It Modular โ
Each agent should do ONE thing really well. Don't make a "super agent" that does everything โ you'll regret it when debugging.
2. Plan for Failures โ
Agents mess up. Networks fail. Build in error handling and backup plans. Your future self will thank you.
3. Monitor Everything โ
Track what your agents are doing. Use DevUI (we'll cover this!) to see workflows in action.
4. Optimize Message Size โ
Don't pass giant files between agents. Keep messages lean and mean for speed.
5. Choose the Right Pattern โ
Need control? Go centralized. Need scale? Go decentralized. Can't decide? Go hybrid!
DevUI: Your Workflow Debugger ๐ โ
What's DevUI? โ
DevUI is like a playground for testing your agents and workflows. It's a web interface where you can:
- ๐ Watch your workflow in action
- ๐ฌ Chat with agents directly
- ๐ Debug when things go wrong
- ๐ See traces and performance metrics
Important: DevUI is for development only! Don't use it in production. Think of it as your local testing environment.
What Makes It Awesome โ
- ๐ฅ๏ธ Interactive Web UI: Click, type, test โ no command line needed
- ๐ Drag-and-Drop Ready: Upload files, test with different inputs
- ๐ Auto-Discovery: Point it at a folder, it finds all your agents automatically
- ๐ No-Setup Mode: Register agents in code, no folder structure needed
- ๐ OpenAI Compatible: Works with OpenAI SDK (compatibility FTW!)
- ๐๏ธ Tracing Built-in: See exactly what your agents are doing
How Input Works โ
DevUI is smart about inputs:
- Testing Agents? You get text boxes and file upload buttons
- Testing Workflows? The UI auto-generates input fields based on what your workflow expects
It's like magic, but it's just good code. โจ
Your Missions: Build a Podcast Studio ๐ฌ โ
Mission 1: Create a Single Agent with DevUI โ
๐ 01.AgentDevUI
The Challenge: Before building a full team, let's test DevUI with one agent: a web search specialist.
What You're Building: A research agent that can search the internet for podcast topics. You'll test it using DevUI's web interface at http://localhost:8090.
Skills You'll Learn:
- ๐ Launching agents in DevUI
- ๐ Testing agent responses in real-time
- ๐ ๏ธ Building custom tools (web search)
- ๐ Enabling tracing to debug issues
- ๐ฅ๏ธ Using the interactive web UI
The Code:
agent.py: Your SearchAgent with web search superpowers- Uses OllamaChatClient to connect to Qwen
- Implements
web_search()tool function - Launches with
serve()โ opens DevUI automatically
Victory Condition: Ask your agent "What's trending in AI?" and watch it search the web! ๐
Mission 2: Build a Multi-Agent Workflow โ
๐ 02.WorkflowDevUI
The Challenge: Now the real fun begins! Build a complete podcast production workflow with:
- ๐ Search Agent โ Researches your topic
- โ๏ธ Script Agent โ Writes a dialogue between two hosts (in Chinese!)
- ๐ค Review Executor โ Asks YOU to approve or reject
- ๐ Loop Back โ If rejected, rewrites based on your feedback
Skills You'll Learn:
- ๐งฑ Creating specialized agents for different jobs
- ๐ Connecting agents with WorkflowBuilder
- ๐ Implementing approval loops (human-in-the-loop!)
- ๐ฆ Conditional routing (if approved vs. rejected)
- ๐ง Building custom executors for business logic
The Workflow:
SearchAgent โ ScriptAgent โ ReviewExecutor
โ โ (if rejected)
โโโโโโโโโโThe Code:
search_agent/agent.py: Your research specialistgenerate_script_agent/agent.py: Your scriptwriter (writes in Chinese!)workflow/workflow.py: The orchestration magic happens heremain.py: Launches everything in DevUI
Victory Condition: Give a topic, review the script, reject it once to test the loop, then approve! ๐
Mission 3: Build a Console App โ
๐ 03.Application
The Challenge: Take your workflow from DevUI and turn it into a slick terminal app with colored output, loading spinners, and file saving. This is production-ready stuff!
Skills You'll Learn:
- โก Running workflows programmatically (no DevUI)
- ๐ก Event-driven architecture with streaming
- ๐จ Creating beautiful terminal UIs (colors, spinners, progress bars)
- ๐พ Saving final scripts to files
- ๐ Handling async workflows with Python's asyncio
What It Does:
- Asks you for a podcast topic
- Shows real-time progress ("Search Agent is working...")
- Displays generated script with colors
- Asks for your approval
- Saves approved script to
podcast.txt
The Code:
podcast_app.py: Your main app with event handlingworkflow.py: Reuses the workflow from Mission 2- Handles events:
AgentRunUpdateEvent,RequestInfoEvent,WorkflowOutputEvent - Uses ANSI colors for terminal styling
Victory Condition: Run the app, create a podcast script, and see it saved! You've built a real tool. ๐
What You've Mastered ๐ โ
What You've Mastered ๐ โ
After Act 2, you can:
- โ Orchestrate multiple AI agents like a boss
- โ Build workflows with sequential AND conditional logic
- โ Add human approval checkpoints
- โ Use DevUI to test and debug workflows
- โ Create production-ready console applications
- โ Handle errors gracefully in complex systems
- โ Choose the right orchestration pattern for any project
When Things Break ๐ง โ
"My workflow is too complicated!" โ
The Fix: Break it into smaller sub-workflows. Each workflow should do ONE thing well. Chain them together if needed.
"I can't track what's happening!" โ
The Fix: Use workflow checkpointing to save state. Enable tracing in DevUI to see every step.
"One agent's error crashes everything!" โ
The Fix: Add error boundaries. Each agent should handle its own failures and have fallback behavior.
"This is soooo slow" โ
The Fix: Can any agents run in parallel? Sequential workflows are easy but slow. Look for parallelization opportunities!
Helpful Resources ๐ โ
- Workflow Docs โ Official Microsoft guides
- Orchestration Patterns โ IBM's take on it
- Agent Framework GitHub โ Browse the source code
- Code Examples โ Steal patterns from here
Ready for the finale? You've got your script. Now let's turn it into actual audio! โ Act 3: Bring Your Podcast to Life ๐ค
Stuck? Confused? Excited? Share in the workshop chat! We're all learning together. ๐