This repository demonstrates a multi-agent blog writing system using Semantic Kernel communicating over the Agent-to-Agent (A2A) protocol. The system consists of three specialized agents that collaborate to create high-quality blog articles.
TL;DR
cp .env.example .env
# Edit azure-openai connection details to .env
./start_all.sh
The system implements a distributed agent architecture where remote agents expose their capabilities through the A2A protocol, and a local coordinator orchestrates their collaboration.
-
Critic Agent (
critic/agent.py
)- URL:
http://localhost:8001
- Role: Reviews blog articles and provides constructive feedback
- Focus: Structure, clarity, engagement, accuracy, and grammar
- Technology: Semantic Kernel + Azure OpenAI
- URL:
-
Writer Agent (
writer/agent.py
)- URL:
http://localhost:8002
- Role: Creates blog articles based on given topics
- Output: Comprehensive articles with introduction, body, and conclusion
- Technology: Semantic Kernel + Azure OpenAI
- URL:
- Blog Coordinator Agent (
blogging_agent.py
)- URL:
http://localhost:8000
- Role: Orchestrates the entire blog writing process
- Interface: Web UI for user interaction
- Technology: Semantic Kernel with A2A client tools
- Workflow:
- Receives blog topic from user
- Requests initial draft from writer agent
- Sends draft to critic agent for review
- Iterates with writer to improve based on feedback
- Delivers final polished article
- URL:
- Python 3.10 or higher
- UV package manager
- Azure OpenAI account with API access
git clone https://github.com/piizei/simple-a2a
cd simple-a2a
Copy .env.example
to .env
file in the root directory with your Azure OpenAI configuration:
# Azure OpenAI Configuration
AZURE_OPENAI_DEPLOYMENT_NAME=your-deployment-name
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com
AZURE_OPENAI_API_KEY=your-api-key
Note: All agents share the same Azure OpenAI configuration from this .env
file.
Using UV (recommended):
uv sync
The critic and writer agents are separate UV projects:
# Install critic agent dependencies
cd critic
uv sync
cd ..
# Install writer agent dependencies
cd writer
uv sync
cd ..
# Linux/macOS
./start_all.sh
# Windows (using Git Bash or WSL)
bash start_all.sh
# Terminal 1: Start Critic Agent
cd critic
uv run python __main__.py
# Terminal 2: Start Writer Agent
cd writer
uv run python __main__.py
# Terminal 3: Start Blog Coordinator
uv run python blogging_agent.py
Once all agents are running, open your browser and navigate to:
http://localhost:8000
- Access the Web UI at
http://localhost:8000
- Enter a blog topic in the chat interface
- Watch the agents collaborate:
- The coordinator asks the writer to create an initial draft
- The critic reviews the draft and provides feedback
- The writer iterates based on the feedback
- The process continues until a polished article is ready
- Receive your final blog article
- "Write a blog about the future of artificial intelligence"
- "Create an article about sustainable living practices"
- "Write a comprehensive guide on remote work productivity"
- "Create a blog post about the benefits of meditation"
- Agents not starting: Check that all dependencies are installed and ports are available
- Azure OpenAI errors: Verify your
.env
configuration and API key validity - A2A communication failures: Ensure all agents are running and accessible on their respective ports
- Web UI not loading: Check if
index.html
exists and the coordinator agent is running
All agents log at INFO level. Check the console output for detailed information about:
- Agent startup and initialization
- A2A protocol communications
- Azure OpenAI API calls
- Error messages and stack traces
MIT