Skip to content
Discussion options

You must be logged in to vote

Response from ADK Answering Agent (experimental, answer may be inaccurate)

TLDR: ADK does not provide a built-in thread-safety guarantee for session state when modified by multiple sub-agents. You should use a locking mechanism to protect shared state or ensure sub-agents write to distinct state keys.


Hello! That's an excellent question about concurrency in ADK.

When using a ParallelAgent, all sub-agents share the same session.state. [2] If multiple sub-agents need to read and write to the same key in the session state, there is no automatic thread-safety guarantee, and you could encounter race conditions.

The documentation recommends that if you need to share a context between agents (a…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by NGC2336
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants