Skip to main content

Base agent SDK for building orchestrator and subagents on AWS Transform

Project description

Agent Builder SDK

A Python SDK for building agents that run on AWS Transform.

Use it to build two kinds of agents:

  • Orchestrator agents — stateful, conversational agents that drive a workflow end-to-end and can delegate to subagents.
  • Subagents — stateless, task-focused agents invoked by an orchestrator to handle a single unit of work (e.g., a code generation, a validation, a review step).

The SDK wraps the common concerns — HTTP server, request routing, agent lifecycle, checkpointing, A2A protocol extensions, authentication, metrics, and tracing — so you focus on the agent's behavior instead of the plumbing.

Installation

pip install agent-builder-sdk

Building an orchestrator

1. Create your orchestrator class

from agent_builder_sdk.orchestrator_strands.base_orchestrator import AsyncBaseOrchestrator


class MyCustomOrchestrator(AsyncBaseOrchestrator):
    """Your custom orchestrator implementation."""

    def __init__(self, **kwargs):
        super().__init__(
            system_prompt="You are a specialized orchestrator for...",
            **kwargs
        )
        # Add your custom tools, hooks, conversation implementation

2. Create custom tools (optional)

Define domain-specific tools using Strands decorators:

from strands.tools import tool


@tool
def my_custom_tool(param: str) -> str:
    """Your custom tool description."""
    return f"Processed: {param}"

See the Strands custom tools documentation for more.

3. Create your entry point

Use AgentRuntimeServer with a custom agent factory. The server is compatible with both Bedrock AgentCore runtime protocols and AWS Transform agentic compute endpoints.

from agent_builder_sdk.server.agent_runtime_server import AgentRuntimeServer
from agent_builder_sdk.agent_factory import create_default_orchestrator


def main():
    def agent_factory(mcp_client, storage_dir):
        return create_default_orchestrator(
            mcp_client=mcp_client,
            storage_dir=storage_dir,
            system_prompt="Your custom system prompt here",
            with_base_guardrails=True,  # Enable built-in guardrails (optional)
        )

    server = AgentRuntimeServer(
        agent_factory=agent_factory,
        host="0.0.0.0",
        port=8080,
        binary_location="./agent-builder-mcp",
        storage_dir="/tmp/my_agent",
        checkpoint_strategy="conversation",  # optional, enables checkpointing
        checkpoint_interval=10,              # optional, enables checkpointing
    )
    server.start()


if __name__ == "__main__":
    main()

Base guardrails: Set with_base_guardrails=True to enable built-in system prompt protections that:

  • Decline job / job plan / artifact / workspace deletion requests
  • Decline prompt injection or requests that reveal the agent's architecture
  • Decline PII information requests
  • Decline requests unrelated to transformation

Custom agent initialization: Extend AgentRuntimeServer and override _get_agent_params to pass additional arguments to your factory. See _get_agent_params in agent_runtime_server.py for the defaults.

Building a subagent

1. Create your subagent class

from agent_builder_sdk.base_subagent.base_subagent import AsyncBaseSubagent


class MyCustomSubagent(AsyncBaseSubagent):
    """Your custom subagent implementation."""

    def __init__(self, **kwargs):
        super().__init__(
            system_prompt="You are a specialized subagent for...",
            **kwargs
        )

2. Create your entry point

StatelessAgentRuntimeServer is well-suited for subagents since it handles requests without persistent state. You can also use AgentRuntimeServer for subagents if you need persistent state or queue-based processing.

from agent_builder_sdk.server.stateless_agent_runtime_server import StatelessAgentRuntimeServer
from agent_builder_sdk.agent_factory import create_default_subagent


def main():
    def agent_factory(mcp_client):
        return create_default_subagent(
            mcp_client=mcp_client,
            system_prompt="Your custom subagent system prompt here",
            custom_tools=[my_custom_tool],  # Optional
        )

    server = StatelessAgentRuntimeServer(
        agent_factory=agent_factory,
        host="0.0.0.0",
        port=8080,
        binary_location="./agent-builder-mcp",
    )
    server.start()


if __name__ == "__main__":
    main()

Requirements

  • Python 3.11+
  • AWS credentials configured (standard boto3 credential chain), with Bedrock access for model inference
  • The agent-builder-mcp binary on disk — see agent-builder-mcp-aws-transform

License

Apache-2.0. See LICENSE and THIRD-PARTY-NOTICES.txt.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_builder_sdk_aws_transform-1.0.0.tar.gz (261.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_builder_sdk_aws_transform-1.0.0-py3-none-any.whl (269.8 kB view details)

Uploaded Python 3

File details

Details for the file agent_builder_sdk_aws_transform-1.0.0.tar.gz.

File metadata

File hashes

Hashes for agent_builder_sdk_aws_transform-1.0.0.tar.gz
Algorithm Hash digest
SHA256 3b5f41f0eb3261d9b962c183430642be111b47f117425118e1c280dea75fc6be
MD5 4f7f1a7678fa3a1efb5c3699c81e9301
BLAKE2b-256 b98668731ab04ae0b92a7026891ec4222d18032163251aa4938e2ab6afd6fcac

See more details on using hashes here.

File details

Details for the file agent_builder_sdk_aws_transform-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for agent_builder_sdk_aws_transform-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62ba440efb400b505eca9f70e32286d5b8314eae1e97d469cc8cf4915892d798
MD5 b532a77b674cbd87401e554dbabf43fd
BLAKE2b-256 4ac54b1dc195c2bb83c3c8e90359a0ce827e03f9fdaffd5364bfd47660558413

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page