All Products
Search
Document Center

Agent Run:Memory store

Last Updated:Aug 24, 2026

Memory Store is a persistent memory management service for agents. It combines long-term memory, conversation history, and conversation state to enable personalized responses, multi-turn conversations, and resumption from interruption.

What is memory store

Memory Store is a persistent memory management service for agents that saves and retrieves context from user interactions. With Memory Store enabled, an agent can remember what a user has said, their preferred style, and any consensus reached, delivering a continuous and personalized experience.

The following table describes the components of Memory Store.

Component

Role

Data stored

AgentRuntime

Provides the underlying capabilities for Memory Store.

Memory Store instance

Manages memory data centrally. When you create an instance, you can choose either Table Store (OTS) or Relational Database Service (RDS) as the backend storage.

long-term memory (user preferences, historical snippets), conversation history (complete conversation messages), conversation state (context snapshot for a single session)

agent

An agent is bound to a Memory Store instance during creation. The agent then automatically reads and writes memory data at runtime.

After you bind an agent to a Memory Store instance, it automatically reads and writes memory data, eliminating the need for custom memory management logic in your application code.

Three memory capabilities

Memory Store offers three complementary capabilities to meet different context management needs.

Long-term memory

Long-term memory persists contextual data such as user preferences and historical information across sessions. With vector search, an agent can retrieve the most relevant snippets from a large volume of stored memory, enabling true conversational continuity. Typical use cases include user profiling, personalized recommendations, and cross-session preference recall.

For more information, see Long-term memory.

Conversation history

Conversation history records complete conversation messages, allowing you to trace multi-turn conversations between an agent and a user. This feature is available only when OTS is used as the backend storage.

For more information, see Conversation history.

Conversation state

Conversation state manages context within a single session, letting you save and restore dialogue state during an agent's execution. Through integration with popular open-source frameworks like LangChain, Google ADK (Agent Development Kit), and LangGraph, it enables reliable multi-turn conversations and resumption from interruption.

For more information, see Conversation state.

Capability comparison

The three memory capabilities differ in storage type, supported frameworks, search methods, and typical use cases. You can combine them based on your specific requirements.

Storage type

Supported frameworks

Data granularity

Typical use cases

Long-term memory

MCP (Model Context Protocol) tools, LangChain

User-level preferences, historical snippets

Personalized recommendations, user profiling, cross-session preference memory

Conversation history

Built into AgentRuntime

Complete conversation messages

Conversation auditing, interaction tracing, quality analysis

Conversation state

LangChain, Google ADK (Agent Development Kit), LangGraph

Context snapshot for a single session

Resumption from interruption, multi-turn tasks, interruption recovery

OTS and RDS storage selection

When you create a Memory Store instance, you must select a backend storage type. Table Store (OTS) and Relational Database Service (RDS) differ in performance, cost, and feature support.

Dimension

Table Store (OTS)

Relational Database Service (RDS)

Supported capabilities

long-term memory, conversation history, conversation state

long-term memory only

Vector search

Supported

Supported

Scalability

Automatic horizontal scaling, suitable for massive data.

Primarily vertical scaling, suitable for small to medium scale.

Cost

Pay-as-you-go, more cost-effective for large data volumes.

Instance-based billing, ideal for scenarios where you already have RDS resources.

Recommended use cases

Large-scale production environments and scenarios that require conversation history

Development and testing, or reusing existing RDS infrastructure

Note

Conversation history is supported only when using OTS as the backend storage. If you need to record and trace complete conversation messages, select OTS.

Billing

OTS and RDS use different billing methods. OTS is billed based on storage capacity and the number of read/write operations. RDS is billed based on the instance specification.

Quick start

Choose the appropriate starting point based on your use case:

Create a Memory Store instance

To start using Memory Store, create a Memory Store instance and select a storage type. During creation, you can configure the storage capacity, read/write permissions, and associated agents.

For more information, see Create and manage Memory Store.

Enable long-term memory for personalized conversations

To enable an agent to remember user preferences and past interactions, enable long-term memory. Use MCP (Model Context Protocol) tools or LangChain to incorporate Memory Store into your agent's workflow.

For more information, see Long-term memory.

Configure conversation state for resumption

To allow an agent to resume a conversation from where it left off, enable conversation state. Use this feature with frameworks like LangChain, Google ADK (Agent Development Kit), or LangGraph.

For more information, see Conversation state.

View conversation history for interaction tracing

To audit or trace the complete conversation between an agent and a user, use conversation history. This feature is available only when using OTS as the backend storage.

For more information, see Conversation history.

Prerequisites

Before you use Memory Store, complete the following setup:

  • Ensure that you have granted the RAM user the necessary permissions for AgentRuntime, including at least the AliyunAgentRuntimeFullAccess permission policy. Without these permissions, creating and managing a Memory Store instance will fail with a permission error. For instructions, see the RAM user authorization documentation.

  • If you plan to integrate with open-source frameworks such as LangChain or Google ADK, ensure that you have installed the corresponding SDKs and completed the basic configuration.

Related documents

The following documents provide more detailed information.