Search Memories (v2)
Search memories based on a query and filters.
The v2 search API is powerful and flexible, allowing for more precise memory retrieval. It supports complex logical operations (AND, OR) and comparison operators for advanced filtering capabilities. The comparison operators include:
-
in
: Matches any of the values specified -
gte
: Greater than or equal to -
lte
: Less than or equal to -
gt
: Greater than -
lt
: Less than -
ne
: Not equal to -
icontains
: Case-insensitive containment check
Authorizations
API key authentication. Prefix your Mem0 API key with 'Token '. Example: 'Token your_api_key'
Body
The query to search for in the memory.
A dictionary of filters to apply to the search. Available fields are: user_id, agent_id, app_id, run_id, created_at, updated_at, categories, keywords. Supports logical operators (AND, OR) and comparison operators (in, gte, lte, gt, lt, ne, contains, icontains).
The number of top results to return.
A list of field names to include in the response. If not provided, all fields will be returned.
Whether to rerank the memories.
Whether to search for memories based on keywords.
Whether to filter the memories.
The minimum similarity threshold for returned results.
The unique identifier of the organization associated with the memory.
The unique identifier of the project associated with the memory.
Response
Unique identifier for the memory
The content of the memory
The identifier of the user associated with this memory
The timestamp when the memory was created
The timestamp when the memory was last updated
Additional metadata associated with the memory
Categories associated with the memory