Skip to main content
Mem0 flow Mem0 is a self-improving memory layer for LLM applications, enabling personalized AI experiences that save costs and delight users. Mem0 + Keywords AI provides a powerful combination for building AI applications that can remember user interactions over time and get complete LLM observability. Check out the Mem0 documentation for more information.

Quickstart

Prerequisites

Add memory with Mem0 SDK

Install the Mem0 Python client
Add Keywords AI gateway to the Mem0 client as an LLM provider. You can go to the Models page to find the available models.
Python

Add memory with OpenAI SDK

Currently we only support adding memory to your AI products using the OpenAI SDK integration. Once you integrate Keywords AI gateway with the OpenAI SDK, you can add memory to your AI product by following the code example below.
OpenAI Python SDK
In this case, the messages will be added to the memory and the query will be used to search the memory.

Add memory through Keywords AI SDK

We recommend using the Keywords AI SDK for better type checking and autocomplete. Install the Keywords AI SDK
Keywords AI Python SDK

Search memories

Once you pass the params like mem0_search_memories_response and mem0_add_memories_response to your prompt, you can view the responses in the side panel of Logs page.
Mem0 params
You can search memories by using the search_memories parameter in the Mem0Params object.
Python