Can I pass user_id from root agent to remote a2a agent? #3176
Replies: 2 comments
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: Yes, you can and should pass the Hello! That's an excellent question. The Agent Development Kit (ADK) is designed to maintain user context across different agents, which is crucial for features like the memory bank. When your root agent interacts with a remote agent (e.g., one deployed on Agent Engine), you can pass the Here is an example of how you would interact with a remote agent and pass the # When creating a session for a specific user
remote_session = await remote_app.async_create_session(user_id="USER_ID_FROM_ROOT")
# When sending a query within that user's session
async for event in remote_app.async_stream_query(
user_id="USER_ID_FROM_ROOT",
session_id=remote_session["id"],
message="your message here",
):
print(event) By passing the The ADK's internal mechanics for Agent-to-Agent (A2A) communication also rely on a context ID that is composed of the app name, user ID, and session ID, ensuring that the user's context is propagated correctly between agents [3, 4]. [1] Deploy to Vertex AI Agent Engine: https://google.github.io/adk-docs/deploy/agent-engine/ |
Beta Was this translation helpful? Give feedback.
-
it seems to be source code to call remote root agent not a2a agent. but no problem. i will ask this question in "https://github.com/a2aproject/a2a-python" instead. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to use memory bank on remote a2a agent deployed by agent engine.
it will be useful only when the remote agents recognize the end users and be able to query memories for the users identified by "user_id".
i understand that memories are managed in user scope.
Beta Was this translation helpful? Give feedback.
All reactions