Mem0 Memory
AI-generatedSummary
Retrieve and output AI memory data from the Mem0 service using various context retrieval modes and filters.
Inputs
- Autenticação (required) — Choose between cloud (mem0.ai) or self-hosted authentication.
- ID da Thread (required) — Unique identifier of the conversation/thread; used as user_id if no explicit user ID is given.
- Modo de Recuperação de Contexto (required) — Select the memory retrieval mode: Basic (raw memories), Summary (text summary), Semantic (v1 or v2) for semantic search, or Hybrid combining recent memories with semantic search.
- Consulta — Natural language query to find relevant memories; required for semantic and hybrid modes.
- Chave de Memória (required) — Key under which the retrieved memory data will be returned in the output JSON.
- Opções Avançadas — Advanced options including User ID, Agent ID, App ID, Run ID, top K results count, reranking flag, fields to return, filters JSON for semantic v2 and hybrid modes, number of recent memories to retrieve, semantic weight, decay half-life, maximum items to return, and diversity parameters (MMR).
Output shape
A single item containing a JSON object with a property named as specified by 'memoryKey', holding an array of memory entries.
Each memory entry is an object with 'role':'system' and 'content' containing memory text or JSON stringified memory. Retrieval mode determines whether raw memories, a summary, or semantically ranked results are returned. Semantic and hybrid modes support advanced filtering, reranking, and diversity control. The output can include up to the configured maximum number of memories and respects pagination by slicing recent items if configured.
Examples
Example 1: Retrieve the last 20 raw memory items by thread ID, output under the key 'chat_history'.
authType='cloud', retrievalMode='basic', threadId set or defaulted, lastN=20, memoryKey='chat_history'.
Example 2: Perform a semantic search to find relevant memories for a user query.
authType='cloud', retrievalMode='semantic', query provided, advanced options like userId, topK, rerank configurable.