Comprehensive guide to advanced memory operations and features
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.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 timeversion
as v2
in the search method.
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.