OpenAI Compatibility
Mem0 can be easily integrated into chat applications to enhance conversational agents with structured memory. Mem0’s APIs are designed to be compatible with OpenAI’s, with the goal of making it easy to leverage Mem0 in applications you may have already built.
If you have a Mem0 API key
, you can use it to initialize the client. Alternatively, you can initialize Mem0 without an API key if you’re using it locally.
Mem0 supports several language models (LLMs) through integration with various providers.
Use Mem0 Platform
In this example, you can see how the second response is tailored based on the information provided in the first interaction. Mem0 remembers the user’s preference for Indian food and their cheese allergy, using this information to provide more relevant and personalized restaurant suggestions in San Francisco.
Use Mem0 OSS
Mem0 Params for Chat Completion
-
user_id
(Optional[str]): Identifier for the user. -
agent_id
(Optional[str]): Identifier for the agent. -
run_id
(Optional[str]): Identifier for the run. -
metadata
(Optional[dict]): Additional metadata to be stored with the memory. -
filters
(Optional[dict]): Filters to apply when searching for relevant memories. -
limit
(Optional[int]): Maximum number of relevant memories to retrieve. Default is 10.
Other parameters are similar to OpenAI’s API, making it easy to integrate Mem0 into your existing applications.