# Mem0

> 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.

App · AI Search & Memory · 5 actions. Web page: https://docs.lodol.com/docs/integrations/mem0

## Actions

### 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**

- Messages (`messages`, list, required): 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 ID (`user_id`, text): 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 ID (`agent_id`, text): The AI agent these memories belong to, e.g. 'support-agent'.
- Run ID (`run_id`, text): The session or run these memories belong to, for short-term memory scoped to one conversation.
- App ID (`app_id`, text): The app these memories belong to, e.g. 'helpdesk'.
- Metadata (`metadata`, object): Optional key/value data to attach to every memory this call extracts, e.g. {"source": "onboarding_form"}. You can filter on it later.
- Extract facts (`infer`, true/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 on (`expiration_date`, date): 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_id` (text): Identifier for the queued extraction job. Empty when fact extraction was turned off, because that path completes immediately.
- `message` (text): Mem0's acknowledgment of the request.
- `status` (text): Job status: PENDING while extraction is queued, then SUCCEEDED or FAILED.

**Example output**

```json
{
  "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 ID (`memory_id`, text, required): The ID of the memory to act on, as returned by Search memories or Get memories.

**Outputs**

- `id` (text): The ID of the deleted memory.
- `message` (text): Mem0's confirmation of the deletion.

**Example output**

```json
{
  "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 ID (`user_id`, text): 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 ID (`agent_id`, text): The AI agent these memories belong to, e.g. 'support-agent'.
- Run ID (`run_id`, text): The session or run these memories belong to, for short-term memory scoped to one conversation.
- App ID (`app_id`, text): The app these memories belong to, e.g. 'helpdesk'.
- Extra filters (`filters`, object): 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 memories (`show_expired`, true/false): Include memories whose expiration date has passed. They stay stored after expiring but are hidden by default. Default: `false`.
- Page (`page`, number): Which page of results to return. Starts at 1. At least 1. Default: `1`.
- Page size (`page_size`, number): How many memories per page (1-200). Defaults to 100. From 1 to 200. Default: `100`.

**Outputs**

- `count` (number): Total memories matching the filters.
- `next` (text): URL of the next page, or null on the last page.
- `previous` (text): URL of the previous page, or null on the first page.
- `results` (list): The memories on this page.

**Example output**

```json
{
  "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**

- Query (`query`, text, required): What to look for, in plain language, e.g. 'What are Alice's food preferences?'.
- User ID (`user_id`, text): 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 ID (`agent_id`, text): The AI agent these memories belong to, e.g. 'support-agent'.
- Run ID (`run_id`, text): The session or run these memories belong to, for short-term memory scoped to one conversation.
- App ID (`app_id`, text): The app these memories belong to, e.g. 'helpdesk'.
- Extra filters (`filters`, object): 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 results (`top_k`, number): How many memories to return (1-1000). Defaults to 10. From 1 to 1000. Default: `10`.
- Minimum score (`threshold`, number): Drop results scoring below this (0-1). Defaults to 0.1; set 0 to keep everything. From 0 to 1. Default: `0.1`.
- Rerank results (`rerank`, true/false): Run Mem0's reranker over the matches for better ordering. More accurate, but slower. Default: `false`.
- Include expired memories (`show_expired`, true/false): Include memories whose expiration date has passed. They stay stored after expiring but are hidden by default. Default: `false`.

**Outputs**

- `results` (list): The matching memories, most relevant first.

**Example output**

```json
{
  "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 ID (`memory_id`, text, required): The ID of the memory to act on, as returned by Search memories or Get memories.
- New text (`text`, text): The replacement text for the memory.
- Metadata (`metadata`, object): Replacement key/value data for the memory, e.g. {"category": "preferences"}.
- Expires on (`expiration_date`, date): New expiration date (YYYY-MM-DD) for the memory. Leave empty to keep the current one.
- Make permanent (`clear_expiration_date`, true/false): Remove the memory's expiration date so it never expires. Can't be combined with a new expiration date. Default: `false`.

**Outputs**

- `categories` (list): Categories Mem0 classified the memory under.
- `created_at` (text): When the memory was created.
- `expiration_date` (text): Date the memory expires (YYYY-MM-DD), or null if permanent.
- `id` (text): Unique memory identifier, used to update or delete it.
- `memory` (text): The stored fact.
- `metadata` (object): Metadata attached to the memory when it was added.
- `updated_at` (text): When the memory last changed.

**Example output**

```json
{
  "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"
}
```
