Skip to main content
r3 exposes memory operations as MCP tools. This page documents the 8 always-available memory tools. See Cache Tools for cache and sync, and Knowledge Graph for enhanced-mode entity and graph tools.

add_memory

Store a new memory with automatic deduplication and indexing. Use for persisting facts, preferences, or conversation context. Prefer this over update_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.
Returns: Saved or Already saved.

get_memory

Retrieve a single memory by its unique ID. Use when you have a specific memory_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.
Returns: Memory object {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 if memory_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.
Returns: Updated memory object.

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.
Returns: Confirmation text.

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.
Returns: Array of memory objects, or No memories found.

get_all_memories

List all memories for a user with pagination. Use for browsing or bulk operations. For content search, prefer search_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.
Returns: {total, limit, offset, returned, hasMore, source, memories[]}.

deduplicate_memories

Detect and optionally remove duplicate memories using content similarity. Run with dry_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.
Returns: Summary with duplicate groups.

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.
Returns: Summary with imported, skipped, and failed counts.

Cache Tools

Inspect cache health, optimize hit rates, and check sync status.

Knowledge Graph

Extract entities and traverse relationships in enhanced mode.
Last modified on September 20, 2026