Use this recipe when one agent turn can safely call several independent local tools and you want the runtime to execute them concurrently while still preserving deterministic tool-result ordering.Documentation Index
Fetch the complete documentation index at: https://docs.ai-stats.phaseo.app/llms.txt
Use this file to discover all available pages before exploring further.
When to use this
UsetoolExecution.toolConcurrency when:
- the model can emit multiple local tool calls in one turn
- those tools do not depend on each other’s output
- serial execution would waste worker time
- you still want persisted tool-result messages to stay in the original tool-call order
Example
packages/sdk/agent-sdk-ts/examples/parallel-tool-agent.ts.
What the runtime guarantees
- local tools can execute concurrently up to the configured
toolConcurrency tool.startedandtool.completedevents still emit per tool- persisted tool-result messages stay in the original tool-call order
- checkpointing still happens after the tool phase completes
- tool timeouts still apply per tool through
timeoutMs
Operational guidance
- start with a small concurrency value such as
2or3 - keep local tools idempotent and side-effect light
- use
timeoutMsso one stuck dependency does not waste all worker slots - only add
storewhen your application actually needs resumability or remote coordination
Validation
After enabling this pattern:- run the exact agent loop tests that cover multi-tool turns
- confirm the workflow still produces ordered tool-result messages
- confirm operator logs still show the expected
tool.startedandtool.completedevents