AMAZON BEDROCK / SERVICE DETAIL S02
AGENTCORE RUNTIMEPRACTICAL
CHAPTER 08 / 36
TOPIC from npm install to a running agent
REV 2026.07
New to these words? Sheet 01-A "Key terms" defines container, ARM64, session, and microVM.
IN PLAIN WORDS
You will install a small command-line tool, create an agent project, test it on your laptop, then deploy it to AWS so it runs in the cloud. Terms: CLI = a tool you type commands into; ARM64 = the chip type AWS uses (your code must be built for it; the tool does this for you); CDK = AWS's tool that creates the cloud resources; session id = a name for one conversation; DEFAULT = the live version of your deployed agent.
[ 1 ] PREREQUISITES
[x] AWS account with credentials configured
[x] Node.js 20+ (the CLI is an npm package)
[x] Python 3.10+ (the agent code is Python)
[x] AWS CDK (the CLI deploys through CDK)
[x] Model access in Bedrock (the docs tutorial uses Anthropic Claude Sonnet 4.0)
[x] Default region us-west-2
[ 2 ] THE WORKFLOW, NPM INSTALL TO A RUNNING AGENT
$ npm install -g @aws/agentcore # install the CLI
$ agentcore create --name MyAgent \
--framework Strands --model-provider Bedrock --memory none
$ cd MyAgent
$ agentcore dev # local server on http://localhost:8080
$ agentcore dev "Hello, tell me a joke" # send a test prompt locally
$ agentcore deploy # CDK builds and deploys. V1 + DEFAULT endpoint
$ agentcore invoke "Tell me a joke" # invoke the deployed agent
$ agentcore status # show the ARN, endpoint and status
$ agentcore logs # stream runtime logs
[ 3 ] WHAT CREATE GENERATES, AND ITS FLAGS
# project structure
MyAgent/
agentcore/
agentcore.json # project and agent config
aws-targets.json # account and region targets
.env.local # local env vars (gitignored)
app/
MyAgent/
main.py # agent entrypoint (framework code)
pyproject.toml # Python dependencies
README.md
| FLAG | VALUES |
| --name | project name (starts with a letter, max 36) |
| --framework | Strands, LangChain_LangGraph, GoogleADK, OpenAIAgents |
| --protocol | HTTP (default), MCP, A2A |
| --build | CodeZip (default), Container |
| --model-provider | Bedrock, Anthropic, OpenAI, Gemini |
| --memory | none, shortTerm, longAndShortTerm |
[ 4 ] INVOKE PROGRAMMATICALLY, BOTO3
import json, uuid, boto3
agent_arn = "Agent ARN" # from: agentcore status
prompt = "Tell me a joke"
client = boto3.client('bedrock-agentcore')
payload = json.dumps({"prompt": prompt}).encode()
response = client.invoke_agent_runtime(
agentRuntimeArn=agent_arn,
runtimeSessionId=str(uuid.uuid4()),
payload=payload,
qualifier="DEFAULT",
)
content = []
for chunk in response.get("response", []):
content.append(chunk.decode('utf-8'))
print(json.loads(''.join(content)))
NOTES
client uses the bedrock-agentcore data plane. Needs bedrock-agentcore:InvokeAgentRuntime.
runtimeSessionId a fresh uuid per conversation. Reuse it to keep context.
qualifier the endpoint, here DEFAULT.
With OAuth inbound auth you cannot use the AWS SDK. Call InvokeAgentRuntime over HTTPS instead.
[ 5 ] ADD CAPABILITIES, AND CLEAN UP
$ agentcore add memory --name MyMemory --strategies SEMANTIC
$ agentcore add credential --name MyApiKey --type api-key --api-key your-api-key
$ agentcore deploy # provision the new resources
$ agentcore remove all # then deploy again to tear down
$ agentcore deploy
Runtime runs on ARM64 (Graviton). The CLI handles architecture automatically for both CodeZip and Container builds.