add_memory
Store a new memory with automatic deduplication and indexing. Use for persisting facts, preferences, or conversation context. Prefer this overupdate_memory for new content.
string
Plain text content to store. Use instead of
messages for simple facts.array
Conversation messages to store. Use instead of
content for multi-turn context. Each item needs role (user, assistant, or system) and content.string
User namespace for memory isolation. Default is the value of
MEM0_USER_ID.object
Key-value pairs for categorization. Searchable via
search_memory.string
Cache priority:
high (L1, 24h TTL), medium (standard), or low (L2, 7d TTL). Default: medium.boolean
true returns immediately and indexes in the background. false blocks until complete. Default: true.boolean
Bypass duplicate detection. Use only when intentionally storing similar content. Default:
false.Saved or Already saved.
get_memory
Retrieve a single memory by its unique ID. Use when you have a specificmemory_id from prior search or list results.
string
required
Unique identifier of the memory to retrieve.
string
User namespace. Must match the
user_id used when the memory was created.{id, content, user_id, metadata} or null if not found.
update_memory
Modify an existing memory’s content or metadata. Use for corrections or adding context. Fails ifmemory_id is not found.
string
required
Unique identifier of the memory to update.
string
New content to replace existing. Omit to keep current content unchanged.
object
Metadata fields to merge. Existing fields not specified are preserved.
string
User namespace. Must match the original.
delete_memory
Permanently remove a memory by ID. This is irreversible and removes the record from storage, cache, and search index.string
required
Unique identifier of the memory to delete.
search_memory
Find memories matching a natural language query using hybrid semantic and keyword search. This is the primary retrieval tool for content-based lookup.string
required
Natural language search query. Supports keywords, phrases, or questions.
string
User namespace to search within. Default is
MEM0_USER_ID.number
Maximum results to return. Range: 1-100. Default: 10.
boolean
true checks cache first, then falls back to storage. false queries storage directly. Default: true.No memories found.
get_all_memories
List all memories for a user with pagination. Use for browsing or bulk operations. For content search, prefersearch_memory.
string
User namespace to list. Default is
MEM0_USER_ID.number
Maximum memories per page. Range: 1-500. Default: 100.
number
Number of memories to skip. Use for pagination. Default: 0.
boolean
Append cache statistics to the response. Default:
true.boolean
true returns cached memories (faster). false fetches from storage (fresher). Default: true.{total, limit, offset, returned, hasMore, source, memories[]}.
deduplicate_memories
Detect and optionally remove duplicate memories using content similarity. Run withdry_run: true first to preview.
string
User namespace to deduplicate. Default is
MEM0_USER_ID.number
Minimum similarity (0-1) to consider as duplicate. Range: 0.5-1.0. Default: 0.85.
boolean
true previews duplicates without deletion. false actually deletes duplicates. Default: true.import_memories
Bulk import memories from external sources. Supports Mem0 API export or local JSON files. Processes in batches with duplicate detection.string
required
Import source:
mem0_api or json_file.string
Mem0 API token. Required when
source is mem0_api.string
Absolute path to JSON file. Required when
source is json_file. Must be an array of memory objects or {memories: [...]}.string
User namespace for imported memories. Default is
MEM0_USER_ID.number
Memories per batch. Range: 10-200. Default: 50.
string
Cache priority for all imported memories:
high, medium, or low. Default: high.boolean
Check each memory for duplicates before import. Default:
true.Related
Cache Tools
Inspect cache health, optimize hit rates, and check sync status.
Knowledge Graph
Extract entities and traverse relationships in enhanced mode.