Short-term memory - Amazon Bedrock AgentCore

Amazon Bedrock AgentCore is in preview release and is subject to change.

Short-term memory

Short-term memory stores raw interactions that help the agent maintain context within a single session. For example, in a shopping website's customer support AI agent, short-term memory captures the entire conversation history as a series of events. Each customer question and agent response is saved as a separate event (or in batches, depending on your implementation). This allows the agent to reload the conversation as it happened, maintaining context even if the service restarts or the customer returns later to continue the same interaction seamlessly.

When a customer interacts with your agent, each interaction can be captured as an event using the CreateEvent operation. Events can contain various types of data, including conversational exchanges (questions, answers, instructions) or structured information (product details, order status). Each event is attached to a session using either defined session identifier of your choosing or a default session identifier is generated. You can use this sessionId in future requests to maintain conversation context.

To load previous sessions/conversations or enrich context, your agent needs to access the raw interactions with the customer. Imagine a customer returns to follow up on their product support case from last week. To provide seamless assistance, the agent uses ListSessions to locate their previous support interactions. Through ListEvents, it retrieves the conversation history, understanding the reported issue, troubleshooting steps attempted, and any temporary solutions discussed. The agent uses GetEvent to access specific information from key moments in past conversations. These operations work together to maintain support continuity across sessions, eliminating the need for customers to re-explain their issue or repeat troubleshooting steps already attempted.