Building a context-aware AI assistant on AgentCore and OpenClaw
This article demonstrates how to build a context‑aware personal assistant by combining the OpenClaw agentic framework with Amazon Bedrock AgentCore’s runtime and memory capabilities. By routing Telegram webhook and scheduled EventBridge events through a single AgentCore runtime, the system stores conversational snippets as durable memories tagged with structured metadata, enabling later retrieval for continuity. The entire stack is provisioned via one CloudFormation template and runs on a consumption‑based model costing only a few dollars per month for light personal use, making it practical for engineers to add long‑term memory to any domain‑specific bot.
⚡ Key Takeaways
- AgentCore memory provides durable knowledge storage for otherwise stateless chats.
- OpenClaw serves as the gateway that connects the AgentCore runtime to the Bedrock Converse API.
- The architecture supports both inbound Telegram messages (via API Gateway + Lambda) and scheduled jobs (via EventBridge Scheduler + Lambda).
- Deployment requires only a single CloudFormation template and the `scripts/deploy.sh` script (or Launch Stack button).
- Prerequisites include Bedrock AgentCore access, Claude Haiku 4.5/Claude Sonnet 4.5 model permissions, Docker with linux/arm64 support, AWS CLI, and a Telegram bot token.
Engineers can now add persistent, searchable memory to AI assistants without building custom storage layers, enabling richer, context‑aware interactions while keeping operational costs minimal.
✅ Practical Steps
- Run the provided `scripts/deploy.sh` (or click the Launch Stack button) to provision the full system in your AWS account.
- Configure your Telegram bot token in AWS Secrets Manager and ensure Claude model access is granted in Bedrock.
- Use the InvokeAgentRuntime API (called by the Lambda webhook) to send messages to the AgentCore runtime, which will automatically store and retrieve memories via AgentCore memory.
Want the full story? Read the original article.
Read on AWS ML Blog ↗