TypeScript SDK for AWS Bedrock AgentCore
npm install bedrock-agentcore
Deploy AI agents to AWS with VM-level isolation and zero infrastructure
Documentation
|
Samples
|
Python SDK
---
- Zero infrastructure — No servers to provision, no containers to manage, no scaling to configure.
- Session isolation — Each agent session runs in its own VM. No shared state, no noisy neighbors.
- Long-lived sessions — Sessions persist across requests. Your agent maintains context without external storage.
- Managed tools — Secure code execution and browser automation, ready to use.
- Credential management — Centralized API keys and OAuth tokens, injected at runtime.
Works with Strands Agents, Vercel AI SDK, or any framework.
---
``bash`
npm install bedrock-agentcore @strands-agents/sdk
`typescript
import { BedrockAgentCoreApp } from 'bedrock-agentcore/runtime'
import { Agent, BedrockModel } from '@strands-agents/sdk'
import { z } from 'zod'
const agent = new Agent({
model: new BedrockModel({ modelId: 'global.amazon.nova-2-lite-v1:0' }),
})
const app = new BedrockAgentCoreApp({
invocationHandler: {
requestSchema: z.object({ prompt: z.string() }),
process: async function* (request) {
for await (const event of agent.stream(request.prompt)) {
if (event.delta?.text) yield { text: event.delta.text }
}
},
},
})
app.run()
`
BedrockAgentCoreApp creates an AgentCore Runtime-compliant server—handling request parsing, streaming responses, and session management for seamless deployment.
---
Give your agent secure code execution with three lines:
`typescript
import { CodeInterpreterTools } from 'bedrock-agentcore/tools/code-interpreter/strands'
import { Agent, BedrockModel } from '@strands-agents/sdk'
const codeInterpreter = new CodeInterpreterTools({ region: 'us-east-1' })
const agent = new Agent({
model: new BedrockModel({ modelId: 'global.amazon.nova-2-lite-v1:0' }),
tools: codeInterpreter.getTools(),
})
// Agent can now execute code in a secure sandboxed environment
`
---
- Runtime — Secure, session-isolated compute → Examples
- Code Interpreter — Execute Python/JS/TS in a sandbox → Examples
- Browser — Cloud-based web automation → Examples
- Identity — Manage API keys and OAuth tokens → Examples
- Memory — Persistent knowledge across sessions (coming soon)
- Gateway — Transform APIs into MCP tools (coming soon)
- Observability — OpenTelemetry tracing (coming soon)
---
`bash``
npm install bedrock-agentcore
Prerequisites: Node.js 20+, AWS credentials, AgentCore access
---
- Sample Applications — Working examples with deployment templates
- CloudFormation — Infrastructure as code
- AWS CDK — Infrastructure as code
- Deployment Guide — Step-by-step walkthrough
---
- AgentCore Documentation
- Python SDK
---
Apache 2.0 — see LICENSE