Skip to content
▶ ▶
from agentcore_rl_toolkit import AgentCoreRuntimeApp
from strands import Agent
from strands.models.openai import OpenAIModel

app = AgentCoreRuntimeApp()

@app.entrypoint
def invoke_agent(payload: dict):
    cfg = payload["_config"]
    model = OpenAIModel(
        client_args={
            "base_url": cfg["base_url"],
            "api_key": cfg["api_key"],
        },
        model_id=cfg["model_id"],
        params=cfg.get("sampling_params", {}),
    )
    agent = Agent(model=model, tools=[...])
    response = agent(payload["prompt"])
    return {"reward": float(reward_fn(response))}
# Install the AgentCore CLI
uv tool install bedrock-agentcore-starter-toolkit

agentcore configure --entrypoint rl_app.py \
  --name agent --requirements-file pyproject.toml \
  --deployment-type container --disable-memory --non-interactive

agentcore deploy

# → arn:aws:bedrock-agentcore:us-west-2:...
# config.yaml
rollout_session_backend:
  backend: >-
    agentcore_rl_toolkit.rollout_session.agentcore_http_session.AgentCoreHttpSession
  agentcore_runtime_arn: "arn:aws:bedrock-agentcore:..."

# Launch slime with the AgentCore rollout hooks
SLIME_DIR=/path/to/slime \
MODEL_DIR=/path/to/Qwen3-0.6B \
TRAIN_DATA_PATH=/path/to/gsm8k.jsonl \
MODEL_TYPE=qwen3-0.6B \
bash train.sh

AgentCore RL Toolkit - ART

Seamlessly enable RL training on any agent with Bedrock AgentCore Runtime.

Reuse production code — one decorator & model endpoint swap; no custom Agent code just for RL.

Isolated, auto-scaling rollouts — every rollout runs in its own AgentCore Runtime microVM with its own dependencies; thousands in parallel without contending for your machine.

Flexible training integrations — use verl, slime, SkyRL, or Tinker with ART’s rollout gateway for token IDs, logprobs, and loss masks. rLLM natively integrates with AgentCore Runtime.

Any agent framework — Strands, LangGraph, OpenHands, and more. The agent’s runtime is independent of the training library.

New here? Start with the math agent example or read the overview. Already have an agent? Choose a setup guide from Training Backends.