V2 Search Memories
Search memories based on a query and filters.
Mem0 offers two versions of the search API: v1 and v2. Here’s how they differ:
Key difference between v1 and v2 search:
• Filters: v2 allows you to apply filters to narrow down search results based on specific criteria. This includes support for complex logical operations (AND, OR) and comparison operators (IN, gte, lte, gt, lt, ne, icontains) for advanced filtering capabilities.
The v2 search API is more powerful and flexible, allowing for more precise memory retrieval.
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. Users can pass AND, OR, IN, gte, lte, gt, lt, ne, icontains operators for advanced filtering.
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.
The name of the organization associated with the memory.
The name of the project associated with the memory.
Response
Unique identifier for the memory
The content of the memory
The conversation input that was used to generate this memory
The identifier of the user associated with this memory
A hash of the memory content
Additional metadata associated with the memory
The timestamp when the memory was created
The timestamp when the memory was last updated