Mem0

App · AI Search & Memory · 5 actions

Give your workflows a long-term memory: store what you learn about a person or agent in Mem0 and search it back in plain language.

Actions

ActionWhat it does
Add memoriesExtract durable facts from a conversation (or a block of text) and store them in Mem0 against a user, agent, run or app.
Delete memoryPermanently delete a single memory by its ID.
Get memoriesList everything Mem0 has stored for a user, agent, run or app, one page at a time.
Search memoriesSearch stored memories in plain language and get the most relevant ones back, each with a relevance score.
Update memoryChange a single memory's text, metadata or expiration date.

Add memories

Extract durable facts from a conversation (or a block of text) and store them in Mem0 against a user, agent, run or app.

Inputs

MessagesmessageslistRequired
What Mem0 should remember. Pass a block of text, or the conversation turns as a list of objects, e.g. [{"role": "user", "content": "I moved to Austin last month."}]. Roles are user, assistant or system.
User IDuser_idtext
The person these memories belong to, your own identifier for them, e.g. 'alice' or a customer id. Supply at least one of User ID, Agent ID, Run ID or App ID.
Agent IDagent_idtext
The AI agent these memories belong to, e.g. 'support-agent'.
Run IDrun_idtext
The session or run these memories belong to, for short-term memory scoped to one conversation.
App IDapp_idtext
The app these memories belong to, e.g. 'helpdesk'.
Metadatametadataobject
Optional key/value data to attach to every memory this call extracts, e.g. {"source": "onboarding_form"}. You can filter on it later.
Extract factsinfertrue/false
Let Mem0's extraction model pull the facts out of the messages. Turn this off to store the text exactly as given, which also makes the call finish immediately instead of being queued.Default: true.
Expires onexpiration_datedate
Optional date (YYYY-MM-DD) the memories stay visible through. After it passes they are hidden from search and get-all unless expired memories are included.

Outputs

event_idtext
Identifier for the queued extraction job. Empty when fact extraction was turned off, because that path completes immediately.
messagetext
Mem0's acknowledgment of the request.
statustext
Job status: PENDING while extraction is queued, then SUCCEEDED or FAILED.
Example output
{
  "event_id": "2c4d1f44-4f7b-4b2f-9f6e-7b5b4f5a1234",
  "message": "Memory processing has been queued for background execution",
  "status": "PENDING"
}

Delete memory

Permanently delete a single memory by its ID.

Inputs

Memory IDmemory_idtextRequired
The ID of the memory to act on, as returned by Search memories or Get memories.

Outputs

idtext
The ID of the deleted memory.
messagetext
Mem0's confirmation of the deletion.
Example output
{
  "id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
  "message": "Memory deleted successfully!"
}

Get memories

List everything Mem0 has stored for a user, agent, run or app, one page at a time.

Inputs

User IDuser_idtext
The person these memories belong to, your own identifier for them, e.g. 'alice' or a customer id. Supply at least one of User ID, Agent ID, Run ID or App ID.
Agent IDagent_idtext
The AI agent these memories belong to, e.g. 'support-agent'.
Run IDrun_idtext
The session or run these memories belong to, for short-term memory scoped to one conversation.
App IDapp_idtext
The app these memories belong to, e.g. 'helpdesk'.
Extra filtersfiltersobject
Optional. Extra conditions combined with the IDs above, e.g. {"categories": {"contains": "finance"}} or {"created_at": {"gte": "2026-07-01"}}. Supports AND, OR, NOT and the in/gte/lte/gt/lt/ne/icontains operators.
Include expired memoriesshow_expiredtrue/false
Include memories whose expiration date has passed. They stay stored after expiring but are hidden by default.Default: false.
Pagepagenumber
Which page of results to return. Starts at 1.At least 1. Default: 1.
Page sizepage_sizenumber
How many memories per page (1-200). Defaults to 100.From 1 to 200. Default: 100.

Outputs

countnumber
Total memories matching the filters.
nexttext
URL of the next page, or null on the last page.
previoustext
URL of the previous page, or null on the first page.
resultslist
The memories on this page.
Example output
{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "categories": [
        "personal_information"
      ],
      "created_at": "2026-07-01T12:00:00Z",
      "expiration_date": null,
      "id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
      "memory": "Alice moved to Austin in June 2026",
      "metadata": {
        "source": "onboarding_form"
      },
      "updated_at": "2026-07-01T12:00:00Z"
    }
  ]
}

Search memories

Search stored memories in plain language and get the most relevant ones back, each with a relevance score.

Inputs

QueryquerytextRequired
What to look for, in plain language, e.g. 'What are Alice's food preferences?'.
User IDuser_idtext
The person these memories belong to, your own identifier for them, e.g. 'alice' or a customer id. Supply at least one of User ID, Agent ID, Run ID or App ID.
Agent IDagent_idtext
The AI agent these memories belong to, e.g. 'support-agent'.
Run IDrun_idtext
The session or run these memories belong to, for short-term memory scoped to one conversation.
App IDapp_idtext
The app these memories belong to, e.g. 'helpdesk'.
Extra filtersfiltersobject
Optional. Extra conditions combined with the IDs above, e.g. {"categories": {"contains": "finance"}} or {"created_at": {"gte": "2026-07-01"}}. Supports AND, OR, NOT and the in/gte/lte/gt/lt/ne/icontains operators.
Max resultstop_knumber
How many memories to return (1-1000). Defaults to 10.From 1 to 1000. Default: 10.
Minimum scorethresholdnumber
Drop results scoring below this (0-1). Defaults to 0.1; set 0 to keep everything.From 0 to 1. Default: 0.1.
Rerank resultsreranktrue/false
Run Mem0's reranker over the matches for better ordering. More accurate, but slower.Default: false.
Include expired memoriesshow_expiredtrue/false
Include memories whose expiration date has passed. They stay stored after expiring but are hidden by default.Default: false.

Outputs

resultslist
The matching memories, most relevant first.
Example output
{
  "results": [
    {
      "categories": [
        "personal_information"
      ],
      "created_at": "2026-07-01T12:00:00Z",
      "expiration_date": null,
      "id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
      "memory": "Alice moved to Austin in June 2026",
      "metadata": {
        "source": "onboarding_form"
      },
      "score": 0.82,
      "updated_at": "2026-07-01T12:00:00Z"
    }
  ]
}

Update memory

Change a single memory's text, metadata or expiration date.

Inputs

Memory IDmemory_idtextRequired
The ID of the memory to act on, as returned by Search memories or Get memories.
New texttexttext
The replacement text for the memory.
Metadatametadataobject
Replacement key/value data for the memory, e.g. {"category": "preferences"}.
Expires onexpiration_datedate
New expiration date (YYYY-MM-DD) for the memory. Leave empty to keep the current one.
Make permanentclear_expiration_datetrue/false
Remove the memory's expiration date so it never expires. Can't be combined with a new expiration date.Default: false.

Outputs

categorieslist
Categories Mem0 classified the memory under.
created_attext
When the memory was created.
expiration_datetext
Date the memory expires (YYYY-MM-DD), or null if permanent.
idtext
Unique memory identifier, used to update or delete it.
memorytext
The stored fact.
metadataobject
Metadata attached to the memory when it was added.
updated_attext
When the memory last changed.
Example output
{
  "categories": [
    "personal_information"
  ],
  "created_at": "2026-07-01T12:00:00Z",
  "expiration_date": null,
  "id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
  "memory": "Alice moved to Austin in June 2026 and works downtown",
  "metadata": {
    "source": "onboarding_form"
  },
  "updated_at": "2026-07-15T09:12:00Z"
}

On this page