Skip to content

Tools - Execution Strategy #490

@pgrayy

Description

@pgrayy

Summary

Configure tool calls to run either sequentially or concurrently when a model returns multiple tool calls.

Usage

⚠️ Agent-generated example - This is a preliminary API sketch and has not been finalized.

import { Agent } from '@strands-agents/sdk'
import { SequentialExecutor, ConcurrentExecutor } from '@strands-agents/sdk/tools'

// Sequential execution (default, safer)
const sequentialAgent = new Agent({
  model,
  tools: [tool1, tool2],
  toolExecutor: new SequentialExecutor(),
})

// Concurrent execution (faster for independent tools)
const concurrentAgent = new Agent({
  model,
  tools: [tool1, tool2],
  toolExecutor: new ConcurrentExecutor({
    maxConcurrency: 5,
  }),
})

Documentation

https://strandsagents.com/latest/documentation/docs/user-guide/concepts/tools/executors/

Reference

https://github.com/strands-agents/sdk-python/tree/main/src/strands/tools/executors

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsItems associated with tools.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions