The final step: take the agent off your laptop and run it in AWS, using the official @aws/agentcore CLI.
The new AgentCore CLI is an npm package. You need Node 20 or higher.
# (if Node ≥20 is not already available)
nvm install 20 && nvm use 20
# install the CLI
npm install -g @aws/agentcore
# verify
agentcore --version # → 0.13.0+If your Node is older than 20, use
nvm install 20 && nvm use 20from a terminal before runningdeploy.sh.
pip install -r requirements.txt
export BEDROCK_AGENTCORE_MEMORY_ID=<your memory id> # from step-03./deploy.shdeploy.sh idempotently:
- Runs
agentcore createto scaffold aAim308Deploy/project (CDK-based) - Runs
agentcore add agent --type byopointing at this directory'sagent.py - Writes
AWS_REGION+BEDROCK_AGENTCORE_MEMORY_IDintoAim308Deploy/agentcore/.env.local - Installs CDK deps and runs
agentcore deploy -y
When it finishes, you'll see the runtime ARN and a ready-to-use agentcore invoke command.
Instead of deploying to AWS for every change, use the CLI's built-in dev server:
cd Aim308Deploy # the project created by deploy.sh
agentcore dev # opens an interactive TUI against your local agentOr run one-shot non-interactive:
agentcore dev "hello, who are you?"Via the CLI:
cd Aim308Deploy
agentcore invoke "what can you do?"
agentcore invoke --session-id demo123 "remember I prefer python"
agentcore invoke --session-id demo123 "what do you remember?"Via Python from anywhere (boto3):
export AGENT_ARN=arn:aws:bedrock-agentcore:us-east-1:...:runtime/aim308_research_agent-XYZ
python invoke.py "tell me about yourself"cd Aim308Deploy
agentcore status # deployment state, ARNs
agentcore logs # CloudWatch logs (streamed)
agentcore traces list # recent tracescd Aim308Deploy
agentcore remove agent --name aim308_research_agent
agentcore deploy -y # CDK destroys removed resourcesCongratulations 🎉 You've built and deployed a self-improving autonomous agent.