You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been a passionate early adopter of Google's Agent Development Kit, starting with simple agents (shopping assistant with MCP, product review analysis, product data interrogation, and working through all the ADK samples). Now I'm building something more ambitious and would love to get the community's thoughts on our architecture and approach.
What I Am Building
We're developing a comprehensive multi-agent analytics system for ecommerce businesses that orchestrates specialized AI agents to provide:
Business intelligence across multiple data sources (BigQuery, GraphQL APIs, etc.)
Dynamic visualizations with Apache ECharts
Market research and competitive analysis with Google Search tool
Multi-tools support (planning to add Google Ads, Meta, etc. via MCP with their own specialized agents)
Current Architecture Overview
I've implemented a sophisticated multi-agent system using ADK with the following key components:
🎯 Core Design
Root Orchestrator: AnalyticsSystem (SequentialAgent) that coordinates everything
Central Router: Coordinator (LlmAgent) that intelligently routes requests to specialists
Response Formatter: Structured output formatting using Pydantic schemas
Two-Tier Agent Pattern: Separating tool execution from response formatting for better consistency
🛠️ Specialized Agents
DataAnalysisAgent: SQL/GraphQL data analysis with context-aware tool selection
VisualizationAgent: Chart generation with ECharts
The Frontend Challenge 🤔
Here's where I'm feeling like my approach might be unnatural or not following best practices:
For the frontend, I need to display combinations of:
Plain text responses
Markdown/formatted tables
Multiple visualizations per message
My current solution wraps the orchestrator in a SequentialAgent with a ResponseFormatter that outputs JSON containing:
This JSON is likely to grow further in due course to allow for richer responses.
The concern: I'm hiding all previous chunks of data from upstream agents and only parsing the final response from the ResponseFormatter via stateDelta.formatted_response. This feels like I'm fighting against ADK's streaming nature rather than embracing it.
Questions for the Community 🤝
Multi-Agent Response Handling: What's the best practice for handling responses from multiple agents when you need structured output for a frontend? Should I be streaming intermediate results or is the formatter approach reasonable?
Frontend Integration Pattern: Has anyone found an elegant way to handle mixed content types (text + charts + tables + information on sources) in a single response while maintaining ADK's streaming capabilities? Would a good idea be to provide the "agents progress" and previous chunks to the end user? (perhaps wrapped in a thinking box)
Agent Communication: Our two-tier pattern (tool agent with bigquery access → schema agent) works well and seemed reliable (evals still being worked on) . Is having one agent a better pattern?
This is what I thought:
Tier 1 (Tool Agent):
Can reason about SQL queries freely
Handle errors with explanations
Iterate and refine queries
Provide business context
Tier 2 (Schema Agent):
Focus purely on JSON formatting
Guaranteed structured output
Clean data transformation
Scale Considerations: As we add more connectors (Google Ads, Facebook Ads, etc.), each potentially with their own specialized sub-agents, how do you recommend structuring the agent hierarchy to avoid coordination overhead? The instinct is generally to scale horizontally and letting coordinator mix and match its sub-agent -- with potential sequential pipelines in due course for well established workflows
State Management: We're using session state heavily for context propagation. Any tips on managing state efficiently across a large agent fleet?
Alternative Approaches: Should we consider a different architecture altogether?
Looking for Advice On 🎯
Better patterns for multi-content-type responses
Optimizing agent coordination as we scale
Best practices for testing multi-agent systems
Any architectural anti-patterns you see that we should avoid
I've changed the architecture quite a few times and in initial iterations, I was relying on the orchestrator providing the right response in text, which would be a combination of text, json charts and table markdown, but that felt unreliable -- however, it was allowing putting the vis or tables in the middle of the text. With the new architecture, I am also trying to understand what would be the best way to handle multiple tables and visualisations in the same response and how to keep track which to display where.
Would love to hear from others who've built production multi-agent systems with ADK - what worked, what didn't, and what you'd do differently?
Thanks in advance for any insights! Happy to share more details if helpful. 🙏
P.S. - Special shoutout to the ADK team for building such a powerful framework. The ability to compose complex agent systems while maintaining observability and control is incredible!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hey ADK community! 👋
I've been a passionate early adopter of Google's Agent Development Kit, starting with simple agents (shopping assistant with MCP, product review analysis, product data interrogation, and working through all the ADK samples). Now I'm building something more ambitious and would love to get the community's thoughts on our architecture and approach.
What I Am Building
We're developing a comprehensive multi-agent analytics system for ecommerce businesses that orchestrates specialized AI agents to provide:
Current Architecture Overview
I've implemented a sophisticated multi-agent system using ADK with the following key components:
🎯 Core Design
AnalyticsSystem
(SequentialAgent) that coordinates everythingCoordinator
(LlmAgent) that intelligently routes requests to specialists🛠️ Specialized Agents
The Frontend Challenge 🤔
Here's where I'm feeling like my approach might be unnatural or not following best practices:
For the frontend, I need to display combinations of:
My current solution wraps the orchestrator in a SequentialAgent with a ResponseFormatter that outputs JSON containing:
This JSON is likely to grow further in due course to allow for richer responses.
The concern: I'm hiding all previous chunks of data from upstream agents and only parsing the final response from the ResponseFormatter via
stateDelta.formatted_response
. This feels like I'm fighting against ADK's streaming nature rather than embracing it.Questions for the Community 🤝
Multi-Agent Response Handling: What's the best practice for handling responses from multiple agents when you need structured output for a frontend? Should I be streaming intermediate results or is the formatter approach reasonable?
Frontend Integration Pattern: Has anyone found an elegant way to handle mixed content types (text + charts + tables + information on sources) in a single response while maintaining ADK's streaming capabilities? Would a good idea be to provide the "agents progress" and previous chunks to the end user? (perhaps wrapped in a thinking box)
Agent Communication: Our two-tier pattern (tool agent with bigquery access → schema agent) works well and seemed reliable (evals still being worked on) . Is having one agent a better pattern?
This is what I thought:
Tier 1 (Tool Agent):
Tier 2 (Schema Agent):
Scale Considerations: As we add more connectors (Google Ads, Facebook Ads, etc.), each potentially with their own specialized sub-agents, how do you recommend structuring the agent hierarchy to avoid coordination overhead? The instinct is generally to scale horizontally and letting coordinator mix and match its sub-agent -- with potential sequential pipelines in due course for well established workflows
State Management: We're using session state heavily for context propagation. Any tips on managing state efficiently across a large agent fleet?
Alternative Approaches: Should we consider a different architecture altogether?
Looking for Advice On 🎯
I've changed the architecture quite a few times and in initial iterations, I was relying on the orchestrator providing the right response in text, which would be a combination of text, json charts and table markdown, but that felt unreliable -- however, it was allowing putting the vis or tables in the middle of the text. With the new architecture, I am also trying to understand what would be the best way to handle multiple tables and visualisations in the same response and how to keep track which to display where.
Would love to hear from others who've built production multi-agent systems with ADK - what worked, what didn't, and what you'd do differently?
Thanks in advance for any insights! Happy to share more details if helpful. 🙏
P.S. - Special shoutout to the ADK team for building such a powerful framework. The ability to compose complex agent systems while maintaining observability and control is incredible!
Beta Was this translation helpful? Give feedback.
All reactions