Cloud concept · Updated

Conversation Memory - Conversation memory is the application-managed retention and reuse of prior interactions so an AI assistant can maintain context across turns or sessions.

In short

Conversation memory lets a generative AI application carry forward relevant messages, user preferences, decisions, and task progress instead of treating every request as unrelated. It is part of context engineering: selecting and organizing the information a foundation model needs for its next response while controlling cost, privacy, and accuracy.

Cloud Concepts Hub →

6 key aspects of Conversation Memory

Effective conversation memory combines explicit state management, selective context assembly, accurate updates, and controlled retention without confusing stored history with model learning.

01
Explicit state management

The application or a managed conversation capability preserves information between model invocations. Design session identifiers, storage keys, and authorization checks so each request receives only its permitted history.

02
Session and cross-session continuity

Session memory supports an ongoing dialogue, while cross-session memory preserves selected facts beyond that dialogue. Choose retention scope deliberately rather than assuming all conversation details should become permanent preferences.

03
Context selection and token budgeting

Select recent turns, summaries, structured facts, or retrieved exchanges to fit the model’s context window. Reserve capacity for instructions, tool results, the current request, and the generated response.

04
Accuracy and freshness

Summaries and extracted facts can be incomplete or incorrect, and remembered details can become stale. Preserve useful provenance, allow corrections, and obtain current operational facts from authoritative systems.

05
Privacy and isolation

Apply tenant isolation, access controls, encryption, and retention policies to stored memory. Deletion workflows should cover derived summaries and search indexes as well as original transcripts.

06
Separation from model learning

Supplying remembered information changes the context of an inference request, not the model’s weights. Use memory for conversational continuity rather than treating it as a substitute for training or fine-tuning.

Cloud services for Conversation Memory

A typical implementation uses AWS Lambda to authenticate and process a request, load recent messages and structured state from Amazon DynamoDB, and assemble an Amazon Bedrock inference request. When older exchanges are relevant, Amazon OpenSearch Service can retrieve candidate memories using keyword or vector search. Lambda applies authorization and relevance checks before including those results, then saves the new exchange and any validated memory updates. DynamoDB provides durable state, OpenSearch supports selective recall, and Bedrock generates the response from the supplied context. Retention and deletion workflows must cover every store containing original or derived conversation data.

Amazon Bedrock

Amazon Bedrock provides foundation model inference for applications that include conversation history in their requests. With the Converse API, the caller manages the message history supplied for subsequent turns; Agents for Amazon Bedrock also offers session handling and optional memory capabilities.

Amazon DynamoDBAmazon DynamoDB

DynamoDB can persist conversation messages, rolling summaries, preferences, and structured task state keyed by user and session. Time to Live supports automatic expiration cleanup, but deletion is asynchronous, so applications must enforce expiration when reading records if immediate exclusion is required.

Amazon OpenSearch ServiceAmazon OpenSearch Service

Amazon OpenSearch Service can index historical exchanges or memory summaries for keyword and vector retrieval. The application must enforce user and tenant restrictions during retrieval and select which results become model context.

AWS LambdaAWS Lambda

AWS Lambda can run the orchestration logic that loads memory, selects context, calls a model, and persists updated state. Durable conversation memory belongs in an external store rather than depending on Lambda execution-environment reuse.

Conversation Memory exam questions

Real practice exam questions on Conversation Memory, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01 (beta)

A service desk uses an Amazon Bedrock assistant to help employees troubleshoot equipment. Each employee can have several open support tickets. The application maintains one conversation history per employee and includes exchanges from all of that employee's tickets in every model request. As histories grow, requests exceed the approved model's context limit. Trimming the oldest messages causes the assistant to forget diagnostic steps when an employee returns to an earlier ticket. The company must keep the model and request-token budget, preserve continuity for each ticket, and avoid using another ticket's diagnostic details. Which application change best meets these requirements?

Show answerCORRECT ANSWER

Maintain separate state for each employee and ticket, and supply only the active ticket's diagnostic progress and relevant recent exchanges within the request budget.

Ticket-scoped memory preserves relevant diagnostic progress when work resumes without including unrelated tickets. Selecting bounded state and recent exchanges for the active ticket provides continuity while controlling context-window usage.

MLA-C02 (beta)

A company runs a travel-planning assistant on stateless application workers. The assistant invokes a foundation model through the Amazon Bedrock Converse API and stores each conversation's messages in Amazon DynamoDB. Conversations can exceed 30,000 tokens. To control inference cost, the company limits conversation context in each model request to 6,000 tokens.

The assistant must retain confirmed decisions from earlier turns, such as excluded destinations and accessibility requirements, while preserving the wording of the most recent exchanges. Users must be able to continue a conversation after requests are routed to a different worker. Authentication and conversation ownership checks are already implemented.

Which implementation best meets these requirements?

Show answerCORRECT ANSWER

Maintain a rolling summary of earlier confirmed decisions and requirements in DynamoDB alongside recent messages. Load both for each turn, include them in the Converse request within the token budget, and persist updated state after the response.

Durable, conversation-scoped state provides continuity across stateless workers. Combining an updated summary of older decisions with recent messages preserves important historical constraints and recent wording without sending the entire transcript. The application explicitly supplies this information to the model.

AIP-C01

A manufacturer runs a sourcing assistant that uses Amazon Bedrock Converse and stores conversation history in Amazon DynamoDB. A buyer can fork an existing negotiation into a what-if conversation to explore a different supplier. The fork must inherit the negotiation context as it existed when the fork was created. The main negotiation can continue independently, and its subsequent changes must not silently alter the what-if conversation.

All relevant messages fit within the model's context window. What-if messages must remain available for audit but must not influence the main negotiation unless the buyer explicitly accepts a proposed change. Acceptance must carry forward only the selected change, not rejected alternatives discussed in the what-if conversation.

Which conversation-memory design meets these requirements?

Show answerCORRECT ANSWER

Give each fork a separate conversation identifier and record its parent's immutable message boundary. Build its model context from parent history through that boundary plus its own messages. On explicit acceptance, append only the selected change to the main negotiation's context; retain the fork transcript separately for audit.

The recorded boundary preserves the inherited context at fork creation, while separate branch messages prevent cross-conversation contamination. Explicitly transferring only the selected change updates the main negotiation without importing rejected alternatives. Retaining the separate transcript satisfies audit requirements.

Practice Conversation Memory in a full exam

Questions on Conversation Memory in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

What is Conversation Memory

3 min read

Conversation memory gives a generative AI application continuity. When a user says, “Compare that with the cheaper option,” the application must supply enough earlier context for the foundation model to identify the options and the comparison criteria. The model does not inherently remember every previous request. In a typical inference workflow, it generates a response from the context supplied for that invocation; the application or a managed conversation capability maintains the state between invocations.

This makes conversation memory a context-engineering concern. Context engineering determines what information enters the model’s context window, how it is represented, and when it is refreshed. Conversation memory supplies historical interaction data, while system instructions, retrieved documents, tool results, and the current user request supply other parts of the context. Storing a transcript alone is not sufficient: relevant information must also be selected and included when the model needs it.

Short-term memory usually preserves continuity within an active conversation. An application might resend the most recent user and assistant messages, maintain a rolling summary, or combine recent messages with structured task state. Long-term memory retains selected information across sessions, such as a user’s preferred programming language or an unfinished support case. Cross-session retention should be intentional, scoped to the correct identity, and governed by an appropriate retention policy.

In a cloud implementation, an API handler can authenticate the user, load conversation state from a database, assemble the model request, invoke a foundation model, and save the updated state. A session identifier links turns, but it is not a substitute for authorization. For example, a cloud operations assistant might retain the affected Region, incident identifier, and troubleshooting steps already attempted. On the next turn, it can continue the investigation without asking for the same details again. Current infrastructure status should still come from authorized tools rather than an old conversation summary.

Memory strategies have different trade-offs. Replaying the full transcript preserves detail but consumes more input tokens and can increase latency and cost. A sliding window bounds context size but may discard an important early constraint. Summaries reduce token usage but can omit details or introduce errors. Retrieval can recover relevant older exchanges, but relevance scoring can miss necessary facts or surface stale information. Structured fields work well for explicit preferences and task state, although applications need rules for updating conflicting values.

Common misconceptions include treating memory as model training or assuming a larger context window provides permanent recall. Adding prior messages to a request does not update model weights, and a context window is finite working space rather than durable storage. Conversation memory also differs from retrieval-augmented generation over a document collection: both enrich context, but conversational memory concerns interaction history, while document retrieval typically supplies external knowledge. An application can use both together.

Memory requires security and quality controls. Isolate records by user and tenant, encrypt stored data, restrict access, and avoid retaining credentials or unnecessary sensitive information. Treat remembered user content as untrusted data, not as authority to override system instructions. Support corrections, expiration, and deletion across transcripts, summaries, and derived indexes. Evaluate whether the assistant retains critical constraints, respects updated preferences, and avoids leaking information between conversations.

Learn Conversation Memory in lessons

7 short lessons on Conversation Memory in 4 certification courses.

and 1 more lesson

Open the lessons