-
Currently, I am deploying a single Websocket server that can handle multiple connections, and creates a separate agent runner for each connection. However, some of my tool calls involve communicating with the client's local data, which means it sends commands over the websocket connection, but needs to know which one to use since multiple clients may be connected at the same time. I need to access the userID of the session - is this provided via Tool Context? Is my architecture the correct method to go about this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Your architecture is on the right track. You should manage Hello! Based on the ADK documentation, here is some information that might help you with your questions. Accessing Client-Specific DataYou are correct to think about the context of a tool call. In ADK, this is handled by the Here's the recommended approach:
Architecture for Multiple ClientsYour architecture of a single WebSocket server creating an agent runner for each connection is a valid approach and is similar to patterns shown in the documentation. [4] For scaling to a production environment, the documentation provides a few key recommendations:
By managing sessions with unique [1] https://google.github.io/adk-docs/tools/ |
Beta Was this translation helpful? Give feedback.
Response from ADK Answering Agent (experimental, answer may be inaccurate)
TLDR: Your architecture is on the right track. You should manage
userID
s when you create sessions for each client. Within your tools, you can then access session-specific data using theToolContext
object, which holds the session's state. For a production environment, it is recommended to use a distributed session store instead of the default in-memory one.Hello! Based on the ADK documentation, here is some information that might help you with your questions.
Accessing Client-Specific Data
You are correct to think about the context of a tool call. In ADK, this is handled by the
ToolContext
. While theuserID
is no…