Architecture¶
The agent is intentionally small: a Converse API loop, a tool registry, a memory interface, and observability helpers.
flowchart TD
CLI[Local CLI] --> Agent
API[Lambda handler] --> Agent
Agent --> Memory{Memory}
Memory --> InMemory[In-memory]
Memory --> DynamoDB[DynamoDB]
Agent --> Bedrock[Bedrock Converse]
Agent --> Registry[Tool registry]
Registry --> Calculator[calculator]
Registry --> Time[get_time]
Registry --> Search[web_search stub]
Agent --> Observability[JSON logs + EMF]
Runtime flow¶
- The client sends a user message and optional
session_id. - The agent reads prior session memory.
- Bedrock returns either a final answer or a tool-use request.
- Tool requests are dispatched locally and returned to the model.
- The final response, usage, tool calls, and latency are logged.
- Recent conversation state is persisted.
Boundaries¶
- The agent core knows about Bedrock's message shape, but not about API Gateway.
- Tools know their own integration details, but not the agent loop.
- Memory backends share a small interface so local and Lambda runtime stay aligned.