New260+ blocks and 240+ tools are now fully documented
DocumentationReferenceCore BlocksAI & ML
Block

Mem0 Block

Agent memory management

The Mem0 block adds long-term memory to your AI agents using Mem0. Add, search, and retrieve memories to persist conversation history, user preferences, and context across workflow executions for enhanced AI agent capabilities.

Overview

PropertyValue
Typemem0
Categorytools
Color#181C1E

When to Use

  • Store conversation messages so an agent remembers prior turns across executions
  • Persist user preferences and facts tied to a specific user ID
  • Search past memories with a natural-language query to enrich an agent's context
  • Retrieve a specific memory by ID or pull all memories for a user within a date range
  • Cap the number of results returned from search and get operations with a result limit
  • Build personalized agent experiences that carry context from one workflow run to the next

Configuration

Operation

Dropdown that selects which action to perform. Defaults to add.

LabelID
Add Memoriesadd
Search Memoriessearch
Get Memoriesget

User ID

Required for all operations. Scopes memories to a specific user so that stored data is isolated per-user.

Messages

Shown only when operation is add. Required. A JSON array of message objects, each with role and content fields (e.g. [{"role": "user", "content": "I love Zelaxy!"}]). The array must be non-empty and every element must have both role and content.

Search Query

Shown only when operation is search. Required. A natural-language query used for semantic search over stored memories.

Memory ID

Shown only when operation is get. Optional. When provided, retrieves that single specific memory by its ID using the GET /v1/memories/{id}/ endpoint. When omitted, all memories matching the user and date filters are returned.

Start Date / End Date

Shown only when operation is get. Optional date range filters in YYYY-MM-DD format. Memories whose created_at timestamp falls within the range are returned.

API Key

Required for all operations. Your Mem0 platform API key. Stored as a password (masked) field. Pass it as a secret reference: {{MEM0_API_KEY}}.

Result Limit

Slider (1–50, integer steps). Shown when operation is search or get. Caps the number of results returned. Defaults to 10 when not set.

Inputs & Outputs

Inputs:

  • operation (string) — Operation to perform (add, search, or get)
  • apiKey (string) — Mem0 API key
  • userId (string) — User identifier
  • version (string) — API version
  • messages (json) — Message data array (required for add)
  • query (string) — Search query (required for search)
  • memoryId (string) — Memory identifier (optional, for get)
  • startDate (string) — Start date filter in YYYY-MM-DD format (for get)
  • endDate (string) — End date filter in YYYY-MM-DD format (for get)
  • limit (number) — Result limit (for search and get)

Outputs:

  • ids (json) — Memory identifiers returned by the operation
  • memories (json) — Memory data objects returned by add and get operations
  • searchResults (json) — Search result objects returned by the search operation, each containing id, data.memory, and score

Tools

  • Add Memories (mem0_add_memories) — POSTs a messages array to https://api.mem0.ai/v1/memories/ scoped to the given user_id. Returns ids (array of created memory IDs) and memories (array of created memory objects).
  • Search Memories (mem0_search_memories) — POSTs a semantic search request to https://api.mem0.ai/v2/memories/search/ with the query and user_id filter. Returns searchResults (array of objects with id, data.memory, and score) and ids.
  • Get Memories (mem0_get_memories) — Retrieves memories by user or by a specific ID. When memoryId is provided, calls GET https://api.mem0.ai/v1/memories/{id}/; otherwise POSTs to https://api.mem0.ai/v2/memories/ with user and date-range filters. Returns memories and ids.

YAML Example

mem0_1:
  type: mem0
  name: "Mem0"
  inputs:
    operation: "add"
    userId: "{{start.userId}}"
    messages: '[{"role": "user", "content": "I love Zelaxy!"}]'
    apiKey: "{{MEM0_API_KEY}}"
  connections:
    outgoing:
      - target: next-block-id