API Reference
- Overview
- Memory APIs
- POSTAdd Memories
- POSTSearch Memories (v2)
- POSTSearch Memories (v1 - Deprecated)
- POSTGet Memories (v2)
- GETGet Memories (v1 - Deprecated)
- GETMemory History
- GETGet Memory
- PUTUpdate Memory
- PUTBatch Update Memories
- DELDelete Memory
- DELBatch Delete Memories
- DELDelete Memories
- POSTCreate Memory Export
- POSTGet Memory Export
- POSTFeedback
- POST
- Entities APIs
- Organizations APIs
- Project APIs
- Webhook APIs
Memory APIs
Memory History
Retrieve the history of a memory.
GET
/
v1
/
memories
/
{memory_id}
/
history
/
Copy
# To use the Python SDK, install the package:
# pip install mem0ai
from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key", org_id="your_org_id", project_id="your_project_id")
# Add some message to create history
messages = [{"role": "user", "content": "<user-message>"}]
client.add(messages, user_id="<user-id>")
# Add second message to update history
messages.append({"role": "user", "content": "<user-message>"})
client.add(messages, user_id="<user-id>")
# Get history of how memory changed over time
memory_id = "<memory-id-here>"
history = client.history(memory_id)
Copy
[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"memory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": [
{
"role": "user",
"content": "<string>"
}
],
"old_memory": "<string>",
"new_memory": "<string>",
"user_id": "<string>",
"event": "ADD",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
Authorizations
API key authentication. Prefix your Mem0 API key with 'Token '. Example: 'Token your_api_key'
Path Parameters
The unique identifier of the memory to retrieve
Response
200 - application/json
Successfully retrieved the memory history
The response is of type object[]
.
Copy
# To use the Python SDK, install the package:
# pip install mem0ai
from mem0 import MemoryClient
client = MemoryClient(api_key="your_api_key", org_id="your_org_id", project_id="your_project_id")
# Add some message to create history
messages = [{"role": "user", "content": "<user-message>"}]
client.add(messages, user_id="<user-id>")
# Add second message to update history
messages.append({"role": "user", "content": "<user-message>"})
client.add(messages, user_id="<user-id>")
# Get history of how memory changed over time
memory_id = "<memory-id-here>"
history = client.history(memory_id)
Copy
[
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"memory_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"input": [
{
"role": "user",
"content": "<string>"
}
],
"old_memory": "<string>",
"new_memory": "<string>",
"user_id": "<string>",
"event": "ADD",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
Assistant
Responses are generated using AI and may contain mistakes.