Skip to content

feat: Introduce PersistentAgentTool for observable agent-as-tool execution#990

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
test_880895506
Open

feat: Introduce PersistentAgentTool for observable agent-as-tool execution#990
copybara-service[bot] wants to merge 1 commit intomainfrom
test_880895506

Conversation

@copybara-service
Copy link

feat: Introduce PersistentAgentTool for observable agent-as-tool execution

This change introduces PersistentAgentTool, a new tool that allows an ADK agent to invoke another agent as a tool while enabling improved observability and state management.

Unlike the existing AgentTool, which uses an in-memory runner for sub-agent execution, PersistentAgentTool is designed to be used with externally provided session and artifact services. This allows all events and state changes from the sub-agent's execution to be logged to the calling agent's session, which is critical when using persistent session storage for debugging and tracing complex, multi-step agent workflows.

PersistentAgentTool collects all events from the sub-agent's execution, propagates all state changes back to the caller's tool context, and returns the sub-agent's final result along with a full execution trace. This enables robust orchestration patterns where one agent can decompose a task and delegate steps to other agents as tools, while maintaining full visibility into each step.

…ution

This change introduces `PersistentAgentTool`, a new tool that allows an ADK agent to invoke another agent as a tool while enabling improved observability and state management.

Unlike the existing `AgentTool`, which uses an in-memory runner for sub-agent execution, `PersistentAgentTool` is designed to be used with externally provided session and artifact services. This allows all events and state changes from the sub-agent's execution to be logged to the calling agent's session, which is critical when using persistent session storage for debugging and tracing complex, multi-step agent workflows.

`PersistentAgentTool` collects all events from the sub-agent's execution, propagates all state changes back to the caller's tool context, and returns the sub-agent's final result along with a full execution trace. This enables robust orchestration patterns where one agent can decompose a task and delegate steps to other agents as tools, while maintaining full visibility into each step.

PiperOrigin-RevId: 880895506
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant