[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6G5VDSKW659NB1GP2FVZ25R":3,"skill-same:01M6G5VDSKW659NB1GP2FVZ25R":97},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":37,"linkOnly":38,"markdownContent":39,"markdownBody":40,"frontMatter":41,"refName":52,"commitSha":53,"skillDirectory":54,"forksCount":55,"repositoryHtmlUrl":56,"repositoryHomepageUrl":6,"ownerHtmlUrl":57,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":58,"install":59,"resources":72},"01M6G5VDSKW659NB1GP2FVZ25R","strands",null,"Build and run Python-based AI agents using the AWS Strands SDK. Use when you need to create autonomous agents, multi-agent workflows, custom tools, or integrate with MCP servers. Supports Ollama (local), Anthropic, OpenAI, Bedrock, and other model providers. Use for agent scaffolding, tool creation, and running agent tasks programmatically.","kbarbel640-del\u002Fskills","kbarbel640-del","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F255315490?v=4","01M6CJPPQGCCESXMG3K7BBGQ5J","01M6CJPPX2PB2BCZERFVM2C2B3",1,"MIT","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002FSKILL.md",[],[5,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36],"autonomous","agent tasks","you","bedrock","creation","local","with mcp","scaffolding","integrate","MCP","ollama","multi-agent","model","openai","run","create","tasks","workflows","ai agents","2026-11-10 10:12:30",false,"---\nname: strands\nversion: 2.0.0\ndescription: Build and run Python-based AI agents using the AWS Strands SDK. Use when you need to create autonomous agents, multi-agent workflows, custom tools, or integrate with MCP servers. Supports Ollama (local), Anthropic, OpenAI, Bedrock, and other model providers. Use for agent scaffolding, tool creation, and running agent tasks programmatically.\nhomepage: https:\u002F\u002Fgithub.com\u002Fstrands-agents\u002Fsdk-python\nmetadata:\n  openclaw:\n    emoji: ?\n    requires:\n      bins: [python3]\n      packages: [strands-agents]\n---\n\n# Strands Agents SDK\n\nBuild AI agents in Python using the [Strands SDK](https:\u002F\u002Fgithub.com\u002Fstrands-agents\u002Fsdk-python) (Apache-2.0, from AWS).\n\nValidated against: `strands-agents==1.23.0`, `strands-agents-tools==0.2.19`\n\n## Prerequisites\n\n```bash\n# Install SDK + tools (via pipx for isolation — recommended)\npipx install strands-agents-builder  # includes strands-agents + strands-agents-tools + CLI\n\n# Or install directly\npip install strands-agents strands-agents-tools\n```\n\n## Core Concept: Bedrock Is the Default\n\n`Agent()` with no `model=` argument defaults to **Amazon Bedrock** — specifically `us.anthropic.claude-sonnet-4-20250514-v1:0` in `us-west-2`. This requires AWS credentials. To use a different provider, pass `model=` explicitly.\n\nDefault model constant: `strands.models.bedrock.DEFAULT_BEDROCK_MODEL_ID`\n\n## Quick Start — Local Agent (Ollama)\n\n```python\nfrom strands import Agent\nfrom strands.models.ollama import OllamaModel\n\n# host is a required positional argument\nmodel = OllamaModel(\"http:\u002F\u002Flocalhost:11434\", model_id=\"qwen3:latest\")\nagent = Agent(model=model)\nresult = agent(\"What is the capital of France?\")\nprint(result)\n```\n\n**Note:** Not all open-source models support tool-calling. Abliterated models often lose function-calling during the abliteration process. Test with a stock model (qwen3, llama3.x, mistral) first.\n\n## Quick Start — Bedrock (Default Provider)\n\n```python\nfrom strands import Agent\n\n# No model specified → BedrockModel (Claude Sonnet 4, us-west-2)\n# Requires AWS credentials (~\u002F.aws\u002Fcredentials or env vars)\nagent = Agent()\nresult = agent(\"Explain quantum computing\")\n\n# Explicit Bedrock model:\nfrom strands.models import BedrockModel\nmodel = BedrockModel(model_id=\"us.anthropic.claude-sonnet-4-20250514-v1:0\")\nagent = Agent(model=model)\n```\n\n## Quick Start — Anthropic (Direct API)\n\n```python\nfrom strands import Agent\nfrom strands.models.anthropic import AnthropicModel\n\n# max_tokens is Required[int] — must be provided\nmodel = AnthropicModel(model_id=\"claude-sonnet-4-20250514\", max_tokens=4096)\nagent = Agent(model=model)\nresult = agent(\"Explain quantum computing\")\n```\n\nRequires `ANTHROPIC_API_KEY` environment variable.\n\n## Quick Start — OpenAI\n\n```python\nfrom strands import Agent\nfrom strands.models.openai import OpenAIModel\n\nmodel = OpenAIModel(model_id=\"gpt-4.1\")\nagent = Agent(model=model)\n```\n\nRequires `OPENAI_API_KEY` environment variable.\n\n## Creating Custom Tools\n\nUse the `@tool` decorator. Type hints become the schema; the docstring becomes the description:\n\n```python\nfrom strands import Agent, tool\n\n@tool\ndef read_file(path: str) -> str:\n    \"\"\"Read contents of a file at the given path.\n\n    Args:\n        path: Filesystem path to read.\n    \"\"\"\n    with open(path) as f:\n        return f.read()\n\n@tool\ndef write_file(path: str, content: str) -> str:\n    \"\"\"Write content to a file.\n\n    Args:\n        path: Filesystem path to write.\n        content: Text content to write.\n    \"\"\"\n    with open(path, 'w') as f:\n        f.write(content)\n    return f\"Wrote {len(content)} bytes to {path}\"\n\nagent = Agent(model=model, tools=[read_file, write_file])\nagent(\"Read \u002Ftmp\u002Ftest.txt and summarize it\")\n```\n\n### ToolContext\n\nTools can access agent state via `ToolContext`:\n\n```python\nfrom strands import tool\nfrom strands.types.tools import ToolContext\n\n@tool\ndef stateful_tool(query: str, tool_context: ToolContext) -> str:\n    \"\"\"A tool that accesses agent state.\n\n    Args:\n        query: Input query.\n    \"\"\"\n    # Access shared agent state\n    count = tool_context.state.get(\"call_count\", 0) + 1\n    tool_context.state[\"call_count\"] = count\n    return f\"Call #{count}: {query}\"\n```\n\n## Built-in Tools (46 available)\n\n`strands-agents-tools` provides pre-built tools:\n\n```python\nfrom strands_tools import calculator, file_read, file_write, shell, http_request\nagent = Agent(model=model, tools=[calculator, file_read, shell])\n```\n\nFull list: `calculator`, `file_read`, `file_write`, `shell`, `http_request`, `editor`, `image_reader`, `python_repl`, `current_time`, `think`, `stop`, `sleep`, `environment`, `retrieve`, `search_video`, `chat_video`, `speak`, `generate_image`, `generate_image_stability`, `diagram`, `journal`, `memory`, `agent_core_memory`, `elasticsearch_memory`, `mongodb_memory`, `mem0_memory`, `rss`, `cron`, `batch`, `workflow`, `use_agent`, `use_llm`, `use_aws`, `use_computer`, `load_tool`, `handoff_to_user`, `slack`, `swarm`, `graph`, `a2a_client`, `mcp_client`, `exa`, `tavily`, `bright_data`, `nova_reels`.\n\nHot reload: `Agent(load_tools_from_directory=True)` watches `.\u002Ftools\u002F` for changes.\n\n## MCP Integration\n\nConnect to any Model Context Protocol server. MCPClient implements `ToolProvider` — pass it directly in the tools list:\n\n```python\nfrom strands import Agent\nfrom strands.tools.mcp import MCPClient\nfrom mcp import stdio_client, StdioServerParameters\n\n# MCPClient takes a callable that returns the transport\nmcp = MCPClient(lambda: stdio_client(StdioServerParameters(\n    command=\"uvx\",\n    args=[\"some-mcp-server@latest\"]\n)))\n\n# Use as context manager — MCPClient is a ToolProvider\nwith mcp:\n    agent = Agent(model=model, tools=[mcp])\n    agent(\"Use the MCP tools to do something\")\n```\n\nSSE transport:\n```python\nfrom mcp.client.sse import sse_client\nmcp = MCPClient(lambda: sse_client(\"http:\u002F\u002Flocalhost:8080\u002Fsse\"))\n```\n\n## Multi-Agent Patterns\n\n### Agents as Tools\n\nNest agents — inner agents become tools for the outer agent:\n\n```python\nresearcher = Agent(model=model, system_prompt=\"You are a research assistant.\")\nwriter = Agent(model=model, system_prompt=\"You are a writer.\")\n\norchestrator = Agent(\n    model=model,\n    tools=[researcher, writer],\n    system_prompt=\"You coordinate research and writing tasks.\"\n)\norchestrator(\"Research quantum computing and write a blog post\")\n```\n\n### Swarm Pattern\n\nSelf-organizing agent teams with shared context and autonomous handoff coordination:\n\n```python\nfrom strands.multiagent.swarm import Swarm\n\n# Agents need name + description for handoff identification\nresearcher = Agent(\n    model=model,\n    name=\"researcher\",\n    description=\"Finds and summarizes information\"\n)\nwriter = Agent(\n    model=model,\n    name=\"writer\",\n    description=\"Creates polished content\"\n)\n\nswarm = Swarm(\n    nodes=[researcher, writer],\n    entry_point=researcher,    # optional — defaults to first agent\n    max_handoffs=20,           # default\n    max_iterations=20,         # default\n    execution_timeout=900.0,   # 15 min default\n    node_timeout=300.0         # 5 min per node default\n)\nresult = swarm(\"Research AI agents, then hand off to writer for a blog post\")\n```\n\nSwarm auto-injects a `handoff_to_agent` tool. Agents hand off by calling it with the target agent's name. Supports interrupt\u002Fresume, session persistence, and repetitive-handoff detection.\n\n### Graph Pattern (DAG)\n\nDeterministic dependency-based execution via `GraphBuilder`:\n\n```python\nfrom strands.multiagent.graph import GraphBuilder\n\nbuilder = GraphBuilder()\nresearch_node = builder.add_node(researcher, node_id=\"research\")\nwriting_node = builder.add_node(writer, node_id=\"writing\")\nbuilder.add_edge(\"research\", \"writing\")\nbuilder.set_entry_point(\"research\")\n\n# Optional: conditional edges\n# builder.add_edge(\"research\", \"writing\",\n#     condition=lambda state: \"complete\" in str(state.completed_nodes))\n\ngraph = builder.build()\nresult = graph(\"Write a blog post about AI agents\")\n```\n\nSupports cycles (feedback loops) with `builder.reset_on_revisit(True)`, execution timeouts, and nested graphs (Graph as a node in another Graph).\n\n### A2A Protocol (Agent-to-Agent)\n\nExpose a Strands agent as an A2A-compatible server for inter-agent communication:\n\n```python\nfrom strands.multiagent.a2a import A2AServer\n\nserver = A2AServer(\n    agent=my_agent,\n    host=\"127.0.0.1\",\n    port=9000,\n    version=\"0.0.1\"\n)\nserver.start()  # runs uvicorn\n```\n\nConnect to A2A agents with the `a2a_client` tool from strands-agents-tools. A2A implements Google's Agent-to-Agent protocol for standardized cross-process\u002Fcross-network agent communication.\n\n## Session Persistence\n\nPersist conversations across agent runs:\n\n```python\nfrom strands.session.file_session_manager import FileSessionManager\n\nsession = FileSessionManager(session_file_path=\".\u002Fsessions\u002Fmy_session.json\")\nagent = Agent(model=model, session_manager=session)\n\n# Also available:\nfrom strands.session.s3_session_manager import S3SessionManager\nsession = S3SessionManager(bucket_name=\"my-bucket\", session_id=\"session-1\")\n```\n\nBoth Swarm and Graph support session managers for persisting multi-agent state.\n\n## Bidirectional Streaming (Experimental)\n\nReal-time voice\u002Ftext conversations with persistent audio streams:\n\n```python\nfrom strands.experimental.bidi.agent import BidiAgent\nfrom strands.experimental.bidi.models.nova_sonic import NovaSonicModel\n\n# Supports: NovaSonicModel, GeminiLiveModel, OpenAIRealtimeModel\nmodel = NovaSonicModel(region=\"us-east-1\")\nagent = BidiAgent(model=model, tools=[my_tool])\n```\n\nSupports interruption detection, concurrent tool execution, and continuous back-and-forth audio. Experimental — API subject to change.\n\n## System Prompts\n\n```python\nagent = Agent(\n    model=model,\n    system_prompt=\"You are Hex, a sharp and witty AI assistant.\",\n    tools=[read_file, write_file]\n)\n```\n\nStrands also supports `list[SystemContentBlock]` for structured system prompts with cache control.\n\n## Observability\n\nNative OpenTelemetry tracing:\n\n```python\nagent = Agent(\n    model=model,\n    trace_attributes={\"project\": \"my-agent\", \"environment\": \"dev\"}\n)\n```\n\nEvery tool call, model invocation, handoff, and lifecycle event is instrumentable.\n\n## Bedrock-Specific Features\n\n- **Guardrails**: `guardrail_id` + `guardrail_version` in BedrockModel config — content filtering, PII detection, input\u002Foutput redaction\n- **Cache points**: System prompt and tool definition caching for cost optimization\n- **Streaming**: On by default, disable with `streaming=False`\n- **Region**: Defaults to `us-west-2`, override via `region_name` param or `AWS_REGION` env\n- **Cross-region inference**: Model IDs prefixed with `us.` use cross-region inference profiles\n\n## Scaffolding a New Agent\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider ollama --model qwen3:latest\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider anthropic\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider bedrock\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider openai --model gpt-4.1\n```\n\nCreates a ready-to-run agent directory with tools, config, and entry point.\n\n## Running an Agent\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Frun-agent.py path\u002Fto\u002Fagent.py \"Your prompt here\"\npython3 {baseDir}\u002Fscripts\u002Frun-agent.py path\u002Fto\u002Fagent.py --interactive\n```\n\n## Model Providers Reference (11 total)\n\n| Provider | Class | Init | Notes |\n|----------|-------|------|-------|\n| Bedrock | `BedrockModel` | `BedrockModel(model_id=...)` | **Default**, eagerly imported |\n| Ollama | `OllamaModel` | `OllamaModel(\"http:\u002F\u002Fhost:11434\", model_id=...)` | `host` is positional |\n| Anthropic | `AnthropicModel` | `AnthropicModel(model_id=..., max_tokens=4096)` | `max_tokens` **required** |\n| OpenAI | `OpenAIModel` | `OpenAIModel(model_id=...)` | `OPENAI_API_KEY` |\n| Gemini | `GeminiModel` | `GeminiModel(model_id=...)` | `api_key` in client_args |\n| Mistral | `MistralModel` | `MistralModel(model_id=...)` | Mistral API key |\n| LiteLLM | `LiteLLMModel` | `LiteLLMModel(model_id=...)` | Meta-provider (Cohere, Groq, etc.) |\n| LlamaAPI | `LlamaAPIModel` | `LlamaAPIModel(model_id=...)` | Meta Llama API |\n| llama.cpp | `LlamaCppModel` | `LlamaCppModel(...)` | Local server, OpenAI-compatible |\n| SageMaker | `SageMakerAIModel` | `SageMakerAIModel(...)` | Custom AWS endpoints |\n| Writer | `WriterModel` | `WriterModel(model_id=...)` | Writer platform |\n\nAll non-Bedrock providers are **lazy-loaded** — dependencies imported only when referenced.\n\nImport pattern: `from strands.models.\u003Cprovider> import \u003CClass>` (or `from strands.models import \u003CClass>` for lazy-load).\n\n## Tips\n\n- `Agent()` without `model=` requires AWS credentials (Bedrock default)\n- `AnthropicModel` requires `max_tokens` — omitting it causes a runtime error\n- `OllamaModel` `host` is positional: `OllamaModel(\"http:\u002F\u002F...\", model_id=\"...\")`\n- Abliterated Ollama models often lose tool-calling support — use stock models for tool-using agents\n- Swarm agents need `name=` and `description=` for handoff routing\n- `Agent(load_tools_from_directory=True)` watches `.\u002Ftools\u002F` for hot-reloaded tool files\n- Use `agent.tool.my_tool()` to call tools directly without LLM routing\n- `MCPClient` is a `ToolProvider` — pass it directly in `tools=[mcp]`, don't call `list_tools_sync()` manually when using with Agent\n- Session managers work with Agent, Swarm, and Graph\n- Pin your `strands-agents` version — the SDK is young and APIs evolve between releases\n","# Strands Agents SDK\n\nBuild AI agents in Python using the [Strands SDK](https:\u002F\u002Fgithub.com\u002Fstrands-agents\u002Fsdk-python) (Apache-2.0, from AWS).\n\nValidated against: `strands-agents==1.23.0`, `strands-agents-tools==0.2.19`\n\n## Prerequisites\n\n```bash\n# Install SDK + tools (via pipx for isolation — recommended)\npipx install strands-agents-builder  # includes strands-agents + strands-agents-tools + CLI\n\n# Or install directly\npip install strands-agents strands-agents-tools\n```\n\n## Core Concept: Bedrock Is the Default\n\n`Agent()` with no `model=` argument defaults to **Amazon Bedrock** — specifically `us.anthropic.claude-sonnet-4-20250514-v1:0` in `us-west-2`. This requires AWS credentials. To use a different provider, pass `model=` explicitly.\n\nDefault model constant: `strands.models.bedrock.DEFAULT_BEDROCK_MODEL_ID`\n\n## Quick Start — Local Agent (Ollama)\n\n```python\nfrom strands import Agent\nfrom strands.models.ollama import OllamaModel\n\n# host is a required positional argument\nmodel = OllamaModel(\"http:\u002F\u002Flocalhost:11434\", model_id=\"qwen3:latest\")\nagent = Agent(model=model)\nresult = agent(\"What is the capital of France?\")\nprint(result)\n```\n\n**Note:** Not all open-source models support tool-calling. Abliterated models often lose function-calling during the abliteration process. Test with a stock model (qwen3, llama3.x, mistral) first.\n\n## Quick Start — Bedrock (Default Provider)\n\n```python\nfrom strands import Agent\n\n# No model specified → BedrockModel (Claude Sonnet 4, us-west-2)\n# Requires AWS credentials (~\u002F.aws\u002Fcredentials or env vars)\nagent = Agent()\nresult = agent(\"Explain quantum computing\")\n\n# Explicit Bedrock model:\nfrom strands.models import BedrockModel\nmodel = BedrockModel(model_id=\"us.anthropic.claude-sonnet-4-20250514-v1:0\")\nagent = Agent(model=model)\n```\n\n## Quick Start — Anthropic (Direct API)\n\n```python\nfrom strands import Agent\nfrom strands.models.anthropic import AnthropicModel\n\n# max_tokens is Required[int] — must be provided\nmodel = AnthropicModel(model_id=\"claude-sonnet-4-20250514\", max_tokens=4096)\nagent = Agent(model=model)\nresult = agent(\"Explain quantum computing\")\n```\n\nRequires `ANTHROPIC_API_KEY` environment variable.\n\n## Quick Start — OpenAI\n\n```python\nfrom strands import Agent\nfrom strands.models.openai import OpenAIModel\n\nmodel = OpenAIModel(model_id=\"gpt-4.1\")\nagent = Agent(model=model)\n```\n\nRequires `OPENAI_API_KEY` environment variable.\n\n## Creating Custom Tools\n\nUse the `@tool` decorator. Type hints become the schema; the docstring becomes the description:\n\n```python\nfrom strands import Agent, tool\n\n@tool\ndef read_file(path: str) -> str:\n    \"\"\"Read contents of a file at the given path.\n\n    Args:\n        path: Filesystem path to read.\n    \"\"\"\n    with open(path) as f:\n        return f.read()\n\n@tool\ndef write_file(path: str, content: str) -> str:\n    \"\"\"Write content to a file.\n\n    Args:\n        path: Filesystem path to write.\n        content: Text content to write.\n    \"\"\"\n    with open(path, 'w') as f:\n        f.write(content)\n    return f\"Wrote {len(content)} bytes to {path}\"\n\nagent = Agent(model=model, tools=[read_file, write_file])\nagent(\"Read \u002Ftmp\u002Ftest.txt and summarize it\")\n```\n\n### ToolContext\n\nTools can access agent state via `ToolContext`:\n\n```python\nfrom strands import tool\nfrom strands.types.tools import ToolContext\n\n@tool\ndef stateful_tool(query: str, tool_context: ToolContext) -> str:\n    \"\"\"A tool that accesses agent state.\n\n    Args:\n        query: Input query.\n    \"\"\"\n    # Access shared agent state\n    count = tool_context.state.get(\"call_count\", 0) + 1\n    tool_context.state[\"call_count\"] = count\n    return f\"Call #{count}: {query}\"\n```\n\n## Built-in Tools (46 available)\n\n`strands-agents-tools` provides pre-built tools:\n\n```python\nfrom strands_tools import calculator, file_read, file_write, shell, http_request\nagent = Agent(model=model, tools=[calculator, file_read, shell])\n```\n\nFull list: `calculator`, `file_read`, `file_write`, `shell`, `http_request`, `editor`, `image_reader`, `python_repl`, `current_time`, `think`, `stop`, `sleep`, `environment`, `retrieve`, `search_video`, `chat_video`, `speak`, `generate_image`, `generate_image_stability`, `diagram`, `journal`, `memory`, `agent_core_memory`, `elasticsearch_memory`, `mongodb_memory`, `mem0_memory`, `rss`, `cron`, `batch`, `workflow`, `use_agent`, `use_llm`, `use_aws`, `use_computer`, `load_tool`, `handoff_to_user`, `slack`, `swarm`, `graph`, `a2a_client`, `mcp_client`, `exa`, `tavily`, `bright_data`, `nova_reels`.\n\nHot reload: `Agent(load_tools_from_directory=True)` watches `.\u002Ftools\u002F` for changes.\n\n## MCP Integration\n\nConnect to any Model Context Protocol server. MCPClient implements `ToolProvider` — pass it directly in the tools list:\n\n```python\nfrom strands import Agent\nfrom strands.tools.mcp import MCPClient\nfrom mcp import stdio_client, StdioServerParameters\n\n# MCPClient takes a callable that returns the transport\nmcp = MCPClient(lambda: stdio_client(StdioServerParameters(\n    command=\"uvx\",\n    args=[\"some-mcp-server@latest\"]\n)))\n\n# Use as context manager — MCPClient is a ToolProvider\nwith mcp:\n    agent = Agent(model=model, tools=[mcp])\n    agent(\"Use the MCP tools to do something\")\n```\n\nSSE transport:\n```python\nfrom mcp.client.sse import sse_client\nmcp = MCPClient(lambda: sse_client(\"http:\u002F\u002Flocalhost:8080\u002Fsse\"))\n```\n\n## Multi-Agent Patterns\n\n### Agents as Tools\n\nNest agents — inner agents become tools for the outer agent:\n\n```python\nresearcher = Agent(model=model, system_prompt=\"You are a research assistant.\")\nwriter = Agent(model=model, system_prompt=\"You are a writer.\")\n\norchestrator = Agent(\n    model=model,\n    tools=[researcher, writer],\n    system_prompt=\"You coordinate research and writing tasks.\"\n)\norchestrator(\"Research quantum computing and write a blog post\")\n```\n\n### Swarm Pattern\n\nSelf-organizing agent teams with shared context and autonomous handoff coordination:\n\n```python\nfrom strands.multiagent.swarm import Swarm\n\n# Agents need name + description for handoff identification\nresearcher = Agent(\n    model=model,\n    name=\"researcher\",\n    description=\"Finds and summarizes information\"\n)\nwriter = Agent(\n    model=model,\n    name=\"writer\",\n    description=\"Creates polished content\"\n)\n\nswarm = Swarm(\n    nodes=[researcher, writer],\n    entry_point=researcher,    # optional — defaults to first agent\n    max_handoffs=20,           # default\n    max_iterations=20,         # default\n    execution_timeout=900.0,   # 15 min default\n    node_timeout=300.0         # 5 min per node default\n)\nresult = swarm(\"Research AI agents, then hand off to writer for a blog post\")\n```\n\nSwarm auto-injects a `handoff_to_agent` tool. Agents hand off by calling it with the target agent's name. Supports interrupt\u002Fresume, session persistence, and repetitive-handoff detection.\n\n### Graph Pattern (DAG)\n\nDeterministic dependency-based execution via `GraphBuilder`:\n\n```python\nfrom strands.multiagent.graph import GraphBuilder\n\nbuilder = GraphBuilder()\nresearch_node = builder.add_node(researcher, node_id=\"research\")\nwriting_node = builder.add_node(writer, node_id=\"writing\")\nbuilder.add_edge(\"research\", \"writing\")\nbuilder.set_entry_point(\"research\")\n\n# Optional: conditional edges\n# builder.add_edge(\"research\", \"writing\",\n#     condition=lambda state: \"complete\" in str(state.completed_nodes))\n\ngraph = builder.build()\nresult = graph(\"Write a blog post about AI agents\")\n```\n\nSupports cycles (feedback loops) with `builder.reset_on_revisit(True)`, execution timeouts, and nested graphs (Graph as a node in another Graph).\n\n### A2A Protocol (Agent-to-Agent)\n\nExpose a Strands agent as an A2A-compatible server for inter-agent communication:\n\n```python\nfrom strands.multiagent.a2a import A2AServer\n\nserver = A2AServer(\n    agent=my_agent,\n    host=\"127.0.0.1\",\n    port=9000,\n    version=\"0.0.1\"\n)\nserver.start()  # runs uvicorn\n```\n\nConnect to A2A agents with the `a2a_client` tool from strands-agents-tools. A2A implements Google's Agent-to-Agent protocol for standardized cross-process\u002Fcross-network agent communication.\n\n## Session Persistence\n\nPersist conversations across agent runs:\n\n```python\nfrom strands.session.file_session_manager import FileSessionManager\n\nsession = FileSessionManager(session_file_path=\".\u002Fsessions\u002Fmy_session.json\")\nagent = Agent(model=model, session_manager=session)\n\n# Also available:\nfrom strands.session.s3_session_manager import S3SessionManager\nsession = S3SessionManager(bucket_name=\"my-bucket\", session_id=\"session-1\")\n```\n\nBoth Swarm and Graph support session managers for persisting multi-agent state.\n\n## Bidirectional Streaming (Experimental)\n\nReal-time voice\u002Ftext conversations with persistent audio streams:\n\n```python\nfrom strands.experimental.bidi.agent import BidiAgent\nfrom strands.experimental.bidi.models.nova_sonic import NovaSonicModel\n\n# Supports: NovaSonicModel, GeminiLiveModel, OpenAIRealtimeModel\nmodel = NovaSonicModel(region=\"us-east-1\")\nagent = BidiAgent(model=model, tools=[my_tool])\n```\n\nSupports interruption detection, concurrent tool execution, and continuous back-and-forth audio. Experimental — API subject to change.\n\n## System Prompts\n\n```python\nagent = Agent(\n    model=model,\n    system_prompt=\"You are Hex, a sharp and witty AI assistant.\",\n    tools=[read_file, write_file]\n)\n```\n\nStrands also supports `list[SystemContentBlock]` for structured system prompts with cache control.\n\n## Observability\n\nNative OpenTelemetry tracing:\n\n```python\nagent = Agent(\n    model=model,\n    trace_attributes={\"project\": \"my-agent\", \"environment\": \"dev\"}\n)\n```\n\nEvery tool call, model invocation, handoff, and lifecycle event is instrumentable.\n\n## Bedrock-Specific Features\n\n- **Guardrails**: `guardrail_id` + `guardrail_version` in BedrockModel config — content filtering, PII detection, input\u002Foutput redaction\n- **Cache points**: System prompt and tool definition caching for cost optimization\n- **Streaming**: On by default, disable with `streaming=False`\n- **Region**: Defaults to `us-west-2`, override via `region_name` param or `AWS_REGION` env\n- **Cross-region inference**: Model IDs prefixed with `us.` use cross-region inference profiles\n\n## Scaffolding a New Agent\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider ollama --model qwen3:latest\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider anthropic\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider bedrock\npython3 {baseDir}\u002Fscripts\u002Fcreate-agent.py my-agent --provider openai --model gpt-4.1\n```\n\nCreates a ready-to-run agent directory with tools, config, and entry point.\n\n## Running an Agent\n\n```bash\npython3 {baseDir}\u002Fscripts\u002Frun-agent.py path\u002Fto\u002Fagent.py \"Your prompt here\"\npython3 {baseDir}\u002Fscripts\u002Frun-agent.py path\u002Fto\u002Fagent.py --interactive\n```\n\n## Model Providers Reference (11 total)\n\n| Provider | Class | Init | Notes |\n|----------|-------|------|-------|\n| Bedrock | `BedrockModel` | `BedrockModel(model_id=...)` | **Default**, eagerly imported |\n| Ollama | `OllamaModel` | `OllamaModel(\"http:\u002F\u002Fhost:11434\", model_id=...)` | `host` is positional |\n| Anthropic | `AnthropicModel` | `AnthropicModel(model_id=..., max_tokens=4096)` | `max_tokens` **required** |\n| OpenAI | `OpenAIModel` | `OpenAIModel(model_id=...)` | `OPENAI_API_KEY` |\n| Gemini | `GeminiModel` | `GeminiModel(model_id=...)` | `api_key` in client_args |\n| Mistral | `MistralModel` | `MistralModel(model_id=...)` | Mistral API key |\n| LiteLLM | `LiteLLMModel` | `LiteLLMModel(model_id=...)` | Meta-provider (Cohere, Groq, etc.) |\n| LlamaAPI | `LlamaAPIModel` | `LlamaAPIModel(model_id=...)` | Meta Llama API |\n| llama.cpp | `LlamaCppModel` | `LlamaCppModel(...)` | Local server, OpenAI-compatible |\n| SageMaker | `SageMakerAIModel` | `SageMakerAIModel(...)` | Custom AWS endpoints |\n| Writer | `WriterModel` | `WriterModel(model_id=...)` | Writer platform |\n\nAll non-Bedrock providers are **lazy-loaded** — dependencies imported only when referenced.\n\nImport pattern: `from strands.models.\u003Cprovider> import \u003CClass>` (or `from strands.models import \u003CClass>` for lazy-load).\n\n## Tips\n\n- `Agent()` without `model=` requires AWS credentials (Bedrock default)\n- `AnthropicModel` requires `max_tokens` — omitting it causes a runtime error\n- `OllamaModel` `host` is positional: `OllamaModel(\"http:\u002F\u002F...\", model_id=\"...\")`\n- Abliterated Ollama models often lose tool-calling support — use stock models for tool-using agents\n- Swarm agents need `name=` and `description=` for handoff routing\n- `Agent(load_tools_from_directory=True)` watches `.\u002Ftools\u002F` for hot-reloaded tool files\n- Use `agent.tool.my_tool()` to call tools directly without LLM routing\n- `MCPClient` is a `ToolProvider` — pass it directly in `tools=[mcp]`, don't call `list_tools_sync()` manually when using with Agent\n- Session managers work with Agent, Swarm, and Graph\n- Pin your `strands-agents` version — the SDK is young and APIs evolve between releases\n",{"name":5,"version":42,"homepage":43,"metadata":44,"description":7},"2.0.0","https:\u002F\u002Fgithub.com\u002Fstrands-agents\u002Fsdk-python",{"openclaw":45},{"emoji":46,"requires":47},"?",{"bins":48,"packages":50},[49],"python3",[51],"strands-agents","main","e7e336ac628c3e3bd771aff1aaa469c93778f94a","skills\u002Ftrippingkelsea\u002Fstrands",0,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del","2026-08-23 22:39:37",{"source":8,"skillName":5,"commands":60,"prompt":70,"zipAvailable":71},[61,64,67],{"tool":62,"command":63},"npx","npx skills add kbarbel640-del\u002Fskills --skill strands",{"tool":65,"command":66},"bunx","bunx skills add kbarbel640-del\u002Fskills --skill strands",{"tool":68,"command":69},"pnpm","pnpm dlx skills add kbarbel640-del\u002Fskills --skill strands","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002FSKILL.md",true,[73,79,83,89,93],{"path":74,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":77,"sourceHtmlUrl":78},"_meta.json","REFERENCE","参考文档",463,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002F_meta.json",{"path":80,"resourceType":75,"resourceTypeDesc":76,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fcheatsheet.md",4489,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002Freferences\u002Fcheatsheet.md",{"path":84,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":87,"sourceHtmlUrl":88},"scripts\u002Fcreate-agent.py","SCRIPT","脚本",6725,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002Fscripts\u002Fcreate-agent.py",{"path":90,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":91,"sourceHtmlUrl":92},"scripts\u002Frun-agent.py",2087,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002Fscripts\u002Frun-agent.py",{"path":94,"resourceType":85,"resourceTypeDesc":86,"sizeBytes":95,"sourceHtmlUrl":96},"tests\u002Ftest_imports.py",8254,"https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftrippingkelsea\u002Fstrands\u002Ftests\u002Ftest_imports.py",[98,123,146,164,169,189],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":37},"01M6G8J55967D6281ACMKAKTEQ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,36],"crowd prompting","prompting","api","with","tokens","domain","world","prompts","operations","instructions","text","tool","system","improve","productivity","marketplace","https","content",{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":37},"01M6G8J0PKPAYVET6BWE8W4C26","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[130,107,131,132,133,134,33,135,136,137,138,139,140,141,142,143,144,112,145],"dilemm ai","arena","analyze","browser","openclaw agent","automation","browser automation","bot","openclaw","design","strategy","headless","compete","submit","matchmaking","use",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":37},"01M6G8HWAF3K9SW7NP3Z83CPJ6","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, and submit comments. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, or submitting paper reviews via API at http:\u002F\u002F150.158.152.82:8000.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Fweak-accept\u002FSKILL.md",[],[153,154,155,156,157,158,159,108,160,143,145,161,107,162,163],"arxiv paper reviews","reviews","arxiv","paper","crawler","papers","comments","fetch","read","http","via",{"skillNo":165,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":166,"categories":167,"keywords":168,"publishedAt":37},"01M6G8HQJ7N7WMY6YV7D7SSJ16","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[156,155,154,153,163,158,159,108,157,143,145,160,161,107,162],{"skillNo":170,"name":171,"nameZh":6,"description":172,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":173,"categories":174,"keywords":175,"publishedAt":37},"01M6G8HM95Y64JNVFC2HN4E2BG","git-summary","Get a quick summary of the current Git repository including status, recent commits, branches, and contributors.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fzweack\u002Fgit-summary\u002FSKILL.md",[],[176,177,178,179,180,181,182,183,184,185,186,187,188],"git","summary","git summary","commits","repository","win32","status","linux","contributors","true","quick","get","branches",{"skillNo":190,"name":191,"nameZh":6,"description":192,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":195,"publishedAt":37},"01M6G8HGEGF05CNEJCGVYFSC4R","agent-constitution","Interact with AgentConstitution governance contracts on Base Sepolia. Check compliance, read rules, log actions, query governance state.","https:\u002F\u002Fgithub.com\u002Fkbarbel640-del\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fztsalexey\u002Fagent-constitution\u002FSKILL.md",[],[196,197,198,199,108,200,201,52,202,161,203,204,205,206,207,121,208,209,210],"agent constitution","constitution","contracts","tree","query","base","log","check","Rules","projects","compliance","actions","state","governance","github"]