Skip to content
BrTs

Amazon Bedrock Agents (TypeScript)

Build agents on AWS in TypeScript: the Strands Agents TypeScript SDK for the agent loop and the bedrock-agentcore npm package for AgentCore Runtime, Memory, tools and Identity.

AWS-native agents in Node.js. Write the agent with the Strands Agents TypeScript SDK (@strands-agents/sdk) and host it on AgentCore Runtime with the AgentCore TypeScript SDK (bedrock-agentcore). The split is the same as in Python: Strands is the agent loop, AgentCore is where it runs and the managed services around it.

Install

Terminal window
npm install @strands-agents/sdk bedrock-agentcore zod

Version

@strands-agents/sdk 1.24.0 · bedrock-agentcore 0.4.7 · Node.js 22+ (checked 2026-11-19)

Best for

TypeScript teams on AWS who want Bedrock models, typed tools and session-isolated hosting.

A Strands agent on Claude, served with the AgentCore Runtime HTTP contract (GET /ping, POST /invocations on port 8080):

import { BedrockAgentCoreApp } from 'bedrock-agentcore/runtime'
import { Agent, BedrockModel, tool } from '@strands-agents/sdk'
import { z } from 'zod'
const getWeather = tool({
name: 'get_weather',
description: 'Get the current weather for a city.',
inputSchema: z.object({ city: z.string() }),
callback: ({ city }) => `It is 18°C and cloudy in ${city}.`,
})
const agent = new Agent({
model: new BedrockModel({ modelId: 'us.anthropic.claude-sonnet-5-5', region: 'us-west-2' }),
systemPrompt: 'You are a concise assistant.',
tools: [getWeather],
printer: false,
})
const app = new BedrockAgentCoreApp({
invocationHandler: {
requestSchema: z.object({ prompt: z.string() }),
process: async (request, context) => {
const result = await agent.invoke(request.prompt)
return { result: result.toString(), sessionId: context.sessionId }
},
},
})
app.run()
Terminal window
npx tsx main.ts &
curl -s -X POST http://localhost:8080/invocations \
-H 'Content-Type: application/json' \
-H 'X-Amzn-Bedrock-AgentCore-Runtime-Session-Id: local-session-0000000000000000000001' \
-d '{"prompt": "What is the weather in Leeds?"}'

Deploy it with the AgentCore CLI (agentcore create --name MyAgent --template agent-typescript-strands, then agentcore deploy); see the production page.

  • Agent (@strands-agents/sdk): model + system prompt + tools; invoke() returns an AgentResult, stream() yields typed events.
  • Tools: tool() with a Zod schema gives typed, validated inputs. Agents, MCP clients and vended tools all go in the same tools array.
  • BedrockModel: Bedrock Converse API with any Bedrock model or inference profile, such as us.anthropic.claude-sonnet-5-5; guardrails and prompt caching are options on the model.
  • BedrockAgentCoreApp (bedrock-agentcore/runtime): the Runtime server; a Zod requestSchema types the payload, and an async generator handler streams Server-Sent Events.
  • AgentCore Memory: plugged into Strands as a MemoryStore via createAgentCoreMemoryStores().
  • Code Interpreter and Browser: managed sandboxes exposed as Strands tools (CodeInterpreterTools, BrowserTools) or used through their clients.
  • Identity: withApiKey and withAccessToken fetch outbound credentials from AgentCore Identity inside a handler.
TopicTypeScriptNotes
Strands agents, tools, streaming, hooksYesSame concepts; invoke() instead of calling the agent
Strands multi-agentGraph, Swarm, agents as toolsNo Workflow pattern
AgentCore Runtime appYesinvocationHandler.process instead of @app.entrypoint
AgentCore MemoryStrands MemoryStore onlyNo MemoryClient; use @aws-sdk/client-bedrock-agentcore for raw calls
Code Interpreter, BrowserYesStrands tool wrappers are experimental
IdentityYesWrapper functions instead of decorators
GatewayNo SDK moduleUse Gateway as an MCP server via Strands McpClient
ObservabilityNo SDK moduleStrands OpenTelemetry via @strands-agents/sdk/telemetry
Bedrock Agents (Classic)Not coveredUse @aws-sdk/client-bedrock-agent-runtime directly; the service is in maintenance mode

DateVersionChanges
2026-10-24Strands TS 1.21.0 · AgentCore TS 0.4.6 · AgentCore CLI 1.0.0Deployment instructions updated for CLI 1.0 (--template, add runtime).
2026-10-21Strands TS 1.21.0 · AgentCore TS 0.4.6New TypeScript section: overview, Strands guide, AgentCore guide and deployment page, all examples compiled with tsc --strict.