Get started with Mem0 Platform in minutes
user_id
, memories are primarily created based on user messages, but may be influenced by assistant messages for contextual understanding. For example, in a conversation about food preferences, both the user’s stated preferences and their responses to the assistant’s questions would form user memories. Similarly, when using agent_id
, assistant messages are prioritized, but user messages might influence the agent’s memories based on context. This approach ensures comprehensive memory creation while maintaining appropriate attribution to either users or agents.Example:agent_id
retains memories exclusively based on messages generated by the assistant or those explicitly provided as input to the assistant. Messages outside these criteria are not stored as memory.user_id
and agent_id
, Mem0 will store memories for both identifiers separately:
"role": "user"
are automatically tagged with the provided user_id
"role": "assistant"
are automatically tagged with the provided agent_id
user_id
or agent_id
to access the respective memoriesuser_id
or agent_id
in subsequent API calls, either together or separately, allowing for progressive memory building over timeasync_mode=True
, memory processing happens completely asynchronously in the background. This allows for faster API responses while your memories are processed. The memories will be available on the dashboard and for retrieval within a few seconds.
search
method supports two output formats: v1.0
(default) and v1.1
. To use the latest format, which provides more detailed information about each memory operation, set the output_format
parameter to v1.1
: version
as v2
in the search method.
Example 1: Search using user_id and agent_id filters
get_all
method supports two output formats: v1.0
(default) and v1.1
. To use the latest format, which provides more detailed information about each memory operation, set the output_format
parameter to v1.1
: page
and page_size
parameters. version
as v2
in the get_all method.
Example 1. Get all memories using user_id and date filters
add()
method by passing a natural language command: