Strands Agents 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
- AgentVisor CLI —
agentvisor serve .starts the runtime uvxon yourPATH— used by the research agent's MCP fetch tool (pip install uv)
Examples
| Example | Difficulty | Key Feature |
|---|---|---|
| Research Agent | Intermediate | Web research with MCP tools, LiteLLM model, snapshot checkpointing |
| Graph Approval Agent | Advanced | Two-node Graph, MultiAgent checkpointing, interrupt/resume approval |
How It Works
Strands agents in AgentVisor work through the Strands framework provider:
- Selection: Strands has no discovery file, so
mav-agent-config.yamlmust explicitly setframework.provider: "strands" - Schema extraction:
register_agent()registers the root agent for schema extraction and runner resolution - Execution:
python3 -m agentvisor.strands.runnerresolves 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 - Checkpointing:
agent.take_snapshot(preset="session")/agent.load_snapshot()are wired automatically through AgentVisor's simple checkpoint API, keyed by thread
Key Concepts
| Concept | What It Is | Where You'll See It |
|---|---|---|
mav-agent-config.yaml | Required explicit provider selection (framework.provider: "strands") | All examples |
register_agent() | Registers root agent for schema extraction and runner resolution | All examples |
agentvisor.strands.mcp.get_mcp_tools() | Native MCP tool adapter (no LangChain dependency) | Research Agent |
| Snapshot checkpointing | take_snapshot()/load_snapshot() wired through checkpoint.save()/load() | Research Agent |
| MultiAgent checkpointing | serialize_state()/deserialize_state() (Graph/Swarm) wired through the same checkpoint.save()/load() API | Graph Approval Agent |
| Interrupt/resume | event.interrupt() from a BeforeToolCallEvent hook pauses a run for human approval | Graph Approval Agent |
| LiteLLM model | Proven production route to Bedrock; used directly against Anthropic here | Research Agent, Graph Approval Agent |
For a deep dive into Strands integration — including why mav-agent-config.yaml is required, checkpointing, MCP tools, and model provider guidance (including Bedrock via LiteLLM) — see the Strands Agents Guide.
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