AgentLoop Memory Store (MemoryStore) provides AI agents with persistent memory that stores user preferences, important facts, and reusable context. An application writes conversations to Memory Store through the mem0-compatible interface, retrieves relevant memories in later interactions, and passes the results to the agent to keep the service continuous across sessions.
Why use Memory Store
In a new session, an agent can use only the context that the application passes to it. If the application does not carry over the history, users must explain their background information, preferences, and requirements again. For example, a user tells the assistant, "I prefer mild dishes that are not too spicy." The next time the user asks for dinner suggestions, the user may still have to repeat that preference.
As interactions increase, carrying the full history with every request also brings in a large amount of content that is unrelated to the current question. Memory Store retains the reusable information from conversations, so the application can retrieve the information that is relevant to the current question and assemble the context for that request.
Memory Store helps you solve the following problems:
Continuity across sessions — In a new interaction, reuse the background information that users already provided and reduce repeated questions.
Personalized service — Use the communication style, interests, and preferences of users as a reference for answers.
Context for the current task — Retrieve the information that is related to the current question so that the agent understands the specific needs of the user.
Key concepts
Concept | Description | Example |
Memory Store | The resource that manages memory data. A Memory Store is created in an agent space, and applications connect to it through the corresponding API key | Create |
Conversation message (short-term memory) | The raw interaction content that the application writes, which serves as the input for memory extraction | The user says, "I prefer mild dishes that are not too spicy," and the assistant replies |
Long-term memory | The information that is extracted from interactions and reused in later retrieval | The user prefers mild food that is not too spicy |
User identifier | The identifier that the application assigns to a business user to associate and retrieve the memories of that user |
|
How Memory Store works
The flow from a conversation to a later answer usually includes the following stages:
Write the conversation — The application sends the messages from the user and the assistant to Memory Store and associates them with a user identifier.
Extract memories — In the write request, the application sets the
inferparameter totrueto extract reusable information into long-term memories.Retrieve relevant memories — When the user asks a new question, the application retrieves the relevant memories by using a query statement and the user identifier.
Assemble the context — The application selects the memories that are related to the current question and passes them to the agent together with the current question and the necessary recent conversation.
Keep accumulating information — After the current round of conversation ends, the application can write the new interaction content for later processing and retrieval.
The examples in the Key concepts table illustrate the concepts only. The actual extracted wording and the number of entries depend on the retrieval results, and one sentence in a conversation does not necessarily correspond to one long-term memory.
A successful memory write, retrievable long-term memories, and an agent that uses these memories in its answers are three stages that you must verify separately. Use Long-term Memory Retrieval in the console to confirm that the long-term memories are retrievable.
Common scenarios
The following table lists the common scenarios for Memory Store:
Scenario | Information to accumulate | How it is used later |
Personal life assistant | Food preferences, travel preferences, and daily habits | Retrieve the preferences that are related to the current request before generating a suggestion |
Customer service assistant | Background information about product usage and the service preferences that users provide | Carry the information that users already provided into a new session to reduce repeated confirmation |
Learning assistant | The topics, goals, and explanation preferences of the user | Adjust the focus and the style of explanations when answering questions |
Work assistant | The work topics, output formats, and communication habits that the user cares about | Refer to the requirements of the user when generating a brief or an analysis result |
For example, a cooking assistant can use memories in the following way:
Interaction stage | Action of the user or application | Role of the memory |
First contact | The user states, "I prefer mild dishes that are not too spicy." | The application writes the conversation and accumulates the food preference |
Follow-up question | The user asks, "What should I have for dinner tonight?" in a new session | The application retrieves the food preferences of that user |
Suggestion generation | The application adds the relevant preferences to the context of the current request | The agent combines the preferences with the current question to make a suggestion |
Memories provide a reference for answers. The application must also pass the new requirements that the user states in the current request to the agent, instead of relying only on the historical information.
Console features
The console provides the following capabilities for a Memory Store.
Manage a Memory Store
Create Memory Store — Enter a Memory Store name and an optional description.
Overview — View the basic information of the Memory Store, such as the name, description, creation time, and update time.
API Key — Create an API key for external applications to access the Memory Store.
Verify retrieval results
Long-term Memory Retrieval — Enter a query statement and topK, and limit the retrieval scope by user ID, App ID, Agent ID, and Run ID.
Integrate your application
Integration — View and copy the HTTP API or Python SDK integration example.
Applications read and write memories through the mem0-compatible interface. After the Memory Store is created, the application still needs to integrate the write and retrieval flows and add the retrieval results to model requests. For the endpoint, how to call the API, and the parameters, use the example on the Integration tab of the Memory Store that you want to use.
Get started
Before you integrate Memory Store, make sure that the following items are in place:
An agent space. A Memory Store is created in an agent space.
A Memory Store. Enter a Memory Store name and an optional description in the console.
An API key. Applications connect to the Memory Store through the corresponding API key.
The endpoint, how to call the API, and the parameters, which are provided in the integration example on the Integration tab.
Start with one specific scenario. Write a sample conversation that clearly expresses a preference, retrieve the memories that are extracted from the conversation, and add the retrieved memories to the context that your application sends to the agent.
For the procedure, the HTTP write example, the recommendations for user identifiers, and the FAQ, see Use a memory store.