Skip to main content

Strands Examples

Strands Agents is AWS's open-source Python agent SDK. AgentVisor™ integrates natively with Strands — your agents run inside a hardened sandbox with policy enforcement, credential brokering, and durable snapshot-based checkpointing via Temporal.

Prerequisites​

  • Anthropic API key (or another LiteLLM-supported model endpoint) — the examples use Claude via LiteLLM and the AgentVisor proxy
  • Temporal — required for durable execution; running an example with --sandbox=none needs the Temporal CLI specifically (temporal server start-dev), not just a compose.yml-provided instance
  • AgentVisor CLI — agentvisor serve . starts the runtime
  • uvx on your PATH — used by the research agent's MCP fetch tool (pip install uv)
  • jq — used by the examples below to pretty-print API responses
  • Python virtual environment + SDK wheel — only needed for --sandbox=none; see Local Development Setup

Examples​

ExampleDifficultyKey Feature
Research AgentIntermediateWeb research with MCP tools, LiteLLM model, snapshot checkpointing
Graph Approval AgentAdvancedTwo-node Graph, MultiAgent checkpointing, interrupt/resume approval

How It Works​

Strands agents in AgentVisor work through the Strands framework provider:

  1. Selection: Strands has no discovery file, so mav-agent-config.yaml must explicitly set framework.provider: "strands"
  2. Schema extraction: register_agent() registers the root agent for schema extraction and runner resolution
  3. Execution: python3 -m agentvisor.strands.runner resolves the root agent, silences Strands' default stdout-printing callback handler, loads any prior snapshot for the thread, invokes the agent, and saves the resulting snapshot
  4. Checkpointing: agent.take_snapshot(preset="session")/agent.load_snapshot() are wired automatically through AgentVisor's simple checkpoint API, keyed by thread

Key Concepts​

ConceptWhat It IsWhere You'll See It
mav-agent-config.yamlRequired explicit provider selection (framework.provider: "strands")All examples
register_agent()Registers root agent for schema extraction and runner resolutionAll examples
agentvisor.strands.mcp.get_mcp_tools()Native MCP tool adapter (no LangChain dependency)Research Agent
Snapshot checkpointingtake_snapshot()/load_snapshot() wired through checkpoint.save()/load()Research Agent
MultiAgent checkpointingserialize_state()/deserialize_state() (Graph/Swarm) wired through the same checkpoint.save()/load() APIGraph Approval Agent
Interrupt/resumeevent.interrupt() from a BeforeToolCallEvent hook pauses a run for human approvalGraph Approval Agent
LiteLLM modelRecommended route to Bedrock; used directly against Anthropic hereResearch Agent, Graph Approval Agent

Quick Start​

# Create a project from the research agent template
agentvisor template create strands/research-agent
cd research-agent

export ANTHROPIC_API_KEY=your-api-key-here
temporal server start-dev &
agentvisor serve . --sandbox=none

See Also​

  • Strands Agents Guide — why mav-agent-config.yaml is required, checkpointing, MCP tools, and model provider guidance (including Bedrock via LiteLLM) in depth