Merge branch 'main' into feat/plugin-self-hosted-support
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
# Documentation (`docs/`)
|
||||
|
||||
Mintlify site published at https://docs.mem0.ai.
|
||||
|
||||
## Commands
|
||||
|
||||
```bash
|
||||
make docs # from repo root
|
||||
cd docs && mintlify dev
|
||||
```
|
||||
|
||||
## Structure
|
||||
|
||||
| Path | Contents |
|
||||
|------|----------|
|
||||
| `api-reference/` | Platform REST endpoints |
|
||||
| `open-source/` | Self-hosted SDK guides |
|
||||
| `platform/` | Hosted platform guides |
|
||||
| `integrations/` | One page per integration |
|
||||
| `core-concepts/` | Memory model, graph memory, scoping |
|
||||
| `cookbooks/` | End-to-end recipes |
|
||||
| `contributing/` | Contributor guides |
|
||||
| `docs.json` | Navigation tree |
|
||||
| `openapi.json` | Platform API spec |
|
||||
| `llms.txt` | Scope-tagged index for agents |
|
||||
|
||||
## Adding a page
|
||||
|
||||
Every new `.mdx` page needs three things, or CI fails:
|
||||
|
||||
1. The page itself under the right section.
|
||||
2. A navigation entry in `docs.json`.
|
||||
3. A line in `llms.txt` with a scope tag (`[Platform]`, `[OSS]`, or `[Both]`) and a description that starts with `Use when ...`.
|
||||
|
||||
`docs-llms-txt-check.yml` runs on every PR touching `docs/**/*.mdx` and **blocks the merge** when `llms.txt` is out of sync. To fix:
|
||||
|
||||
```bash
|
||||
python scripts/check-llms-txt-coverage.py --write
|
||||
```
|
||||
|
||||
That scaffolds placeholders under `## Unclassified - needs triage`. Then replace each `[TODO: ...]` tag, rewrite the descriptions as `Use when ...`, move entries into the correct section, and delete the triage heading once it is empty.
|
||||
|
||||
## Conventions
|
||||
|
||||
- Frontmatter needs `title`, `description`, and usually `icon`.
|
||||
- Mintlify components (`<Note>`, `<Card>`, `<Tabs>`, `<CodeGroup>`) are available; prefer them over raw HTML.
|
||||
- Code samples must be runnable. If a sample calls a public SDK method, it has to match the real signature.
|
||||
- Documentation-only PRs are exempt from the `accepted`-issue requirement in the PR gate, but not from the CLA.
|
||||
- Any change to a public SDK signature has to update the matching page here in the same PR.
|
||||
Symlink
+1
@@ -0,0 +1 @@
|
||||
AGENTS.md
|
||||
@@ -78,6 +78,38 @@ await memory.add(messages, { userId: 'alice', metadata: { category: 'movies' } }
|
||||
The TypeScript provider calls the Bedrock [Converse API](https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html), a single uniform interface across the current Bedrock model families. Streaming and `InvokeModel`-only models are not supported yet.
|
||||
</Note>
|
||||
|
||||
### Application inference profiles
|
||||
|
||||
Bedrock resolves the model family from the model identifier. An application inference profile ARN ends in an opaque ID, so there is nothing to resolve from. Set `provider_override` (Python) / `providerOverride` (TypeScript) when your model is one:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "aws_bedrock",
|
||||
"config": {
|
||||
"model": "arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123xyz",
|
||||
"provider_override": "anthropic",
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
const config = {
|
||||
llm: {
|
||||
provider: 'aws_bedrock',
|
||||
config: {
|
||||
model: 'arn:aws:bedrock:us-east-1:123456789012:application-inference-profile/abc123xyz',
|
||||
providerOverride: 'anthropic',
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
Without it, initialization raises `Unknown provider in model` (Python: `ValueError`; TypeScript: `Error`). Plain model IDs and cross-region inference profiles such as `us.anthropic.claude-sonnet-4-20250514-v1:0` still resolve automatically and need no override.
|
||||
|
||||
### Config
|
||||
|
||||
All available parameters for the `aws_bedrock` config are present in [Master List of All Params in Config](../config).
|
||||
|
||||
@@ -14,7 +14,8 @@ Follow the steps below for a smooth contribution process.
|
||||
<Note>
|
||||
For the complete contributor checklist, see
|
||||
[CONTRIBUTING.md](https://github.com/mem0ai/mem0/blob/main/CONTRIBUTING.md) in
|
||||
the repository root.
|
||||
the repository root. By participating you agree to our
|
||||
[Code of Conduct](https://github.com/mem0ai/mem0/blob/main/CODE_OF_CONDUCT.md).
|
||||
</Note>
|
||||
|
||||
## Before You Start
|
||||
@@ -30,7 +31,28 @@ change, avoid duplicate work, and agree on the approach before you write code.
|
||||
or [feature request](https://github.com/mem0ai/mem0/issues/new?template=feature_request.yml).
|
||||
- For anything beyond a trivial fix, wait for a maintainer to confirm the approach.
|
||||
|
||||
Every pull request must link to an issue using `Closes #<issue-number>`.
|
||||
Every pull request must link to an issue using `Closes #<issue-number>`, and that
|
||||
issue must carry the `accepted` label. A maintainer applies `accepted` once we
|
||||
agree the change is worth making. Pull requests that do not link an accepted
|
||||
issue are closed automatically, with instructions to reopen once the label is
|
||||
applied. Documentation-only changes are exempt.
|
||||
|
||||
<Note>
|
||||
Closed does not mean rejected. Getting the label and reopening takes about a
|
||||
minute, and the check reruns on reopen.
|
||||
</Note>
|
||||
|
||||
### Show Your Work
|
||||
|
||||
Both issue forms ask how you verified the problem: what you ran, the real output
|
||||
you saw, and why it is a bug rather than expected behavior. Reports without that
|
||||
are hard to act on and usually sit unanswered.
|
||||
|
||||
They also ask whether AI was involved. That question is about how the problem was
|
||||
found and confirmed, not about how the text was written: drafting the write-up
|
||||
with a model is fine. The same applies to pull requests, where the AI disclosure
|
||||
covers the code in the diff. We ask because it tells reviewers where to look, not
|
||||
because it counts against you.
|
||||
|
||||
### 2. Sign the Contributor License Agreement (CLA)
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Personalized AI Tutor
|
||||
description: "Keep student progress and preferences persistent across tutoring sessions."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
You can create a personalized AI Tutor using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Self-Hosted AI Companion
|
||||
description: "Run Mem0 end-to-end on your machine using Ollama-powered LLMs and embedders."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
Mem0 can be utilized entirely locally by leveraging Ollama for both the embedding model and the language model (LLM). This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Build a Node.js Companion
|
||||
description: "Build a JavaScript fitness coach that remembers user goals run after run."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
You can create a personalized AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Interactive Memory Demo
|
||||
description: "Spin up the showcase companion app to see Mem0 memories in action."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform
|
||||
</Info>
|
||||
|
||||
You can create a personalized AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete setup instructions to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Smart Travel Assistant
|
||||
description: "Plan itineraries that remember traveler preferences across trips."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
Create a personalized AI Travel Assistant using Mem0. This guide provides step-by-step instructions and the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Voice-First AI Companion
|
||||
description: "Pair the OpenAI Agents SDK with Mem0 to build a voice assistant that remembers."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
This guide demonstrates how to combine OpenAI's Agents SDK for voice applications with Mem0's memory capabilities to create a voice assistant that remembers user preferences and past interactions.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Research Assistant for YouTube
|
||||
description: "Layer personalized context over any video using the Mem0 YouTube assistant."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform
|
||||
</Info>
|
||||
|
||||
Enhance your YouTube experience with Mem0's YouTube Assistant, a Chrome extension that brings AI-powered chat directly to your YouTube videos. Get instant, personalized answers about video content while leveraging your own knowledge and memories, all without leaving the page.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Build a Companion with Mem0
|
||||
description: "Spin up a fitness coach that remembers goals, adapts tone, and keeps sessions personal."
|
||||
---
|
||||
|
||||
<Info icon="layer-group">
|
||||
**Works with:** Mem0 OSS (`Memory`) and Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Essentially, creating a companion out of LLMs is as simple as a loop. But these loops work great for one type of character without personalization and fall short as soon as you restart the chat.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Control Memory Ingestion
|
||||
description: "Filter speculation, enforce formats, and gate low-confidence data before it persists."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
AI assistants plugged with memory systems face a problem - they often store everything. Not every conversation needs to be remembered, and not every detail should go to the memory store. Without proper controls, memory systems accumulate unreliable data.
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ title: Partition Memories by Entity
|
||||
description: Keep memories separate by tagging each write and query with user, agent, app, and session identifiers.
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Nora runs a travel service. When she stored all memories in one bucket, a recruiter's nut allergy accidentally appeared in a traveler's dinner reservation. Let's fix this by properly separating memories for different users, agents, and applications.
|
||||
|
||||
<Info icon="clock">
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Export Stored Memories
|
||||
description: "Retrieve, review, and migrate user memories with structured exports."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Mem0 is a dynamic memory store that gives you full control over your data. Along with storing memories, it gives you the ability to retrieve, export, and migrate your data whenever you need.
|
||||
|
||||
@@ -169,20 +172,20 @@ export_job = client.create_memory_export(
|
||||
)
|
||||
|
||||
print(f"Export ID: {export_job['id']}")
|
||||
print(f"Status: {export_job['status']}")
|
||||
print(f"Message: {export_job['message']}")
|
||||
|
||||
```
|
||||
|
||||
**Output:**
|
||||
|
||||
```
|
||||
Export ID: exp_abc123
|
||||
Status: processing
|
||||
Export ID: 550e8400-e29b-41d4-a716-446655440000
|
||||
Message: Memory export request received. The export will be ready in a few seconds.
|
||||
|
||||
```
|
||||
|
||||
<Info>
|
||||
**Export initiated:** Status is "processing". Large exports may take a few seconds. Poll with `get_memory_export()` until status changes to "completed" before downloading data.
|
||||
**Export initiated:** The export runs asynchronously and is usually ready within a few seconds. Retry `get_memory_export()` with the returned ID until it stops returning a "no export found" error.
|
||||
</Info>
|
||||
|
||||
### Step 3: Download the export
|
||||
@@ -193,7 +196,7 @@ export_data = client.get_memory_export(
|
||||
memory_export_id=export_job['id']
|
||||
)
|
||||
|
||||
print(export_data['data'])
|
||||
print(export_data)
|
||||
|
||||
```
|
||||
|
||||
@@ -216,7 +219,7 @@ export_by_filters = client.get_memory_export(
|
||||
filters={"user_id": "dev"}
|
||||
)
|
||||
|
||||
print(export_by_filters['data'])
|
||||
print(export_by_filters)
|
||||
|
||||
```
|
||||
|
||||
@@ -240,7 +243,7 @@ export_with_instructions = client.create_memory_export(
|
||||
```
|
||||
|
||||
<Tip>
|
||||
Always check export status before downloading. Call `get_memory_export()` in a loop with a short delay until `status == "completed"`. Attempting to download while still processing returns incomplete data.
|
||||
If the export is still processing, `get_memory_export()` returns a 404 with `{"error": "No memory export request found"}`. Retry after a short delay until the call succeeds instead of polling a status field.
|
||||
</Tip>
|
||||
|
||||
---
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Tag and Organize Memories
|
||||
description: "Let Mem0 auto-categorize support data so teams retrieve the right facts fast."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
When you have large volumes of memory data, sorting it during post-processing becomes difficult. What if your memory store understood the importance of creating tags and buckets without a lot of effort?
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Persistent Eliza Characters
|
||||
description: "Bring persistent personality to Eliza OS agents using Mem0."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform
|
||||
</Info>
|
||||
|
||||
You can create a personalized Eliza OS Character using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,10 @@ title: "Gemini 3 with Mem0 MCP"
|
||||
description: "Create snappy, smart, memory-aware agents by pairing Gemini 3 with Mem0 MCP server."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (MCP server)
|
||||
</Info>
|
||||
|
||||
Gemini 3, when paired with Mem0's cloud MCP server, works in synergy to create snappy, smart, memory-aware agents.
|
||||
|
||||
<Callout type="info" icon="sparkles" color="#8B5CF6">
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Multi-Agent Collaboration
|
||||
description: "Share a persistent memory layer across collaborating LlamaIndex agents."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`Mem0Memory.from_client`)
|
||||
</Info>
|
||||
|
||||
<Snippet file="blank-notif.mdx" />
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: ReAct Agents with Memory
|
||||
description: "Teach a ReAct agent to store and recall context via Mem0."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`Mem0Memory.from_client`)
|
||||
</Info>
|
||||
|
||||
Create a ReAct Agent with LlamaIndex which uses Mem0 as the memory store.
|
||||
|
||||
@@ -78,7 +81,7 @@ from llama_index.core.agent import FunctionCallingAgent
|
||||
agent = FunctionCallingAgent.from_tools(
|
||||
[call_tool, email_tool, order_food_tool],
|
||||
llm=llm,
|
||||
memory=memory_from_client, # or memory_from_config
|
||||
memory=memory_from_client,
|
||||
verbose=True,
|
||||
)
|
||||
```
|
||||
@@ -161,7 +164,7 @@ agent = FunctionCallingAgent.from_tools(
|
||||
[call_tool, email_tool, order_food_tool],
|
||||
llm=llm,
|
||||
# memory is provided
|
||||
memory=memory_from_client, # or memory_from_config
|
||||
memory=memory_from_client,
|
||||
verbose=True,
|
||||
)
|
||||
response = agent.chat("I am feeling hungry, order me something and send me the bill")
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Visual Memory Retrieval
|
||||
description: "Store and recall visual context alongside text conversations."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform
|
||||
</Info>
|
||||
|
||||
Enhance your AI interactions with Mem0's multimodal capabilities. Mem0 now supports image understanding, allowing for richer context and more natural interactions across supported AI platforms.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Memory-Powered Agent SDK
|
||||
description: "Expose Mem0 memories as callable tools inside OpenAI agent workflows."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Integrate Mem0's memory capabilities with OpenAI's Agents SDK to create AI agents with persistent memory. You can create agents that remember past conversations and use that context to provide better responses.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Bedrock with Persistent Memory
|
||||
description: "Pair Mem0 with AWS Bedrock and OpenSearch for a managed stack."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
This example demonstrates how to configure and use the `mem0ai` SDK with **AWS Bedrock** and **OpenSearch Service (AOSS)** for persistent memory capabilities in Python.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Healthcare Coach with ADK
|
||||
description: "Guide patients with an assistant that remembers history across ADK sessions."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
This example demonstrates how to build a healthcare assistant that remembers patient information across conversations using Google ADK and Mem0.
|
||||
|
||||
@@ -123,7 +126,7 @@ Now we'll create our main agent with all the tools:
|
||||
# Create the agent
|
||||
healthcare_agent = Agent(
|
||||
name="healthcare_assistant",
|
||||
model="gemini-1.5-flash", # Using Gemini for healthcare assistant
|
||||
model="gemini-2.0-flash", # Using Gemini for healthcare assistant
|
||||
description="Healthcare assistant that helps patients with health information and appointment scheduling.",
|
||||
instruction="""You are a helpful Healthcare Assistant with memory capabilities.
|
||||
|
||||
|
||||
@@ -3,10 +3,13 @@ title: Persistent Mastra Agents
|
||||
description: "Extend Mastra agents with persistent memories powered by Mem0."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`@mastra/mem0`)
|
||||
</Info>
|
||||
|
||||
In this example you'll learn how to use Mem0 to add long-term memory capabilities to [Mastra's agent](https://mastra.ai/) via tool-use. This memory integration can work alongside Mastra's [agent memory features](https://mastra.ai/docs/agents/01-agent-memory).
|
||||
|
||||
You can find the complete example code in the [Mastra repository](https://github.com/mastra-ai/mastra/tree/main/examples/memory-with-mem0).
|
||||
The complete example code, from installing the integration to wiring it into a Mastra agent, is shown below. Mem0's integration is published on npm as [`@mastra/mem0`](https://www.npmjs.com/package/@mastra/mem0).
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Memory as OpenAI Tool
|
||||
description: "Wire Mem0 memories into OpenAI's inbuilt function-calling flow."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Integrate Mem0’s memory capabilities with OpenAI’s Inbuilt Tools to create AI agents with persistent memory.
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@ title: Search with Personal Context
|
||||
description: "Blend Tavily's realtime results with personal context stored in Mem0."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
Imagine asking a search assistant for "coffee shops nearby" and instead of generic results, it shows remote-work-friendly cafes with great WiFi in your city because it remembers you mentioned working remotely before. Or when you search for "lunchbox ideas for kids" it knows you have a 7-year-old daughter and recommends peanut-free options that align with her allergy.
|
||||
|
||||
That's what we are going to build today, a Personalized Search Assistant powered by Mem0 for memory and [Tavily](https://tavily.com) for real-time search.
|
||||
|
||||
|
||||
## Why Personalized Search
|
||||
|
||||
Most assistants treat every query like they've never seen you before. That means repeating yourself about your location, diet, or preferences, and getting results that feel generic.
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Content Creation Workflow
|
||||
description: "Store voice guidelines once and apply them across every draft."
|
||||
---
|
||||
|
||||
<Info icon="layer-group">
|
||||
**Works with:** Mem0 OSS (`Memory`) and Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
This guide demonstrates how to leverage **Mem0** to streamline content writing by applying your unique writing style and preferences using persistent memory.
|
||||
|
||||
|
||||
@@ -3,11 +3,12 @@ title: Multi-Session Research Agent
|
||||
description: "Run multi-session investigations that remember past findings and preferences."
|
||||
---
|
||||
|
||||
<Info icon="cloud">
|
||||
**Works with:** Mem0 Platform
|
||||
</Info>
|
||||
|
||||
Deep Research is an intelligent agent that synthesizes large amounts of online data and completes complex research tasks, customized to your unique preferences and insights. Built on Mem0's technology, it enhances AI-driven online exploration with personalized memories.
|
||||
|
||||
You can check out the GitHub repository here: [Personalized Deep Research](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
|
||||
|
||||
## Overview
|
||||
|
||||
Deep Research leverages Mem0's memory capabilities to:
|
||||
@@ -61,12 +62,6 @@ Watch Deep Research in action:
|
||||
- **Technical Research**: Technology evaluation, solution comparison
|
||||
- **Business Research**: Strategic planning, opportunity analysis
|
||||
|
||||
## Try It Out
|
||||
|
||||
> To try it yourself, clone the repository and follow the instructions in the README to run it locally or deploy it.
|
||||
|
||||
- [Personalized Deep Research GitHub](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
|
||||
|
||||
---
|
||||
|
||||
<CardGroup cols={2}>
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Automated Email Intelligence
|
||||
description: "Capture, categorize, and recall inbox threads using persistent memories."
|
||||
---
|
||||
|
||||
<Info icon="layer-group">
|
||||
**Works with:** Mem0 OSS (`Memory`) and Mem0 Platform (`MemoryClient`)
|
||||
</Info>
|
||||
|
||||
This guide demonstrates how to build an intelligent email processing system using Mem0's memory capabilities. You'll learn how to store, categorize, retrieve, and analyze emails to create a smart email management solution.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Memory-Powered Support Agent
|
||||
description: "Build a support assistant that keeps past tickets and resolutions at its fingertips."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
You can create a personalized Customer Support AI Agent using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ title: Collaborative Task Assistant
|
||||
description: "Coordinate multi-user projects with shared memories and roles."
|
||||
---
|
||||
|
||||
<Info icon="server">
|
||||
**Works with:** Mem0 OSS (`Memory`)
|
||||
</Info>
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -13,6 +13,56 @@ With Mem0, you can create stateful LLM-based applications such as chatbots, virt
|
||||
|
||||
Here are some examples of how Mem0 can be integrated into various applications:
|
||||
|
||||
## Pick by compatibility
|
||||
|
||||
Every cookbook opens with a **Works with** badge naming the SDK surface it uses. Pick your setup below to see only the cookbooks that run on it. Three cookbooks work on both and appear under either tab.
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Self-hosted OSS">
|
||||
Ten cookbooks run on the open-source `Memory` class, with no Mem0 Platform account.
|
||||
|
||||
| Cookbook | Category | Works with |
|
||||
| --- | --- | --- |
|
||||
| [Personalized AI Tutor](/cookbooks/companions/ai-tutor) | Companions | OSS only |
|
||||
| [Build a Node.js Companion](/cookbooks/companions/nodejs-companion) | Companions | OSS only |
|
||||
| [Self-Hosted AI Companion](/cookbooks/companions/local-companion-ollama) | Companions | OSS only |
|
||||
| [Smart Travel Assistant](/cookbooks/companions/travel-assistant) | Companions | OSS only |
|
||||
| [Build a Companion with Mem0](/cookbooks/essentials/building-ai-companion) | Essentials | OSS and Platform |
|
||||
| [Bedrock with Persistent Memory](/cookbooks/integrations/aws-bedrock) | Integrations | OSS only |
|
||||
| [Automated Email Intelligence](/cookbooks/operations/email-automation) | Operations | OSS and Platform |
|
||||
| [Collaborative Task Assistant](/cookbooks/operations/team-task-agent) | Operations | OSS only |
|
||||
| [Content Creation Workflow](/cookbooks/operations/content-writing) | Operations | OSS and Platform |
|
||||
| [Memory-Powered Support Agent](/cookbooks/operations/support-inbox) | Operations | OSS only |
|
||||
</Tab>
|
||||
<Tab title="Hosted Platform">
|
||||
Twenty-one cookbooks run on the hosted Platform, using `MemoryClient` or the Mem0 MCP server with a `MEM0_API_KEY`.
|
||||
|
||||
| Cookbook | Category | Works with |
|
||||
| --- | --- | --- |
|
||||
| [Interactive Memory Demo](/cookbooks/companions/quickstart-demo) | Companions | Platform only |
|
||||
| [Research Assistant for YouTube](/cookbooks/companions/youtube-research) | Companions | Platform only |
|
||||
| [Voice-First AI Companion](/cookbooks/companions/voice-companion-openai) | Companions | Platform only |
|
||||
| [Build a Companion with Mem0](/cookbooks/essentials/building-ai-companion) | Essentials | OSS and Platform |
|
||||
| [Control Memory Ingestion](/cookbooks/essentials/controlling-memory-ingestion) | Essentials | Platform only |
|
||||
| [Export Stored Memories](/cookbooks/essentials/exporting-memories) | Essentials | Platform only |
|
||||
| [Partition Memories by Entity](/cookbooks/essentials/entity-partitioning-playbook) | Essentials | Platform only |
|
||||
| [Tag and Organize Memories](/cookbooks/essentials/tagging-and-organizing-memories) | Essentials | Platform only |
|
||||
| [Gemini 3 with Mem0 MCP](/cookbooks/frameworks/gemini-3-with-mem0-mcp) | Frameworks | Platform only |
|
||||
| [Multi-Agent Collaboration](/cookbooks/frameworks/llamaindex-multiagent) | Frameworks | Platform only |
|
||||
| [Persistent Eliza Characters](/cookbooks/frameworks/eliza-os-character) | Frameworks | Platform only |
|
||||
| [ReAct Agents with Memory](/cookbooks/frameworks/llamaindex-react) | Frameworks | Platform only |
|
||||
| [Visual Memory Retrieval](/cookbooks/frameworks/multimodal-retrieval) | Frameworks | Platform only |
|
||||
| [Healthcare Coach with ADK](/cookbooks/integrations/healthcare-google-adk) | Integrations | Platform only |
|
||||
| [Memory as OpenAI Tool](/cookbooks/integrations/openai-tool-calls) | Integrations | Platform only |
|
||||
| [Memory-Powered Agent SDK](/cookbooks/integrations/agents-sdk-tool) | Integrations | Platform only |
|
||||
| [Persistent Mastra Agents](/cookbooks/integrations/mastra-agent) | Integrations | Platform only |
|
||||
| [Search with Personal Context](/cookbooks/integrations/tavily-search) | Integrations | Platform only |
|
||||
| [Automated Email Intelligence](/cookbooks/operations/email-automation) | Operations | OSS and Platform |
|
||||
| [Content Creation Workflow](/cookbooks/operations/content-writing) | Operations | OSS and Platform |
|
||||
| [Multi-Session Research Agent](/cookbooks/operations/deep-research) | Operations | Platform only |
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Start here
|
||||
|
||||
The most popular cookbooks to get going fast:
|
||||
|
||||
@@ -611,6 +611,10 @@
|
||||
]
|
||||
},
|
||||
"redirects": [
|
||||
{
|
||||
"source": "/open-source/features/reranking",
|
||||
"destination": "/open-source/features/reranker-search"
|
||||
},
|
||||
{
|
||||
"source": "/platform/features/contextual-add",
|
||||
"destination": "/core-concepts/memory-operations/add"
|
||||
|
||||
@@ -34,15 +34,11 @@ npx flowise start
|
||||
2. In this example, we use the **Conversation Chain** template.
|
||||
3. Replace the default **Buffer Memory** with **Mem0 Memory**.
|
||||
|
||||

|
||||
|
||||
### 2. Obtain Your Mem0 API Key
|
||||
|
||||
1. Navigate to the <a href="https://app.mem0.ai/dashboard/api-keys?utm_source=oss&utm_medium=integration-flowise" rel="nofollow">Mem0 API Key dashboard</a>.
|
||||
2. Generate or copy your existing Mem0 API Key.
|
||||
|
||||

|
||||
|
||||
### 3. Configure Mem0 Credentials
|
||||
|
||||
1. Enter the **Mem0 API Key** in the Mem0 Credentials section.
|
||||
@@ -57,11 +53,6 @@ npx flowise start
|
||||
}
|
||||
```
|
||||
|
||||
<figure>
|
||||
<img src="https://raw.githubusercontent.com/FlowiseAI/FlowiseDocs/main/en/.gitbook/assets/mem0/creds.png" alt="Mem0 Credentials" />
|
||||
<figcaption>Configure API Credentials</figcaption>
|
||||
</figure>
|
||||
|
||||
## Memory Features
|
||||
|
||||
### 1. Basic Memory Storage
|
||||
@@ -72,8 +63,6 @@ Test your memory configuration:
|
||||
2. Run a test chat and store some information
|
||||
3. Verify the stored memories in the <a href="https://app.mem0.ai/dashboard/requests?utm_source=oss&utm_medium=integration-flowise" rel="nofollow">Mem0 Dashboard</a>
|
||||
|
||||

|
||||
|
||||
### 2. Memory Retention
|
||||
|
||||
Validate memory persistence:
|
||||
@@ -82,14 +71,10 @@ Validate memory persistence:
|
||||
2. Ask a question about previously stored information
|
||||
3. Confirm that the AI remembers the context
|
||||
|
||||

|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
### Memory Settings
|
||||
|
||||

|
||||
|
||||
Available settings include:
|
||||
|
||||
1. **Search Only Mode**: Enable memory retrieval without creating new memories
|
||||
@@ -108,8 +93,6 @@ Additional settings available in <a href="https://app.mem0.ai/dashboard/project-
|
||||
1. **Custom Instructions**: Define memory extraction rules
|
||||
2. **Expiration Date**: Set automatic memory cleanup periods
|
||||
|
||||

|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **User Identification**: Use consistent `user_id` values for reliable memory retrieval
|
||||
|
||||
@@ -6,7 +6,7 @@ description: "Use Mem0 as a memory store in LlamaIndex with support for ReAct an
|
||||
LlamaIndex supports Mem0 as a [memory store](https://llamahub.ai/l/memory/llama-index-memory-mem0). In this guide, we'll show you how to use it.
|
||||
|
||||
<Note type="info">
|
||||
[**Mem0Memory**](https://docs.llamaindex.ai/en/stable/examples/memory/Mem0Memory/) now supports **ReAct** and **FunctionCalling** agents.
|
||||
[**Mem0Memory**](https://developers.llamaindex.ai/python/examples/memory/mem0memory/) now supports **ReAct** and **FunctionCalling** agents.
|
||||
</Note>
|
||||
|
||||
### Installation
|
||||
|
||||
+39
-40
@@ -56,8 +56,8 @@ client.add(
|
||||
)
|
||||
|
||||
# Read
|
||||
client.search("What does Alice like to do?", user_id="alice")
|
||||
client.get_all(user_id="alice")
|
||||
client.search("What does Alice like to do?", filters={"user_id": "alice"})
|
||||
client.get_all(filters={"user_id": "alice"})
|
||||
client.get(memory_id="<id>")
|
||||
|
||||
# Update
|
||||
@@ -86,8 +86,8 @@ await client.add(
|
||||
);
|
||||
|
||||
// Read
|
||||
await client.search("What does Alice like to do?", { user_id: "alice" });
|
||||
await client.getAll({ user_id: "alice" });
|
||||
await client.search("What does Alice like to do?", { filters: { user_id: "alice" } });
|
||||
await client.getAll({ filters: { user_id: "alice" } });
|
||||
await client.get("<memory_id>");
|
||||
|
||||
// Update
|
||||
@@ -113,8 +113,8 @@ m = Memory() # needs OPENAI_API_KEY; see components/ for custom providers
|
||||
m.add("I love hiking on weekends", user_id="alice")
|
||||
|
||||
# Read
|
||||
m.search("What does Alice like to do?", user_id="alice")
|
||||
m.get_all(user_id="alice")
|
||||
m.search("What does Alice like to do?", filters={"user_id": "alice"})
|
||||
m.get_all(filters={"user_id": "alice"})
|
||||
m.get(memory_id="<id>")
|
||||
|
||||
# Update
|
||||
@@ -140,8 +140,8 @@ const memory = new Memory();
|
||||
await memory.add("I love hiking on weekends", { userId: "alice" });
|
||||
|
||||
// Read
|
||||
await memory.search("What does Alice like to do?", { userId: "alice" });
|
||||
await memory.getAll({ userId: "alice" });
|
||||
await memory.search("What does Alice like to do?", { filters: { user_id: "alice" } });
|
||||
await memory.getAll({ filters: { user_id: "alice" } });
|
||||
await memory.get("<memory_id>");
|
||||
|
||||
// Update
|
||||
@@ -164,7 +164,7 @@ npm list mem0ai --depth 0 2>/dev/null | grep mem0ai
|
||||
mem0 --version # Python or Node CLI, whichever is on PATH
|
||||
```
|
||||
|
||||
If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_format: "v1.1"`), route them through the matching migration guide in the Platform section before quoting current docs. If no Mem0 package is installed, recommend `pip install mem0ai` or `npm install mem0ai` and the corresponding quickstart above.
|
||||
If the user is on a pre-current major (Python < 2, TS < 3, or a Platform call still passing `output_format`, `api_version`, `async_mode`, or `enable_graph`, all removed in the current major), route them through the matching migration guide in the Platform section before quoting current docs. If no Mem0 package is installed, recommend `pip install mem0ai` or `npm install mem0ai` and the corresponding quickstart above.
|
||||
|
||||
## Getting Started
|
||||
|
||||
@@ -235,7 +235,6 @@ If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_f
|
||||
- [Open Source Features Overview](https://docs.mem0.ai/open-source/features/overview) [OSS]: Use when surveying OSS-only capabilities.
|
||||
- [Metadata Filtering](https://docs.mem0.ai/open-source/features/metadata-filtering) [OSS]: Use when filtering by custom metadata fields in self-hosted.
|
||||
- [Reranker Search](https://docs.mem0.ai/open-source/features/reranker-search) [OSS]: Use when improving OSS search quality with a reranker.
|
||||
- [Reranking](https://docs.mem0.ai/open-source/features/reranking) [OSS]: Use when configuring reranking end-to-end in OSS.
|
||||
- [Async Memory](https://docs.mem0.ai/open-source/features/async-memory) [OSS]: Use when the self-hosted app needs `AsyncMemory`.
|
||||
- [OSS Multimodal Support (features)](https://docs.mem0.ai/open-source/features/multimodal-support) [OSS]: Use when handling images and PDFs self-hosted (feature guide).
|
||||
- [Custom Instructions (OSS)](https://docs.mem0.ai/open-source/features/custom-instructions) [OSS]: Use when tailoring extraction prompts in OSS.
|
||||
@@ -247,46 +246,46 @@ If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_f
|
||||
- [Integrations Overview](https://docs.mem0.ai/integrations) [Both]: Use when surveying every available integration.
|
||||
|
||||
### Agent Frameworks
|
||||
- [LangChain](https://docs.mem0.ai/integrations/langchain) [Both]: Use when the user is on LangChain.
|
||||
- [LangGraph](https://docs.mem0.ai/integrations/langgraph) [Both]: Use when building stateful multi-actor LangGraph apps.
|
||||
- [LangChain Tools](https://docs.mem0.ai/integrations/langchain-tools) [Both]: Use when Mem0 should be exposed as a LangChain tool.
|
||||
- [LangChain](https://docs.mem0.ai/integrations/langchain) [Platform]: Use when the user is on LangChain.
|
||||
- [LangGraph](https://docs.mem0.ai/integrations/langgraph) [Platform]: Use when building stateful multi-actor LangGraph apps.
|
||||
- [LangChain Tools](https://docs.mem0.ai/integrations/langchain-tools) [Platform]: Use when Mem0 should be exposed as a LangChain tool.
|
||||
- [LlamaIndex](https://docs.mem0.ai/integrations/llama-index) [Both]: Use when layering memory on a LlamaIndex RAG app.
|
||||
- [CrewAI](https://docs.mem0.ai/integrations/crewai) [Both]: Use when building CrewAI multi-agent systems.
|
||||
- [AutoGen](https://docs.mem0.ai/integrations/autogen) [Both]: Use when the user is on Microsoft AutoGen.
|
||||
- [Agno](https://docs.mem0.ai/integrations/agno) [Both]: Use when the user is on Agno.
|
||||
- [CrewAI](https://docs.mem0.ai/integrations/crewai) [Platform]: Use when building CrewAI multi-agent systems.
|
||||
- [AutoGen](https://docs.mem0.ai/integrations/autogen) [Platform]: Use when the user is on Microsoft AutoGen.
|
||||
- [Agno](https://docs.mem0.ai/integrations/agno) [Platform]: Use when the user is on Agno.
|
||||
- [Camel AI](https://docs.mem0.ai/integrations/camel-ai) [Both]: Use when the user is on Camel AI.
|
||||
- [ChatDev](https://docs.mem0.ai/integrations/chatdev) [Both]: Use when the user is on ChatDev.
|
||||
- [ChatDev](https://docs.mem0.ai/integrations/chatdev) [Platform]: Use when the user is on ChatDev.
|
||||
- [Hermes](https://docs.mem0.ai/integrations/hermes) [Both]: Use when the user is on Hermes.
|
||||
- [Pi Agent](https://docs.mem0.ai/integrations/pi-agent) [Platform]: Use when adding persistent memory to Pi Agent with the Mem0 plugin.
|
||||
- [OpenAI Agents SDK](https://docs.mem0.ai/integrations/openai-agents-sdk) [Both]: Use when the user is on the OpenAI Agents SDK.
|
||||
- [Google AI ADK](https://docs.mem0.ai/integrations/google-ai-adk) [Both]: Use when the user is on Google's Agent Development Kit.
|
||||
- [Mastra](https://docs.mem0.ai/integrations/mastra) [Both]: Use when the user is on Mastra (TypeScript).
|
||||
- [OpenAI Agents SDK](https://docs.mem0.ai/integrations/openai-agents-sdk) [Platform]: Use when the user is on the OpenAI Agents SDK.
|
||||
- [Google AI ADK](https://docs.mem0.ai/integrations/google-ai-adk) [Platform]: Use when the user is on Google's Agent Development Kit.
|
||||
- [Mastra](https://docs.mem0.ai/integrations/mastra) [Platform]: Use when the user is on Mastra (TypeScript).
|
||||
- [OpenClaw](https://docs.mem0.ai/integrations/openclaw) [Both]: Use when wiring Mem0 into Claude Code or editors via OpenClaw.
|
||||
- [Vercel AI SDK](https://docs.mem0.ai/integrations/vercel-ai-sdk) [Both]: Use when the user is on the Vercel AI SDK.
|
||||
|
||||
### AI Coding Tools
|
||||
- [Claude Code](https://docs.mem0.ai/integrations/claude-code) [Both]: Use when wiring memory into Claude Code.
|
||||
- [Cursor](https://docs.mem0.ai/integrations/cursor) [Both]: Use when wiring memory into Cursor.
|
||||
- [Codex](https://docs.mem0.ai/integrations/codex) [Both]: Use when wiring memory into Codex / other editor assistants.
|
||||
- [OpenCode](https://docs.mem0.ai/integrations/opencode) [Both]: Use when wiring memory into OpenCode.
|
||||
- [Antigravity](https://docs.mem0.ai/integrations/antigravity) [Both]: Use when wiring memory into Google Antigravity.
|
||||
- [Cursor](https://docs.mem0.ai/integrations/cursor) [Platform]: Use when wiring memory into Cursor.
|
||||
- [Codex](https://docs.mem0.ai/integrations/codex) [Platform]: Use when wiring memory into Codex / other editor assistants.
|
||||
- [OpenCode](https://docs.mem0.ai/integrations/opencode) [Platform]: Use when wiring memory into OpenCode.
|
||||
- [Antigravity](https://docs.mem0.ai/integrations/antigravity) [Platform]: Use when wiring memory into Google Antigravity.
|
||||
|
||||
### Voice & Real-time
|
||||
- [LiveKit](https://docs.mem0.ai/integrations/livekit) [Both]: Use when building real-time voice/video with memory.
|
||||
- [Pipecat](https://docs.mem0.ai/integrations/pipecat) [Both]: Use when the voice pipeline is Pipecat.
|
||||
- [ElevenLabs](https://docs.mem0.ai/integrations/elevenlabs) [Both]: Use when voice synthesis uses ElevenLabs.
|
||||
- [LiveKit](https://docs.mem0.ai/integrations/livekit) [Platform]: Use when building real-time voice/video with memory.
|
||||
- [Pipecat](https://docs.mem0.ai/integrations/pipecat) [Platform]: Use when the voice pipeline is Pipecat.
|
||||
- [ElevenLabs](https://docs.mem0.ai/integrations/elevenlabs) [Platform]: Use when voice synthesis uses ElevenLabs.
|
||||
|
||||
### Cloud & Infrastructure
|
||||
- [AWS Bedrock](https://docs.mem0.ai/integrations/aws-bedrock) [Both]: Use when the user is on AWS Bedrock managed AI services.
|
||||
- [AWS Bedrock](https://docs.mem0.ai/integrations/aws-bedrock) [OSS]: Use when the user is on AWS Bedrock managed AI services.
|
||||
|
||||
### Developer Tools
|
||||
- [Dify](https://docs.mem0.ai/integrations/dify) [Both]: Use when the user is on Dify LLMOps.
|
||||
- [Flowise](https://docs.mem0.ai/integrations/flowise) [Both]: Use when the user is on Flowise no-code.
|
||||
- [Dify](https://docs.mem0.ai/integrations/dify) [Platform]: Use when the user is on Dify LLMOps.
|
||||
- [Flowise](https://docs.mem0.ai/integrations/flowise) [Platform]: Use when the user is on Flowise no-code.
|
||||
- [n8n](https://docs.mem0.ai/integrations/n8n) [Both]: Use when the user builds workflows or AI agents in n8n.
|
||||
- [Zapier](https://docs.mem0.ai/integrations/zapier) [Both]: Use when the user automates workflows with Zapier.
|
||||
- [AgentOps](https://docs.mem0.ai/integrations/agentops) [Both]: Use when tracking agent observability with memory metadata.
|
||||
- [Respan](https://docs.mem0.ai/integrations/respan) [Both]: Use when monitoring Mem0 with Respan (formerly Keywords AI) LLM observability.
|
||||
- [Raycast](https://docs.mem0.ai/integrations/raycast) [Both]: Use when the user wants quick memory access via Raycast.
|
||||
- [Respan](https://docs.mem0.ai/integrations/respan) [OSS]: Use when monitoring Mem0 with Respan (formerly Keywords AI) LLM observability.
|
||||
- [Raycast](https://docs.mem0.ai/integrations/raycast) [Platform]: Use when the user wants quick memory access via Raycast.
|
||||
|
||||
## Cookbooks
|
||||
|
||||
@@ -318,10 +317,10 @@ If the user is on a pre-current major (Python < 2, TS < 3, or Platform `output_f
|
||||
### Integration Examples
|
||||
- [Agents SDK Tool](https://docs.mem0.ai/cookbooks/integrations/agents-sdk-tool) [Platform]: Use when exposing Mem0 as a tool in OpenAI Agents SDK.
|
||||
- [OpenAI Tool Calls](https://docs.mem0.ai/cookbooks/integrations/openai-tool-calls) [Platform]: Use when hooking Mem0 into OpenAI function calling.
|
||||
- [Mastra Agent](https://docs.mem0.ai/cookbooks/integrations/mastra-agent) [Both]: Use when the agent is built in Mastra.
|
||||
- [Healthcare Google ADK](https://docs.mem0.ai/cookbooks/integrations/healthcare-google-adk) [Both]: Use when the domain is medical and the framework is Google ADK.
|
||||
- [AWS Bedrock](https://docs.mem0.ai/cookbooks/integrations/aws-bedrock) [Both]: Use when deploying with AWS managed model services.
|
||||
- [Tavily Search](https://docs.mem0.ai/cookbooks/integrations/tavily-search) [Both]: Use when the agent layers web search on memory.
|
||||
- [Mastra Agent](https://docs.mem0.ai/cookbooks/integrations/mastra-agent) [Platform]: Use when the agent is built in Mastra.
|
||||
- [Healthcare Google ADK](https://docs.mem0.ai/cookbooks/integrations/healthcare-google-adk) [Platform]: Use when the domain is medical and the framework is Google ADK.
|
||||
- [AWS Bedrock](https://docs.mem0.ai/cookbooks/integrations/aws-bedrock) [OSS]: Use when deploying with AWS managed model services.
|
||||
- [Tavily Search](https://docs.mem0.ai/cookbooks/integrations/tavily-search) [Platform]: Use when the agent layers web search on memory.
|
||||
|
||||
### Framework Examples
|
||||
- [LlamaIndex React](https://docs.mem0.ai/cookbooks/frameworks/llamaindex-react) [Both]: Use when building a React UI with LlamaIndex and memory.
|
||||
@@ -410,10 +409,10 @@ The `integrations/mem0-plugin/` directory provides MCP server connection, lifecy
|
||||
Editor-specific setup docs (already listed above under `## Integrations > AI Coding Tools`):
|
||||
|
||||
- `integrations/claude-code` [Both]
|
||||
- `integrations/cursor` [Both]
|
||||
- `integrations/codex` [Both]
|
||||
- `integrations/opencode` [Both]
|
||||
- `integrations/antigravity` [Both]
|
||||
- `integrations/cursor` [Platform]
|
||||
- `integrations/codex` [Platform]
|
||||
- `integrations/opencode` [Platform]
|
||||
- `integrations/antigravity` [Platform]
|
||||
- `integrations/openclaw` [Both]
|
||||
|
||||
### MCP Endpoints
|
||||
|
||||
@@ -53,7 +53,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What are my food preferences?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
@@ -86,7 +86,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What movies do I like?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
@@ -108,7 +108,7 @@ const memory = new Memory({
|
||||
});
|
||||
|
||||
const results = await memory.search("What movies do I like?", {
|
||||
filters: { userId: "alice" },
|
||||
filters: { user_id: "alice" },
|
||||
rerank: true,
|
||||
});
|
||||
```
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
title: Reranking
|
||||
description: 'Redirect to the canonical reranker-enhanced search guide.'
|
||||
---
|
||||
|
||||
<Redirect href="/open-source/features/reranker-search" />
|
||||
@@ -43,7 +43,7 @@ await memory.add(messages, { userId: "alice", metadata: { category: "movie_recom
|
||||
|
||||
<Step title="Search memories">
|
||||
```ts
|
||||
const results = await memory.search("What do you know about me?", { filters: { userId: "alice" } });
|
||||
const results = await memory.search("What do you know about me?", { filters: { user_id: "alice" } });
|
||||
console.log(results);
|
||||
```
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ Search memories using natural language.
|
||||
```bash
|
||||
mem0 search "dietary restrictions" --user-id alice
|
||||
mem0 search "preferred tools" --user-id alice --output json --top-k 5
|
||||
mem0 search "invoices" --user-id alice --filter '{"AND": [{"categories": {"in": ["work"]}}]}'
|
||||
```
|
||||
|
||||
| Flag | Description |
|
||||
@@ -155,7 +156,7 @@ mem0 search "preferred tools" --user-id alice --output json --top-k 5
|
||||
| `--threshold` | Minimum similarity score (default: 0.3) |
|
||||
| `--rerank` | Enable reranking |
|
||||
| `--keyword` | Use keyword search instead of semantic |
|
||||
| `--filter` | Advanced filter expression (JSON) |
|
||||
| `--filter` | Advanced filter as JSON: `{"AND": [...]}` or `{"OR": [...]}`, e.g. `{"AND": [{"categories": {"in": ["work"]}}]}` |
|
||||
| `--fields` | Return only the named fields |
|
||||
| `--show-expired` | Include expired memories |
|
||||
| `--reference-date` | Reference date for relative queries (`YYYY-MM-DD` or Unix timestamp) |
|
||||
@@ -471,7 +472,7 @@ These two flags belong to `mem0` itself, so they go **before** the command name:
|
||||
|------|-------------|
|
||||
| `--json` | Enable agent mode: structured JSON envelope output, no colors or spinners |
|
||||
| `--agent` | Alias for `--json` |
|
||||
| `--version` | Print the CLI version and exit |
|
||||
| `--version` | Print the CLI version and exit. `mem0 version` does the same thing as a regular subcommand |
|
||||
|
||||
<Warning>
|
||||
On `init` only, `--agent` means something different. `mem0 init --agent` creates an Agent Mode account (see [Sign up as an agent](/platform/agent-signup)); it does not switch the output to JSON. To get JSON from `init`, put the flag first: `mem0 --json init`.
|
||||
|
||||
@@ -99,16 +99,23 @@ results = client.search(
|
||||
|
||||
### Recommended Configurations
|
||||
|
||||
`rerank` is the only lever here that changes result *order*. `filters`, `top_k`, and `threshold` change *which* memories come back, not how they're ordered. The two functions below send the same query and filters; the only difference is the `rerank` flag.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
# Basic search - good for exploration
|
||||
# Fast path - use for exploratory search, or anywhere the user scans a list
|
||||
# of results instead of trusting result #1 (dashboards, "show me everything
|
||||
# about X" style queries). No reranking overhead.
|
||||
def quick_search(query, user_id):
|
||||
return client.search(
|
||||
query=query,
|
||||
filters={"user_id": user_id},
|
||||
)
|
||||
|
||||
# Reranked search - good when result order matters
|
||||
# Precision path - use when only the top result reaches the user, e.g. an
|
||||
# agent that injects a single fact into a prompt. Reranking (see above)
|
||||
# re-scores every match and moves the closest one to position 1, at the
|
||||
# cost of ~150-200ms added latency.
|
||||
def standard_search(query, user_id):
|
||||
return client.search(
|
||||
query=query,
|
||||
@@ -118,14 +125,19 @@ def standard_search(query, user_id):
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
// Basic search - good for exploration
|
||||
// Fast path - use for exploratory search, or anywhere the user scans a list
|
||||
// of results instead of trusting result #1 (dashboards, "show me everything
|
||||
// about X" style queries). No reranking overhead.
|
||||
function quickSearch(query, userId) {
|
||||
return client.search(query, {
|
||||
filters: { user_id: userId },
|
||||
});
|
||||
}
|
||||
|
||||
// Reranked search - good when result order matters
|
||||
// Precision path - use when only the top result reaches the user, e.g. an
|
||||
// agent that injects a single fact into a prompt. Reranking (see above)
|
||||
// re-scores every match and moves the closest one to position 1, at the
|
||||
// cost of ~150-200ms added latency.
|
||||
function standardSearch(query, userId) {
|
||||
return client.search(query, {
|
||||
filters: { user_id: userId },
|
||||
@@ -135,6 +147,8 @@ function standardSearch(query, userId) {
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
**What changes in the response:** both calls return the same fields on each memory (see the [Search Memories API reference](/api-reference/memory/search-memories) for the full response shape). The only difference is the *order* of the `results` array, the same effect shown in the [Reranking example above](#reranking): `quick_search` returns results ranked by raw similarity, `standard_search` returns the reranked order.
|
||||
|
||||
## Best Practices
|
||||
|
||||
### Do
|
||||
|
||||
@@ -75,7 +75,7 @@ print(response)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
This "Updated custom categories" message is specific to a PATCH-style partial update, which is what `client.project.update()` sends. Calling the raw API with a full PUT instead returns a generic `{"message": "Project updated successfully."}`, regardless of which fields changed.
|
||||
Treat the `message` string as informational. The project endpoint accepts `PATCH` only, and its documented response is the generic `{"message": "Project updated successfully"}`. Confirm an update by reading the field back, as in the next step, rather than by matching on the message.
|
||||
|
||||
### 2. Confirm the active catalog
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ client.project.update(decay=True)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
await client.project.update({ decay: true });
|
||||
await client.updateProject({ decay: true });
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
@@ -75,32 +75,32 @@ curl -X PATCH https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PR
|
||||
```
|
||||
|
||||
```json Response
|
||||
{ "message": "Updated decay" }
|
||||
{ "message": "Project updated successfully" }
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### 2. Confirm the state
|
||||
|
||||
`decay` is returned on every project read; there is currently no way to narrow the response to just this field, so read the full project object and pick out `decay`.
|
||||
`decay` is returned on every project read. To fetch only this field, use `?fields=decay`.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
response = client.project.get()
|
||||
response = client.project.get(fields=["decay"])
|
||||
print(response["decay"])
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const response = await client.project.get();
|
||||
const response = await client.getProject({ fields: ["decay"] });
|
||||
console.log(response.decay);
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/" \
|
||||
curl "https://api.mem0.ai/api/v1/orgs/organizations/$ORG_ID/projects/$PROJECT_ID/?fields=decay" \
|
||||
-H "Authorization: Token $MEM0_API_KEY"
|
||||
```
|
||||
|
||||
```json Response
|
||||
{ "decay": true, "...": "full project object" }
|
||||
{ "decay": true }
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -114,7 +114,7 @@ client.project.update(decay=False)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
await client.project.update({ decay: false });
|
||||
await client.updateProject({ decay: false });
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
|
||||
Reference in New Issue
Block a user