Tool and LLM retry mechanisms and checkpoints
Hello,
I opened a discussion for this here: https://github.com/google/adk-python/discussions/3187 ...but I figured I'd also create an issue for it:
As part of building agentic workflows, I was wondering if the ADK core team will add some retry mechanisms and checkpoints to both model and tool invocations? Some issues I face is within multi-agent systems - where there may be an error caught via a callback or plugin, but no reliable way to reroute to an earlier step (or even retry the failed event). Especially in Multi-Agent workflows, this is tough to manage in ADK today.
E.g. let's say we have a Sequential which has 3 subagents [CategorizationAgent, ValidatorAgent, FinalizeAgent]
[Scenario 1] What if we have a tool hallucination error during the FinalizeAgent (an unknown tool is called), and we wish to just have the FinalizeAgent retry the tool calling process (no current way to do this).
[Scenario 2] We get an error with Agent to Agent handoffs and the output from one agent causes an input-Pydantic formatting error. Let's say the ValidatorAgent has a "validatedOutput", and the FinalizeAgent expects this validatedOutput to have a certain format, but in this case, the formatting is malformed... in this case, we'd want to retry from a certain "event checkpoint" in the prior agent (ValidatorAgent) with context on what the error was, to have the LLM generate a properly formatted answer.
The idea of checkpoints could be interesting to add to ADK in general along with retry mechanisms for both Tools and LLMs.
Alternative: At the moment, I am inclined to rely on another tool to better facilitate such workflow orchestration features (such as n8n), and only relying on ADK for the core agent / LLM logic (limiting my usage of workflow agents in general).
Thanks!
retry is supported here: https://github.com/google/adk-python/blob/main/src/google/adk/plugins/reflect_retry_tool_plugin.py
for checkpoint, it's supported as resume and rewind. Please check our hompage readme to learn more(documentation is still being worked on.) closing this for now.