← Back to Dashboard
1. Amazon Bedrock AgentCore: The Current Agent Platform2. State, Context, and AgentCore Memory
State, Context, and AgentCore Memory
📚 Agents for Bedrock & AgentCore⏱ 11 min⭐ 85 XP
State Management in Multi-Step Tasks
Production agents need explicit state handling for context continuity, retries, and escalation paths. AgentCore Memory gives you managed short-term memory (multi-turn conversation state) and long-term memory (persists across sessions and can be shared across agents), instead of hand-rolling a session store.
Short-Term vs Long-Term Memory
| Dimension | Short-term memory | Long-term memory |
|---|---|---|
| Scope | One session/conversation | Across sessions, across agents |
| Contents | Turn history, working context, in-flight task state | Extracted facts, user preferences, session summaries |
| Population | Raw events appended as the conversation runs | Managed extraction strategies distill events into durable records |
| Typical query | "What has happened so far in this task?" | "What does this user always prefer?" |
What State an Operations Agent Actually Carries
{
"session": {
"incident_id": "INC-4402",
"steps_completed": ["diagnose", "correlate-alarms"],
"pending_approval": "escalate-to-oncall",
"evidence": ["cloudwatch:alarm/checkout-5xx", "trace:8f3a..."]
},
"long_term": {
"tenant_runbook_version": "v12",
"operator_preferences": {"summary_style": "bullet", "tz": "Europe/London"}
}
}
Design Rules
- Store only required context to minimize leakage risk - memory is a data store and inherits all your data-protection obligations.
- Expire stale state to avoid wrong assumptions - an incident agent resuming with yesterday's alarm data makes confidently wrong decisions.
- Capture handoff summaries for human operators - when the agent escalates, the human should get distilled state and evidence links, not a 200-turn transcript.
- Checkpoint before side effects - if a retry replays the workflow, completed writes must not repeat (pair with idempotency keys from the Tool Use module).
Key insight: "add memory" is not one feature. Decide per data class: what must persist, for how long, visible to which agents, and deletable by what process. That schema IS your memory design.
🧪 Knowledge Check
Press 1-4 to select1 of 3
Why is state design critical for agents?
It replaces prompts
It controls continuity, correctness, and recovery
It removes tool integrations
It disables retries