This Multi-Agent Creative Studio implements an Agent-to-Agent (A2A) Communication architecture with iterative refinement using Google's Gemini 2.5 Flash model via the Google ADK (Agent Development Kit).
The system consists of four specialized AI agents, each with a distinct role and responsibility:
┌─────────────────────────────────────────────────────────────────┐
│ Multi-Agent Creative Studio │
│ │
│ ┌────────────┐ ┌────────────┐ ┌────────────┐ ┌──────┐│
│ │ Idea │───>│ Critic │───>│ Refiner │───>│Presen││
│ │ Agent │ │ Agent │ │ Agent │ │ter A.││
│ └────────────┘ └────────────┘ └────────────┘ └──────┘│
│ ↓ ↓ ↓ ↓ │
│ Generate Analyze Improve Present │
│ 3 Concepts Flaws Based on Structured│
│ Feedback Output │
└─────────────────────────────────────────────────────────────────┘
Purpose: Generate creative concepts
Input:
- Topic/theme string
Output:
{
"agent": "Idea Agent",
"topic": str,
"ideas": str, # 3 formatted ideas
"status": "generated"
}Responsibilities:
- Generate 3 unique creative concepts
- Provide title, description, and USPs for each idea
- Think creatively and innovatively
Purpose: Analyze and critique ideas
Input:
- Ideas data from Idea Agent
Output:
{
"agent": "Critic Agent",
"topic": str,
"original_ideas": str,
"critique": str,
"status": "analyzed"
}Responsibilities:
- Analyze strengths and weaknesses
- Evaluate feasibility and market potential
- Identify risks and challenges
- Provide constructive feedback
Purpose: Improve ideas based on critique
Input:
- Critique data from Critic Agent (includes original ideas + analysis)
Output:
{
"agent": "Refiner Agent",
"topic": str,
"original_ideas": str,
"critique": str,
"refined_ideas": str,
"status": "refined"
}Responsibilities:
- Address identified weaknesses
- Enhance strengths
- Improve feasibility
- Add value propositions
- Mitigate risks
Purpose: Create final structured presentation
Input:
- Refined data from Refiner Agent (includes full workflow history)
Output:
{
"agent": "Presenter Agent",
"topic": str,
"presentation": str, # Markdown formatted
"generated_at": str, # ISO timestamp
"status": "completed"
}Responsibilities:
- Create executive summary
- Document creative process
- Present final recommendations
- Provide comparison analysis
- Suggest next steps
The A2A communication follows a sequential pipeline pattern where each agent:
- Receives structured data from the previous agent
- Processes the data using its specialized capabilities
- Augments the data with its analysis/output
- Passes the enriched data to the next agent
# Step 1: Idea Generation
topic = "User's creative topic"
ideas_data = idea_agent.generate_ideas(topic)
# Step 2: A2A Communication - Critic receives ideas
critique_data = critic_agent.analyze_ideas(ideas_data)
# Step 3: A2A Communication - Refiner receives critique
refined_data = refiner_agent.refine_ideas(critique_data)
# Step 4: A2A Communication - Presenter receives refined ideas
presentation_data = presenter_agent.create_presentation(refined_data)- Data Continuity: Each agent receives complete context from previous agents
- Accumulative Knowledge: Data structures grow with each step, maintaining full history
- Loose Coupling: Agents are independent and can be modified without affecting others
- Traceable: Complete audit trail of the creative process
- Extensible: New agents can be added to the pipeline
The system implements iterative refinement through:
- Initial Creation (Idea Agent): Raw creative concepts
- Critical Analysis (Critic Agent): Identification of flaws and opportunities
- Improvement (Refiner Agent): Enhancement based on feedback
- Finalization (Presenter Agent): Professional output
This creates a quality improvement loop where ideas evolve through multiple stages of analysis and refinement.
- Python 3.8+: Primary programming language
- Google Gemini 2.5 Flash: AI model for all agents
- google-genai: Modern Google Generative AI SDK
- python-dotenv: Environment configuration
# Each agent initializes with:
from google import genai
client = genai.Client(api_key=api_key)
model_name = "gemini-2.5-flash"
# Generate content with:
response = client.models.generate_content(
model=model_name,
contents=prompt
)Agents are organized in a sequential pipeline where output flows from one to the next.
Each agent implements a specific strategy (generate, analyze, refine, present).
Data structures accumulate information as they pass through the pipeline.
All agents follow a consistent initialization and execution pattern.
The CreativeStudio class in main.py orchestrates the entire workflow:
class CreativeStudio:
def __init__(self, api_key, model_name="gemini-2.5-flash"):
# Initialize all 4 agents
self.idea_agent = IdeaAgent(api_key, model_name)
self.critic_agent = CriticAgent(api_key, model_name)
self.refiner_agent = RefinerAgent(api_key, model_name)
self.presenter_agent = PresenterAgent(api_key, model_name)
def run(self, topic, save_output=True):
# Execute A2A workflow
ideas_data = self.idea_agent.generate_ideas(topic)
critique_data = self.critic_agent.analyze_ideas(ideas_data)
refined_data = self.refiner_agent.refine_ideas(critique_data)
presentation_data = self.presenter_agent.create_presentation(refined_data)
return resultsThis system exemplifies agentic AI because:
- Autonomous Agents: Each agent operates independently with its own logic
- Inter-Agent Communication: Agents communicate through structured data exchange
- Specialized Roles: Each agent has specific expertise and responsibilities
- Collaborative: Agents work together to achieve a common goal
- Adaptive: Output quality improves through agent collaboration
- Goal-Oriented: The system works toward producing high-quality creative output
Potential improvements to the A2A architecture:
- Parallel Processing: Run certain agents concurrently
- Feedback Loops: Allow Critic to re-evaluate refined ideas
- Agent Selection: Dynamically choose agents based on topic
- Multi-Model: Use different Gemini models for different agents
- State Management: Persist workflow state for resumption
- Agent Voting: Multiple agents vote on best ideas
- Human-in-the-Loop: Allow manual intervention at any stage
Each agent is isolated, so failures are contained:
try:
ideas_data = idea_agent.generate_ideas(topic)
except Exception as e:
# Handle Idea Agent failure
# Other agents are unaffected- Sequential Execution: Agents run one after another (not parallel)
- API Calls: 4 Gemini API calls per workflow
- Token Usage: Each agent uses tokens based on prompt complexity
- Latency: Total time = sum of all agent processing times
This Multi-Agent Creative Studio demonstrates a practical implementation of A2A communication with iterative refinement, showcasing how specialized AI agents can collaborate to produce superior creative output compared to a single monolithic AI system.