Setup
search and get_all take the user inside filters={"user_id": ...} and raise ValueError on a top-level user_id. search caps results with top_k. add and delete_all still take user_id directly.
Set your keys in the environment. Replace the values with your Orgo API key and your OpenAI API key (Mem0 uses OpenAI by default).
Example
Managing memories
How it works
- Search: before each task, query Mem0 for relevant memories
- Inject: add memories as context in the prompt
- Execute: the AI agent acts with full context of past preferences
- Store: save new interactions so future tasks benefit
user_id maintains its own separate memory, so you can run multiple users or contexts (e.g. "work" vs "personal").
Learn more
Mem0 Docs
Memory API reference
Computer Use API
Orgo completions endpoint