This project demonstrates five key multi-agent orchestration patterns using the real Microsoft Agent Framework, providing runnable examples that showcase different collaboration approaches inspired by Semantic Kernel patterns.
Each pattern uses the real Microsoft Agent Framework with authentic APIs and orchestration builders:
- Sequential Orchestration (
sequential/step1_sequential.py) - UsesSequentialBuilder - Concurrent Orchestration (
concurrent/step2_concurrent.py) - UsesConcurrentBuilder - Group Chat Orchestration (
group_chat/step3_group_chat.py) - UsesWorkflowBuilderwith custom executors - Handoff Orchestration (
handoff/step4_handoff.py) - UsesWorkflowBuilderwith routing logic - Magentic Orchestration (
magentic/step5_magentic.py) - UsesMagenticBuilderwith tool integration
pip install -r requirements.txtThis installs the real Microsoft Agent Framework packages:
agent-framework- Core framework componentsagent-framework-azure-ai- Azure AI integrationazure-identity- Azure authentication
This project uses Azure CLI authentication with Azure OpenAI:
# Install Azure CLI (if not already installed)
az login# Copy the environment template
cp .env.example .env
# Set your Azure OpenAI configuration in .env:
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_CHAT_DEPLOYMENT_NAME=gpt-4o
AZURE_OPENAI_API_VERSION=2024-10-21# List available patterns
python -m agent_framework_patterns.cli --list
# Test all patterns
python agent_framework_patterns/test_all_patterns.py# Run all patterns with default task
python agent_framework_patterns/cli.py all
# Run specific pattern
python agent_framework_patterns/cli.py sequential
# Run with custom task
python agent_framework_patterns/cli.py magentic --task "Design an AI-powered customer service system"# Sequential pattern - deterministic chain
python agent_framework_patterns/sequential/step1_sequential.py
# Concurrent pattern - parallel execution
python agent_framework_patterns/concurrent/step2_concurrent.py
# Group Chat pattern - collaborative conversation
python agent_framework_patterns/group_chat/step3_group_chat.py
# Handoff pattern - dynamic delegation
python agent_framework_patterns/handoff/step4_handoff.py
# Magentic pattern - plan-driven collaboration
python agent_framework_patterns/magentic/step5_magentic.pyThe project includes a modern Streamlit-based web dashboard that provides a professional interface for running all orchestration patterns with real-time monitoring and agent tracking.
The main interface allows you to select orchestration patterns, configure business scenarios, and customize task inputs:
Real-time monitoring shows live agent execution with progress tracking, individual agent status, and sequential completion indicators:
Comprehensive results view displaying execution metrics, individual agent inputs/outputs, and detailed performance analytics:
# Start the web dashboard
cd web_ui
streamlit run dashboard_core.pyWhen to use: Fixed workflows, step-by-step processing, pipeline scenarios
- Chains agents: Planner → Researcher → Writer → Reviewer
- Each agent receives full context and adds its output
- Deterministic order and execution
When to use: Independent analyses, parallel processing, ensemble decisions
- Runs multiple agents simultaneously on same task
- Aggregates diverse perspectives (e.g., Summarizer, ProsCons, RiskAssessor)
- Reduces overall runtime
When to use: Collaborative problem-solving, maker-checker loops, brainstorming
- Managed conversation between agents (Maker, Checker, Moderator)
- Supports human-in-the-loop interactions
- Quality gates and consensus building
When to use: Dynamic routing, specialized expertise, customer support scenarios
- Intelligent routing based on context (StatusAgent, ReturnsAgent, etc.)
- Full ownership transfer between agents
- Fallback to human when needed
When to use: Complex open-ended problems, planning + execution workflows
- Planner decomposes tasks and selects appropriate agents
- Dynamic agent selection and tool usage
- Backtracking and plan refinement
common/models.py- Model client factory for Azure OpenAI and GitHub Modelscommon/agents.py- Agent factory with domain-specific rolescommon/tools.py- Simple tools for Magentic example
- GitHub Models: Free for development, single endpoint, PAT authentication
- Azure OpenAI: Enterprise-grade, requires deployment and API keys
- Graceful fallbacks when credentials are missing
Each pattern provides functional parity with Semantic Kernel's orchestration samples:
- Agent roles and instructions match SK sample personas
- Control flow logic mirrors SK orchestration behavior
- Human-in-the-loop patterns preserved
- Streaming responses and error handling included
The key difference is using Agent Framework APIs instead of Semantic Kernel APIs, while maintaining the same orchestration patterns and agent collaboration behaviors.
- All scripts are self-contained and runnable individually
- Type annotations and error handling included
- Graceful degradation when environment variables missing
- Clear logging and trace output for debugging
- Follows Agent Framework best practices
# Run all pattern examples to verify setup
python -m agent_framework_patterns.test_all_patterns- Agent Framework Documentation: Microsoft Agent Framework
- Pattern Definitions: AI Agent Orchestration Patterns
- Semantic Kernel Reference: Agent Orchestration
- Introductiong Microsoft Agent Framework: Technical Blog
- AI Agent Orchestration Pattern: Pattern
- Multi Agent Observability: Observability


