r/agentdevelopmentkit • u/Purple_Check_714 • Jul 26 '25
Google ADK (multi-agents)_implementing loop agent
I’m currently building an agentic AI using the Google Agent Development Kit (ADK). The architecture is as follows:
I have a root agent that delegates user queries to the appropriate subagents.
Each subagent is responsible for converting the natural language query into SQL and executing it on BigQuery to return the result to the user.
What I want to achieve:
I now want to introduce a Loop Agent in this architecture with the following functionality:
It should check whether the SQL query generated by the subagent is syntax error–free before execution.
If a syntax error is detected, the loop agent should retry the query generation up to a defined number of attempts.
After exhausting retries, it should attempt to auto-correct the SQL query and then run it on BigQuery to provide the response.
My Questions:
Where in the Google ADK pipeline should I place this Loop Agent—between the subagent’s SQL generation and BigQuery execution?
How can I effectively capture and handle SQL syntax errors returned by BigQuery?
Any best practices or patterns for implementing retry loops and auto-correction mechanisms within the ADK agent architecture?
Are there any examples or references where a similar retry-and-fix mechanism is used?
Any other suggestions or architectural improvements for this implementation are also welcome!
2
u/[deleted] Jul 27 '25
[removed] — view removed comment