Storing data in sub agents temporarily #3899
Replies: 1 comment
-
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Yes, this is possible in ADK by creating a stateful tool. You can use the Hello! That's an excellent question about managing state within agents. You can definitely achieve the behavior you're describing. The key is to make your sub-agent (the tool) stateful. In ADK, any tool can be designed to access and modify a persistent session state. This state is managed by ADK's Here’s how it works:
For your scenario, the implementation would look something like this:
This approach ensures that the root agent has no visibility into the The ADK documentation has a great example of a stateful tool called [1] Agent Teaming Tutorial |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is what I am trying to do:
root agent sends user input to sub agent (exposed as Tool) -> Sub Agent does some calculations (let's call it 'sol' ) and returns plain text explaining saying it is done . Root agent has no idea of calculations done inside agentTool. Is there a way to temporarily store 'sol' data in the same session without using external storage like db or passing it as output_key? The agent tool should withhold this 'sol' data until a human feedback is sent (human->root->agent Tool) and then store it into db.
The whole point is to not let root agent know anything about what is happening inside sub agent tool.
Is this possible? how to do this?
Beta Was this translation helpful? Give feedback.
All reactions