Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0a930a7d3 | ||
|
|
05c404d8d3 | ||
|
|
7484eed4b2 | ||
|
|
2c496e6376 | ||
|
|
a20b68fcec | ||
|
|
eb7c712aa6 | ||
|
|
7476c39257 | ||
|
|
5b0f1a7cf8 | ||
|
|
b336cdf018 | ||
|
|
60e4e8a662 | ||
|
|
6d4a78b7c7 | ||
|
|
d39a1d5541 | ||
|
|
044ad4f131 | ||
|
|
75482fdb29 | ||
|
|
6c69599db9 | ||
|
|
b79bfb7c1e | ||
|
|
5a1083b709 | ||
|
|
ac085db500 | ||
|
|
2cc253341c | ||
|
|
e3e2da6d45 | ||
|
|
acf7a30d32 | ||
|
|
a4f6751741 | ||
|
|
6f3fbd087d | ||
|
|
a98842422b | ||
|
|
aaf879322c | ||
|
|
8139b5887f | ||
|
|
b4b27f099e |
@@ -56,16 +56,12 @@ jobs:
|
||||
run: sudo apt-get update && sudo apt-get install -y libgeos-dev
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install --upgrade pip wheel setuptools
|
||||
pip install --only-binary=shapely shapely
|
||||
make install_all
|
||||
pip install -e ".[test]"
|
||||
pip install pinecone pinecone-text
|
||||
pip install --upgrade pip
|
||||
pip install -e ".[test,graph,vector_stores,llms,extras]"
|
||||
pip install ruff
|
||||
if: steps.cached-hatch-dependencies.outputs.cache-hit != 'true'
|
||||
- name: Run Formatting
|
||||
run: |
|
||||
mkdir -p .ruff_cache && chmod -R 777 .ruff_cache
|
||||
hatch run format
|
||||
- name: Run Linting
|
||||
run: make lint
|
||||
- name: Run tests and generate coverage report
|
||||
run: make test
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ install:
|
||||
|
||||
install_all:
|
||||
pip install ruff==0.6.9 groq together boto3 litellm ollama chromadb weaviate weaviate-client sentence_transformers vertexai \
|
||||
google-generativeai elasticsearch opensearch-py vecs "pinecone<7.0.0" pinecone-text faiss-cpu langchain-community \
|
||||
upstash-vector azure-search-documents langchain-memgraph langchain-neo4j rank-bm25 pymochow
|
||||
google-generativeai elasticsearch opensearch-py vecs "pinecone<7.0.0" pinecone-text faiss-cpu langchain-community \
|
||||
upstash-vector azure-search-documents langchain-memgraph langchain-neo4j langchain-aws rank-bm25 pymochow pymongo
|
||||
|
||||
# Format code with ruff
|
||||
format:
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<Note type="info">
|
||||
🔐 Mem0 is now <strong>SOC 2</strong> and <strong>HIPAA</strong> compliant! We're committed to the highest standards of data security and privacy, enabling secure memory for enterprises, healthcare, and beyond.
|
||||
</Note>
|
||||
@@ -4,7 +4,7 @@ icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 provides a powerful set of APIs that allow you to integrate advanced memory management capabilities into your applications. Our APIs are designed to be intuitive, efficient, and scalable, enabling you to create, retrieve, update, and delete memories across various entities such as users, agents, apps, and runs.
|
||||
|
||||
|
||||
+11
-1
@@ -3,7 +3,7 @@ title: "Product Updates"
|
||||
mode: "wide"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
@@ -409,6 +409,16 @@ mode: "wide"
|
||||
|
||||
<Tab title="TypeScript">
|
||||
|
||||
<Update label="2025-07-03" description="v2.1.34">
|
||||
**New Features:**
|
||||
- **OSS:** Added Gemini support
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-24" description="v2.1.33">
|
||||
**Improvement :**
|
||||
- **Client:** Added `immutable` param to `add` method.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-20" description="v2.1.32">
|
||||
**Improvement :**
|
||||
- **Client:** Made `api_version` V2 as default.
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Config in mem0 is a dictionary that specifies the settings for your embedding models. It allows you to customize the behavior and connection details of your chosen embedder.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 offers support for various embedding models, allowing users to choose the one that best suits their needs.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## How to define configurations?
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
title: Anthropic
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use anthropic's models, please set the `ANTHROPIC_API_KEY` which you find on their [Account Settings Page](https://console.anthropic.com/account/keys).
|
||||
To use Anthropic's models, please set the `ANTHROPIC_API_KEY` which you find on their [Account Settings Page](https://console.anthropic.com/account/keys).
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: AWS Bedrock
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
### Setup
|
||||
- Before using the AWS Bedrock LLM, make sure you have the appropriate model access from [Bedrock Console](https://us-east-1.console.aws.amazon.com/bedrock/home?region=us-east-1#/modelaccess).
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Azure OpenAI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
<Note> Mem0 Now Supports Azure OpenAI Models in TypeScript SDK </Note>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: DeepSeek
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use DeepSeek LLM models, you have to set the `DEEPSEEK_API_KEY` environment variable. You can also optionally set `DEEPSEEK_API_BASE` if you need to use a different API endpoint (defaults to "https://api.deepseek.com").
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Gemini
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use the Gemini model, set the `GEMINI_API_KEY` environment variable. You can obtain the Gemini API key from [Google AI Studio](https://aistudio.google.com/app/apikey).
|
||||
|
||||
@@ -12,7 +12,8 @@ To use the Gemini model, set the `GEMINI_API_KEY` environment variable. You can
|
||||
|
||||
## Usage
|
||||
|
||||
```python
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
@@ -43,6 +44,32 @@ messages = [
|
||||
m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
```
|
||||
```typescript TypeScript
|
||||
import { Memory } from "mem0ai/oss";
|
||||
|
||||
const config = {
|
||||
llm: {
|
||||
// You can also use "google" as provider ( for backward compatibility )
|
||||
provider: "gemini",
|
||||
config: {
|
||||
model: "gemini-2.0-flash-001",
|
||||
temperature: 0.1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const memory = new Memory(config);
|
||||
|
||||
const messages = [
|
||||
{ role: "user", content: "I'm planning to watch a movie tonight. Any recommendations?" },
|
||||
{ role: "assistant", content: "How about thriller movies? They can be quite engaging." },
|
||||
{ role: "user", content: "I’m not a big fan of thrillers, but I love sci-fi movies." },
|
||||
{ role: "assistant", content: "Got it! I'll avoid thrillers and suggest sci-fi movies instead." }
|
||||
]
|
||||
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Config
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Google AI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use Google AI model, you have to set the `GOOGLE_API_KEY` environment variable. You can obtain the Google API key from the [Google Maker Suite](https://makersuite.google.com/app/apikey)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Groq
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
[Groq](https://groq.com/) is the creator of the world's first Language Processing Unit (LPU), providing exceptional speed performance for AI workloads running on their LPU Inference Engine.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: LangChain
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 supports LangChain as a provider to access a wide range of LLM models. LangChain is a framework for developing applications powered by language models, making it easy to integrate various LLM providers through a consistent interface.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
[Litellm](https://litellm.vercel.app/docs/) is compatible with over 100 large language models (LLMs), all using a standardized input/output format. You can explore the [available models](https://litellm.vercel.app/docs/providers) to use with Litellm. Ensure you set the `API_KEY` for the model you choose to use.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: LM Studio
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use LM Studio with Mem0, you'll need to have LM Studio running locally with its server enabled. LM Studio provides a way to run local LLMs with an OpenAI-compatible API.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mistral AI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use mistral's models, please obtain the Mistral AI api key from their [console](https://console.mistral.ai/). Set the `MISTRAL_API_KEY` environment variable to use the model as given below in the example.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
You can use LLMs from Ollama to run Mem0 locally. These [models](https://ollama.com/search?c=tools) support tool support.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: OpenAI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use OpenAI LLM models, you have to set the `OPENAI_API_KEY` environment variable. You can obtain the OpenAI API key from the [OpenAI Platform](https://platform.openai.com/account/api-keys).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Sarvam AI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
**Sarvam AI** is an Indian AI company developing language models with a focus on Indian languages and cultural context. Their latest model **Sarvam-M** is designed to understand and generate content in multiple Indian languages while maintaining high performance in English.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To use TogetherAI LLM models, you have to set the `TOGETHER_API_KEY` environment variable. You can obtain the TogetherAI API key from their [Account settings page](https://api.together.xyz/settings/api-keys).
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: vLLM
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
[vLLM](https://docs.vllm.ai/) is a high-performance inference engine for large language models that provides significant performance improvements for local inference. It's designed to maximize throughput and memory efficiency for serving LLMs.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: xAI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
[xAI](https://x.ai/) is a new AI company founded by Elon Musk that develops large language models, including Grok. Grok is trained on real-time data from X (formerly Twitter) and aims to provide accurate, up-to-date responses with a touch of wit and humor.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 includes built-in support for various popular large language models. Memory can utilize the LLM provided by the user, ensuring efficient use for specific needs.
|
||||
|
||||
@@ -14,7 +14,9 @@ To use a llm, you must provide a configuration to customize its usage. If no con
|
||||
|
||||
For a comprehensive list of available parameters for llm configuration, please refer to [Config](./config).
|
||||
|
||||
To view all supported llms, visit the [Supported LLMs](./models).
|
||||
## Supported LLMs
|
||||
|
||||
See the list of supported LLMs below.
|
||||
|
||||
<Note>
|
||||
All LLMs are supported in Python. The following LLMs are also supported in TypeScript: **OpenAI**, **Anthropic**, and **Groq**.
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## How to define configurations?
|
||||
|
||||
|
||||
@@ -16,8 +16,7 @@ config = {
|
||||
"config": {
|
||||
"db_name": "mem0-db",
|
||||
"collection_name": "mem0-collection",
|
||||
"user": "my-user",
|
||||
"password": "my-password",
|
||||
"mongo_uri":"mongodb://username:password@localhost:27017"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -41,9 +40,6 @@ Here are the parameters available for configuring MongoDB:
|
||||
| db_name | Name of the MongoDB database | `"mem0_db"` |
|
||||
| collection_name | Name of the MongoDB collection | `"mem0_collection"` |
|
||||
| embedding_model_dims | Dimensions of the embedding vectors | `1536` |
|
||||
| user | MongoDB user for authentication | `None` |
|
||||
| password | Password for the MongoDB user | `None` |
|
||||
| host | MongoDB host | `"localhost"` |
|
||||
| port | MongoDB port | `27017` |
|
||||
| mongo_uri | The mongo URI connection string | mongodb://username:password@localhost:27017 |
|
||||
|
||||
> **Note**: `user` and `password` must either be provided together or omitted together.
|
||||
> **Note**: If Mongo_uri is not provided it will default to mongodb://username:password@localhost:27017.
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 includes built-in support for various popular databases. Memory can utilize the database provided by the user, ensuring efficient use for specific needs.
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Development
|
||||
icon: "code"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Development Contributions
|
||||
|
||||
@@ -31,13 +31,18 @@ For detailed guidance on pull requests, refer to [GitHub's documentation](https:
|
||||
|
||||
We use `hatch` as our package manager. Install it by following the [official instructions](https://hatch.pypa.io/latest/install/).
|
||||
|
||||
⚠️ **Do NOT use `pip` or `conda` for dependency management.** Instead, run:
|
||||
⚠️ **Do NOT use `pip` or `conda` for dependency management.** Instead, follow these steps in order:
|
||||
|
||||
```bash
|
||||
make install_all
|
||||
# 1. Install base dependencies
|
||||
make install
|
||||
|
||||
# Activate virtual environment
|
||||
hatch shell
|
||||
# 2. Activate virtual environment (this will install deps.)
|
||||
hatch shell (for default env)
|
||||
hatch -e dev_py_3_11 shell (for dev_py_3_11) (differences are mentioned in pyproject.toml)
|
||||
|
||||
# 3. Install all optional dependencies
|
||||
make install_all
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Documentation
|
||||
icon: "book"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Documentation Contributions
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 provides two core operations for managing memories in AI applications: adding new memories and searching existing ones. This guide covers how these operations work and how to use them effectively in your application.
|
||||
|
||||
|
||||
@@ -0,0 +1,154 @@
|
||||
---
|
||||
title: Add Memory
|
||||
description: Add memory into the Mem0 platform by storing user-assistant interactions and facts for later retrieval.
|
||||
icon: "plus"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
The `add` operation is how you store memory into Mem0. Whether you're working with a chatbot, a voice assistant, or a multi-agent system, this is the entry point to create long-term memory.
|
||||
|
||||
Memories typically come from a **user-assistant interaction** and Mem0 handles the extraction, transformation, and storage for you.
|
||||
|
||||
Mem0 offers two implementation flows:
|
||||
|
||||
- **Mem0 Platform** (Managed, scalable, with dashboard + API)
|
||||
- **Mem0 Open Source** (Lightweight, fully local, flexible SDKs)
|
||||
|
||||
Each supports the same core memory operations, but with slightly different setup. Below, we walk through examples for both.
|
||||
|
||||
|
||||
## Architecture
|
||||
|
||||
<Frame caption="Architecture diagram illustrating the process of adding memories.">
|
||||
<img src="../../images/add_architecture.png" />
|
||||
</Frame>
|
||||
|
||||
When you call `add`, Mem0 performs the following steps under the hood:
|
||||
|
||||
1. **Information Extraction**
|
||||
The input messages are passed through an LLM that extracts key facts, decisions, preferences, or events worth remembering.
|
||||
|
||||
2. **Conflict Resolution**
|
||||
Mem0 compares the new memory against existing ones to detect duplication or contradiction and handles updates accordingly.
|
||||
|
||||
3. **Memory Storage**
|
||||
The result is stored in a vector database (for semantic search) and optionally in a graph structure (for relationship mapping).
|
||||
|
||||
You don’t need to handle any of this manually, Mem0 takes care of it with a single API call or SDK method.
|
||||
|
||||
---
|
||||
|
||||
## Example: Mem0 Platform
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning a trip to Tokyo next month."},
|
||||
{"role": "assistant", "content": "Great! I’ll remember that for future suggestions."}
|
||||
]
|
||||
|
||||
client.add(
|
||||
messages=messages,
|
||||
user_id="alice",
|
||||
version="v2"
|
||||
)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
|
||||
const client = new MemoryClient({apiKey: "your-api-key"});
|
||||
|
||||
const messages = [
|
||||
{ role: "user", content: "I'm planning a trip to Tokyo next month." },
|
||||
{ role: "assistant", content: "Great! I’ll remember that for future suggestions." }
|
||||
];
|
||||
|
||||
await client.add({
|
||||
messages,
|
||||
user_id: "alice",
|
||||
version: "v2"
|
||||
});
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## Example: Mem0 Open Source
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
m = Memory()
|
||||
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about a thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of thriller movies but I love sci-fi movies."},
|
||||
{"role": "assistant", "content": "Got it! I'll avoid thriller recommendations and suggest sci-fi movies in the future."}
|
||||
]
|
||||
|
||||
# Store inferred memories (default behavior)
|
||||
result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"})
|
||||
|
||||
# Optionally store raw messages without inference
|
||||
result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"}, infer=False)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
|
||||
const memory = new Memory();
|
||||
|
||||
const messages = [
|
||||
{
|
||||
role: "user",
|
||||
content: "I like to drink coffee in the morning and go for a walk"
|
||||
}
|
||||
];
|
||||
|
||||
const result = memory.add(messages, {
|
||||
userId: "alice",
|
||||
metadata: { category: "preferences" }
|
||||
});
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## When Should You Add Memory?
|
||||
|
||||
Add memory whenever your agent learns something useful:
|
||||
|
||||
- A new user preference is shared
|
||||
- A decision or suggestion is made
|
||||
- A goal or task is completed
|
||||
- A new entity is introduced
|
||||
- A user gives feedback or clarification
|
||||
|
||||
Storing this context allows the agent to reason better in future interactions.
|
||||
|
||||
|
||||
### More Details
|
||||
|
||||
For full list of supported fields, required formats, and advanced options, see the
|
||||
[Add Memory API Reference](/api-reference/memory/add-memories).
|
||||
|
||||
---
|
||||
|
||||
## Need help?
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx"/>
|
||||
@@ -0,0 +1,143 @@
|
||||
---
|
||||
title: Delete Memory
|
||||
description: Remove memories from Mem0 either individually, in bulk, or via filters.
|
||||
icon: "trash"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
Memories can become outdated, irrelevant, or need to be removed for privacy or compliance reasons. Mem0 offers flexible ways to delete memory:
|
||||
|
||||
1. **Delete a Single Memory**: Using a specific memory ID
|
||||
2. **Batch Delete**: Delete multiple known memory IDs (up to 1000)
|
||||
3. **Filtered Delete**: Delete memories matching a filter (e.g., `user_id`, `metadata`, `run_id`)
|
||||
|
||||
This page walks through code example for each method.
|
||||
|
||||
|
||||
## Use Cases
|
||||
|
||||
- Forget a user’s past preferences by request
|
||||
- Remove outdated or incorrect memory entries
|
||||
- Clean up memory after session expiration
|
||||
- Comply with data deletion requests (e.g., GDPR)
|
||||
|
||||
---
|
||||
|
||||
## 1. Delete a Single Memory by ID
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
memory_id = "your_memory_id"
|
||||
client.delete(memory_id=memory_id)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
|
||||
client.delete("your_memory_id")
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## 2. Batch Delete Multiple Memories
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
delete_memories = [
|
||||
{"memory_id": "id1"},
|
||||
{"memory_id": "id2"}
|
||||
]
|
||||
|
||||
response = client.batch_delete(delete_memories)
|
||||
print(response)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
|
||||
const deleteMemories = [
|
||||
{ memory_id: "id1" },
|
||||
{ memory_id: "id2" }
|
||||
];
|
||||
|
||||
client.batchDelete(deleteMemories)
|
||||
.then(response => console.log('Batch delete response:', response))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## 3. Delete Memories by Filter (e.g., user_id)
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
# Delete all memories for a specific user
|
||||
client.delete_all(user_id="alice")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
|
||||
client.deleteAll({ user_id: "alice" })
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
You can also filter by other parameters such as:
|
||||
- `agent_id`
|
||||
- `run_id`
|
||||
- `metadata` (as JSON string)
|
||||
|
||||
---
|
||||
|
||||
## Key Differences
|
||||
|
||||
| Method | Use When | IDs Needed | Filters |
|
||||
|----------------------|-------------------------------------------|------------|----------|
|
||||
| `delete(memory_id)` | You know exactly which memory to remove | ✔ | ✘ |
|
||||
| `batch_delete([...])`| You have a known list of memory IDs | ✔ | ✘ |
|
||||
| `delete_all(...)` | You want to delete by user/agent/run/etc | ✘ | ✔ |
|
||||
|
||||
|
||||
### More Details
|
||||
|
||||
For request/response schema and additional filtering options, see:
|
||||
- [Delete Memory API Reference](/api-reference/memory/delete-memory)
|
||||
- [Batch Delete API Reference](/api-reference/memory/batch-delete)
|
||||
- [Delete Memories by Filter Reference](/api-reference/memory/delete-memories)
|
||||
|
||||
You’ve now seen how to add, search, update, and delete memories in Mem0.
|
||||
|
||||
---
|
||||
|
||||
## Need help?
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx"/>
|
||||
@@ -0,0 +1,126 @@
|
||||
---
|
||||
title: Search Memory
|
||||
description: Retrieve relevant memories from Mem0 using powerful semantic and filtered search capabilities.
|
||||
icon: "magnifying-glass"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
The `search` operation allows you to retrieve relevant memories based on a natural language query and optional filters like user ID, agent ID, categories, and more. This is the foundation of giving your agents memory-aware behavior.
|
||||
|
||||
Mem0 supports:
|
||||
- Semantic similarity search
|
||||
- Metadata filtering (with advanced logic)
|
||||
- Reranking and thresholds
|
||||
- Cross-agent, multi-session context resolution
|
||||
|
||||
This applies to both:
|
||||
- **Mem0 Platform** (hosted API with full-scale features)
|
||||
- **Mem0 Open Source** (local-first with LLM inference and local vector DB)
|
||||
|
||||
|
||||
## Architecture
|
||||
|
||||
<Frame caption="Architecture diagram illustrating the memory search process.">
|
||||
<img src="../../images/search_architecture.png" />
|
||||
</Frame>
|
||||
|
||||
The search flow follows these steps:
|
||||
|
||||
1. **Query Processing**
|
||||
An LLM refines and optimizes your natural language query.
|
||||
|
||||
2. **Vector Search**
|
||||
Semantic embeddings are used to find the most relevant memories using cosine similarity.
|
||||
|
||||
3. **Filtering & Ranking**
|
||||
Logical and comparison-based filters are applied. Memories are scored, filtered, and optionally reranked.
|
||||
|
||||
4. **Results Delivery**
|
||||
Relevant memories are returned with associated metadata and timestamps.
|
||||
|
||||
---
|
||||
|
||||
## Example: Mem0 Platform
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
query = "What do you know about me?"
|
||||
filters = {
|
||||
"OR": [
|
||||
{"user_id": "alice"},
|
||||
{"agent_id": {"in": ["travel-assistant", "customer-support"]}}
|
||||
]
|
||||
}
|
||||
|
||||
results = client.search(query, version="v2", filters=filters)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
|
||||
const client = new MemoryClient({apiKey: "your-api-key"});
|
||||
|
||||
const query = "I'm craving some pizza. Any recommendations?";
|
||||
const filters = {
|
||||
AND: [
|
||||
{ user_id: "alice" }
|
||||
]
|
||||
};
|
||||
|
||||
const results = await client.search(query, {
|
||||
version: "v2",
|
||||
filters
|
||||
});
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## Example: Mem0 Open Source
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import Memory
|
||||
|
||||
m = Memory()
|
||||
related_memories = m.search("Should I drink coffee or tea?", user_id="alice")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
|
||||
const memory = new Memory();
|
||||
const relatedMemories = memory.search("Should I drink coffee or tea?", { userId: "alice" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## Tips for Better Search
|
||||
|
||||
- Use descriptive natural queries (Mem0 can interpret intent)
|
||||
- Apply filters for scoped, faster lookup
|
||||
- Use `version: "v2"` for enhanced results
|
||||
- Consider wildcard filters (e.g., `run_id: "*"`) for broader matches
|
||||
- Tune with `top_k`, `threshold`, or `rerank` if needed
|
||||
|
||||
|
||||
### More Details
|
||||
|
||||
For the full list of filter logic, comparison operators, and optional search parameters, see the
|
||||
[Search Memory API Reference](/api-reference/memory/v2-search-memories).
|
||||
|
||||
---
|
||||
|
||||
## Need help?
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx"/>
|
||||
@@ -0,0 +1,119 @@
|
||||
---
|
||||
title: Update Memory
|
||||
description: Modify an existing memory by updating its content or metadata.
|
||||
icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
User preferences, interests, and behaviors often evolve over time. The `update` operation lets you revise a stored memory, whether it's updating facts and memories, rephrasing a message, or enriching metadata.
|
||||
|
||||
Mem0 supports both:
|
||||
- **Single Memory Update** for one specific memory using its ID
|
||||
- **Batch Update** for updating many memories at once (up to 1000)
|
||||
|
||||
This guide includes usage for both single update and batch update of memories through **Mem0 Platform**
|
||||
|
||||
|
||||
## Use Cases
|
||||
|
||||
- Refine a vague or incorrect memory after a correction
|
||||
- Add or edit memory with new metadata (e.g., categories, tags)
|
||||
- Evolve factual knowledge as the user’s profile changes
|
||||
- A user profile evolves: “I love spicy food” → later says “Actually, I can’t handle spicy food.”
|
||||
|
||||
Updating memory ensures your agents remain accurate, adaptive, and personalized.
|
||||
|
||||
---
|
||||
|
||||
## Update Memory
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
memory_id = "your_memory_id"
|
||||
client.update(
|
||||
memory_id=memory_id,
|
||||
text="Updated memory content about the user",
|
||||
metadata={"category": "profile-update"}
|
||||
)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
const memory_id = "your_memory_id";
|
||||
|
||||
client.update(memory_id, {
|
||||
text: "Updated memory content about the user",
|
||||
metadata: { category: "profile-update" }
|
||||
})
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## Batch Update
|
||||
|
||||
Update up to 1000 memories in one call.
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import MemoryClient
|
||||
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
|
||||
update_memories = [
|
||||
{"memory_id": "id1", "text": "Watches football"},
|
||||
{"memory_id": "id2", "text": "Likes to travel"}
|
||||
]
|
||||
|
||||
response = client.batch_update(update_memories)
|
||||
print(response)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient({ apiKey: "your-api-key" });
|
||||
|
||||
const updateMemories = [
|
||||
{ memoryId: "id1", text: "Watches football" },
|
||||
{ memoryId: "id2", text: "Likes to travel" }
|
||||
];
|
||||
|
||||
client.batchUpdate(updateMemories)
|
||||
.then(response => console.log('Batch update response:', response))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
---
|
||||
|
||||
## Tips
|
||||
|
||||
- You can update both `text` and `metadata` in the same call.
|
||||
- Use `batchUpdate` when you're applying similar corrections at scale.
|
||||
- If memory is marked `immutable`, it must first be deleted and re-added.
|
||||
- Combine this with feedback mechanisms (e.g., user thumbs-up/down) to self-improve memory.
|
||||
|
||||
|
||||
### More Details
|
||||
|
||||
Refer to the full [Update Memory API Reference](/api-reference/memory/update-memory) and [Batch Update Reference](/api-reference/memory/batch-update) for schema and advanced fields.
|
||||
|
||||
---
|
||||
|
||||
## Need help?
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx"/>
|
||||
@@ -5,7 +5,7 @@ icon: "memory"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
To build useful AI applications, we need to understand how different memory systems work together. This guide explores the fundamental types of memory in AI systems and shows how Mem0 implements these concepts.
|
||||
|
||||
|
||||
+33
-49
@@ -19,10 +19,10 @@
|
||||
"tab": "Documentation",
|
||||
"groups": [
|
||||
{
|
||||
"group": "Get Started",
|
||||
"group": "Getting Started",
|
||||
"icon": "rocket",
|
||||
"pages": [
|
||||
"overview",
|
||||
"what-is-mem0",
|
||||
"quickstart",
|
||||
"faqs"
|
||||
]
|
||||
@@ -32,7 +32,16 @@
|
||||
"icon": "brain",
|
||||
"pages": [
|
||||
"core-concepts/memory-types",
|
||||
"core-concepts/memory-operations"
|
||||
{
|
||||
"group": "Memory Operations",
|
||||
"icon": "gear",
|
||||
"pages": [
|
||||
"core-concepts/memory-operations/add",
|
||||
"core-concepts/memory-operations/search",
|
||||
"core-concepts/memory-operations/update",
|
||||
"core-concepts/memory-operations/delete"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -46,21 +55,20 @@
|
||||
"icon": "star",
|
||||
"pages": [
|
||||
"platform/features/platform-overview",
|
||||
"platform/features/contextual-add",
|
||||
"platform/features/async-client",
|
||||
"platform/features/advanced-retrieval",
|
||||
"platform/features/criteria-retrieval",
|
||||
"platform/features/contextual-add",
|
||||
"platform/features/multimodal-support",
|
||||
"platform/features/timestamp",
|
||||
"platform/features/selective-memory",
|
||||
"platform/features/custom-categories",
|
||||
"platform/features/custom-instructions",
|
||||
"platform/features/direct-import",
|
||||
"platform/features/async-client",
|
||||
"platform/features/memory-export",
|
||||
"platform/features/timestamp",
|
||||
"platform/features/expiration-date",
|
||||
"platform/features/webhooks",
|
||||
"platform/features/graph-memory",
|
||||
"platform/features/feedback-mechanism",
|
||||
"platform/features/expiration-date"
|
||||
"platform/features/group-chat"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -69,12 +77,12 @@
|
||||
"group": "Open Source",
|
||||
"icon": "code-branch",
|
||||
"pages": [
|
||||
"open-source/quickstart",
|
||||
"open-source/overview",
|
||||
"open-source/python-quickstart",
|
||||
"open-source/node-quickstart",
|
||||
{
|
||||
"group": "Features",
|
||||
"icon": "wrench",
|
||||
"icon": "star",
|
||||
"pages": [
|
||||
"open-source/features/async-memory",
|
||||
"open-source/features/openai_compatibility",
|
||||
@@ -239,24 +247,25 @@
|
||||
"icon": "plug",
|
||||
"pages": [
|
||||
"integrations",
|
||||
"integrations/agentops",
|
||||
"integrations/vercel-ai-sdk",
|
||||
"integrations/flowise",
|
||||
"integrations/crewai",
|
||||
"integrations/autogen",
|
||||
"integrations/langchain",
|
||||
"integrations/langgraph",
|
||||
"integrations/llama-index",
|
||||
"integrations/langchain-tools",
|
||||
"integrations/dify",
|
||||
"integrations/mcp-server",
|
||||
"integrations/livekit",
|
||||
"integrations/elevenlabs",
|
||||
"integrations/pipecat",
|
||||
"integrations/agno",
|
||||
"integrations/autogen",
|
||||
"integrations/crewai",
|
||||
"integrations/openai-agents-sdk",
|
||||
"integrations/google-ai-adk",
|
||||
"integrations/mastra",
|
||||
"integrations/vercel-ai-sdk",
|
||||
"integrations/livekit",
|
||||
"integrations/pipecat",
|
||||
"integrations/elevenlabs",
|
||||
"integrations/flowise",
|
||||
"integrations/langchain-tools",
|
||||
"integrations/agentops",
|
||||
"integrations/keywords",
|
||||
"integrations/raycast",
|
||||
"integrations/mastra"
|
||||
"integrations/dify",
|
||||
"integrations/raycast"
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -351,31 +360,6 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"anchor": "Your Dashboard",
|
||||
"href": "https://app.mem0.ai",
|
||||
"icon": "chart-simple"
|
||||
},
|
||||
{
|
||||
"anchor": "Demo",
|
||||
"href": "https://mem0.dev/demo",
|
||||
"icon": "play"
|
||||
},
|
||||
{
|
||||
"anchor": "Discord",
|
||||
"href": "https://mem0.dev/DiD",
|
||||
"icon": "discord"
|
||||
},
|
||||
{
|
||||
"anchor": "GitHub",
|
||||
"href": "https://github.com/mem0ai/mem0",
|
||||
"icon": "github"
|
||||
},
|
||||
{
|
||||
"anchor": "Support",
|
||||
"href": "mailto:founders@mem0.ai",
|
||||
"icon": "envelope"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ title: Overview
|
||||
description: How to use mem0 in your existing applications?
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
|
||||
With Mem0, you can create stateful LLM-based applications such as chatbots, virtual assistants, or AI agents. Mem0 enhances your applications by providing a memory layer that makes responses:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: AI Companion
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
You can create a personalised AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: AI Companion in Node.js
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
You can create a personalised AI Companion using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: AWS Bedrock and AOSS
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
This example demonstrates how to configure and use the `mem0ai` SDK with **AWS Bedrock** and **OpenSearch Service (AOSS)** for persistent memory capabilities in Python.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Mem0 Chrome Extension
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Enhance your AI interactions with **Mem0**, a Chrome extension that introduces a universal memory layer across platforms like `ChatGPT`, `Claude`, and `Perplexity`. Mem0 ensures seamless context sharing, making your AI experiences more personalized and efficient.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Multi-User Collaboration with Mem0
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Customer Support AI Agent
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Document Editing with Mem0
|
||||
---
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
This guide demonstrates how to leverage **Mem0** to edit documents efficiently, ensuring they align with your unique writing style and preferences.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Eliza OS Character
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
You can create a personalised Eliza OS Character using Mem0. This guide will walk you through the necessary steps and provide the complete code to get you started.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Email Processing with Mem0
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: LlamaIndex ReAct Agent
|
||||
---
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Create a ReAct Agent with LlamaIndex which uses Mem0 as the memory store.
|
||||
|
||||
@@ -22,7 +22,7 @@ os.environ["OPENAI_API_KEY"] = "<your-openai-api-key>"
|
||||
llm = OpenAI(model="gpt-4o")
|
||||
```
|
||||
|
||||
Initialize the Mem0 client. You can find your API key [here](https://app.mem0.ai/dashboard/). Read about Mem0 [Open Source](https://docs.mem0.ai/open-source/quickstart).
|
||||
Initialize the Mem0 client. You can find your API key [here](https://app.mem0.ai/dashboard/api-keys). Read about Mem0 [Open Source](https://docs.mem0.ai/open-source/overview).
|
||||
```python
|
||||
os.environ["MEM0_API_KEY"] = "<your-mem0-api-key>"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mem0 as an Agentic Tool
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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,7 +3,7 @@ title: Mem0 Demo
|
||||
---
|
||||
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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,7 +3,7 @@ title: 'Healthcare Assistant with Mem0 and Google ADK'
|
||||
description: 'Build a personalized healthcare agent that remembers patient information across conversations using Mem0 and Google ADK'
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Healthcare Assistant with Memory
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mem0 with Mastra
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
In this example you'll learn how to use the 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).
|
||||
|
||||
@@ -3,7 +3,7 @@ title: 'Mem0 with OpenAI Agents SDK for Voice'
|
||||
description: 'Integrate memory capabilities into your voice agents using Mem0 and OpenAI Agents SDK'
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Building Voice Agents with Memory using Mem0 and OpenAI Agents SDK
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mem0 with Ollama
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Running Mem0 Locally with Ollama
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Multimodal Demo with Mem0
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: OpenAI Inbuilt Tools
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Integrate Mem0’s memory capabilities with OpenAI’s Inbuilt Tools to create AI agents with persistent memory.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Personalized AI Tutor
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Personal AI Travel Assistant
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Create a personalized AI Travel Assistant using Mem0. This guide provides step-by-step instructions and the complete code to get you started.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Personalized Deep Research
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: YouTube Assistant Extension
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ icon: "question"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="How does Mem0 work?">
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ icon: "wrench"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Core features
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 184 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 285 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 195 KiB |
@@ -3,7 +3,7 @@ title: Overview
|
||||
description: How to integrate Mem0 into other frameworks
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 seamlessly integrates with popular AI frameworks and tools to enhance your LLM-based applications with persistent memory capabilities. By integrating Mem0, your applications benefit from:
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: AgentOps
|
||||
---
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Integrate [**Mem0**](https://github.com/mem0ai/mem0) with [AgentOps](https://agentops.ai), a comprehensive monitoring and analytics platform for AI agents. This integration enables automatic tracking and analysis of memory operations, providing insights into agent performance and memory usage patterns.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Agno
|
||||
---
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Integrate [**Mem0**](https://github.com/mem0ai/mem0) with [Agno](https://github.com/agno-agi/agno), a Python framework for building autonomous agents. This integration enables Agno agents to access persistent memory across conversations, enhancing context retention and personalization.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Build conversational AI agents with memory capabilities. This integration combines AutoGen for creating AI agents with Mem0 for memory management, enabling context-aware and personalized interactions.
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: CrewAI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Build an AI system that combines CrewAI's agent-based architecture with Mem0's memory capabilities. This integration enables persistent memory across agent interactions and personalized task execution based on user history.
|
||||
|
||||
@@ -164,7 +164,7 @@ By combining CrewAI with Mem0, you can create sophisticated AI systems that main
|
||||
|
||||
## Help
|
||||
|
||||
- For CrewAI documentation, visit [CrewAI Documentation](https://docs.crewai.com/)
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/)
|
||||
- [CrewAI Documentation](https://docs.crewai.com/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Dify
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Integrating Mem0 with Dify AI
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: ElevenLabs
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Create voice-based conversational AI agents with memory capabilities by integrating ElevenLabs and Mem0. This integration enables persistent, context-aware voice interactions that remember past conversations.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Flowise
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
The [**Mem0 Memory**](https://github.com/mem0ai/mem0) integration with [Flowise](https://github.com/FlowiseAI/Flowise) enables persistent memory capabilities for your AI chatflows. [Flowise](https://flowiseai.com/) is an open-source low-code tool for developers to build customized LLM orchestration flows & AI agents using a drag & drop interface.
|
||||
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
---
|
||||
title: Google Agent Development Kit
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Integrate [**Mem0**](https://github.com/mem0ai/mem0) with [Google Agent Development Kit (ADK)](https://github.com/google/adk-python), an open-source framework for building multi-agent workflows. This integration enables agents to access persistent memory across conversations, enhancing context retention and personalization.
|
||||
|
||||
## Overview
|
||||
|
||||
1. Store and retrieve memories from Mem0 within Google ADK agents
|
||||
2. Multi-agent workflows with shared memory across hierarchies
|
||||
3. Retrieve relevant memories from past conversations
|
||||
4. Personalized responses
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before setting up Mem0 with Google ADK, ensure you have:
|
||||
|
||||
1. Installed the required packages:
|
||||
```bash
|
||||
pip install google-adk mem0ai
|
||||
```
|
||||
|
||||
2. Valid API keys:
|
||||
- [Mem0 API Key](https://app.mem0.ai/dashboard/api-keys)
|
||||
- Google AI Studio API Key
|
||||
|
||||
## Basic Integration Example
|
||||
|
||||
The following example demonstrates how to create a Google ADK agent with Mem0 memory integration:
|
||||
|
||||
```python
|
||||
import os
|
||||
from google.adk.agents import Agent
|
||||
from google.adk.runners import Runner
|
||||
from google.adk.sessions import InMemorySessionService
|
||||
from google.genai import types
|
||||
from mem0 import MemoryClient
|
||||
|
||||
# Set up environment variables
|
||||
os.environ["GOOGLE_API_KEY"] = "your-google-api-key"
|
||||
os.environ["MEM0_API_KEY"] = "your-mem0-api-key"
|
||||
|
||||
# Initialize Mem0 client
|
||||
mem0 = MemoryClient()
|
||||
|
||||
# Define memory function tools
|
||||
def search_memory(query: str, user_id: str) -> dict:
|
||||
"""Search through past conversations and memories"""
|
||||
memories = mem0.search(query, user_id=user_id)
|
||||
if memories:
|
||||
memory_context = "\n".join([f"- {mem['memory']}" for mem in memories])
|
||||
return {"status": "success", "memories": memory_context}
|
||||
return {"status": "no_memories", "message": "No relevant memories found"}
|
||||
|
||||
def save_memory(content: str, user_id: str) -> dict:
|
||||
"""Save important information to memory"""
|
||||
try:
|
||||
mem0.add([{"role": "user", "content": content}], user_id=user_id)
|
||||
return {"status": "success", "message": "Information saved to memory"}
|
||||
except Exception as e:
|
||||
return {"status": "error", "message": f"Failed to save memory: {str(e)}"}
|
||||
|
||||
# Create agent with memory capabilities
|
||||
personal_assistant = Agent(
|
||||
name="personal_assistant",
|
||||
model="gemini-2.0-flash",
|
||||
instruction="""You are a helpful personal assistant with memory capabilities.
|
||||
Use the search_memory function to recall past conversations and user preferences.
|
||||
Use the save_memory function to store important information about the user.
|
||||
Always personalize your responses based on available memory.""",
|
||||
description="A personal assistant that remembers user preferences and past interactions",
|
||||
tools=[search_memory, save_memory]
|
||||
)
|
||||
|
||||
def chat_with_agent(user_input: str, user_id: str) -> str:
|
||||
"""
|
||||
Handle user input with automatic memory integration.
|
||||
|
||||
Args:
|
||||
user_input: The user's message
|
||||
user_id: Unique identifier for the user
|
||||
|
||||
Returns:
|
||||
The agent's response
|
||||
"""
|
||||
# Set up session and runner
|
||||
session_service = InMemorySessionService()
|
||||
session = session_service.create_session(
|
||||
app_name="memory_assistant",
|
||||
user_id=user_id,
|
||||
session_id=f"session_{user_id}"
|
||||
)
|
||||
runner = Runner(agent=personal_assistant, app_name="memory_assistant", session_service=session_service)
|
||||
|
||||
# Create content and run agent
|
||||
content = types.Content(role='user', parts=[types.Part(text=user_input)])
|
||||
events = runner.run(user_id=user_id, session_id=session.id, new_message=content)
|
||||
|
||||
# Extract final response
|
||||
for event in events:
|
||||
if event.is_final_response():
|
||||
response = event.content.parts[0].text
|
||||
|
||||
return response
|
||||
|
||||
return "No response generated"
|
||||
|
||||
# Example usage
|
||||
if __name__ == "__main__":
|
||||
response = chat_with_agent(
|
||||
"I love Italian food and I'm planning a trip to Rome next month",
|
||||
user_id="alice"
|
||||
)
|
||||
print(response)
|
||||
```
|
||||
|
||||
## Multi-Agent Hierarchy with Shared Memory
|
||||
|
||||
Create specialized agents in a hierarchy that share memory:
|
||||
|
||||
```python
|
||||
from google.adk.tools.agent_tool import AgentTool
|
||||
|
||||
# Travel specialist agent
|
||||
travel_agent = Agent(
|
||||
name="travel_specialist",
|
||||
model="gemini-2.0-flash",
|
||||
instruction="""You are a travel planning specialist. Use get_user_context to
|
||||
understand the user's travel preferences and history before making recommendations.
|
||||
After providing advice, use store_interaction to save travel-related information.""",
|
||||
description="Specialist in travel planning and recommendations",
|
||||
tools=[search_memory, save_memory]
|
||||
)
|
||||
|
||||
# Health advisor agent
|
||||
health_agent = Agent(
|
||||
name="health_advisor",
|
||||
model="gemini-2.0-flash",
|
||||
instruction="""You are a health and wellness advisor. Use get_user_context to
|
||||
understand the user's health goals and dietary preferences.
|
||||
After providing advice, use store_interaction to save health-related information.""",
|
||||
description="Specialist in health and wellness advice",
|
||||
tools=[search_memory, save_memory]
|
||||
)
|
||||
|
||||
# Coordinator agent that delegates to specialists
|
||||
coordinator_agent = Agent(
|
||||
name="coordinator",
|
||||
model="gemini-2.0-flash",
|
||||
instruction="""You are a coordinator that delegates requests to specialist agents.
|
||||
For travel-related questions (trips, hotels, flights, destinations), delegate to the travel specialist.
|
||||
For health-related questions (fitness, diet, wellness, exercise), delegate to the health advisor.
|
||||
Use get_user_context to understand the user before delegation.""",
|
||||
description="Coordinates requests between specialist agents",
|
||||
tools=[
|
||||
AgentTool(agent=travel_agent, skip_summarization=False),
|
||||
AgentTool(agent=health_agent, skip_summarization=False)
|
||||
]
|
||||
)
|
||||
|
||||
def chat_with_specialists(user_input: str, user_id: str) -> str:
|
||||
"""
|
||||
Handle user input with specialist agent delegation and memory.
|
||||
|
||||
Args:
|
||||
user_input: The user's message
|
||||
user_id: Unique identifier for the user
|
||||
|
||||
Returns:
|
||||
The specialist agent's response
|
||||
"""
|
||||
session_service = InMemorySessionService()
|
||||
session = session_service.create_session(
|
||||
app_name="specialist_system",
|
||||
user_id=user_id,
|
||||
session_id=f"session_{user_id}"
|
||||
)
|
||||
runner = Runner(agent=coordinator_agent, app_name="specialist_system", session_service=session_service)
|
||||
|
||||
content = types.Content(role='user', parts=[types.Part(text=user_input)])
|
||||
events = runner.run(user_id=user_id, session_id=session.id, new_message=content)
|
||||
|
||||
for event in events:
|
||||
if event.is_final_response():
|
||||
response = event.content.parts[0].text
|
||||
|
||||
# Store the conversation in shared memory
|
||||
conversation = [
|
||||
{"role": "user", "content": user_input},
|
||||
{"role": "assistant", "content": response}
|
||||
]
|
||||
mem0.add(conversation, user_id=user_id)
|
||||
|
||||
return response
|
||||
|
||||
return "No response generated"
|
||||
|
||||
# Example usage
|
||||
response = chat_with_specialists("Plan a healthy meal for my Italy trip", user_id="alice")
|
||||
print(response)
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Quick Start Chat Interface
|
||||
|
||||
Simple interactive chat with memory and Google ADK:
|
||||
|
||||
```python
|
||||
def interactive_chat():
|
||||
"""Interactive chat interface with memory and ADK"""
|
||||
user_id = input("Enter your user ID: ") or "demo_user"
|
||||
print(f"Chat started for user: {user_id}")
|
||||
print("Type 'quit' to exit")
|
||||
print("=" * 50)
|
||||
|
||||
while True:
|
||||
user_input = input("\nYou: ")
|
||||
|
||||
if user_input.lower() == 'quit':
|
||||
print("Goodbye! Your conversation has been saved to memory.")
|
||||
break
|
||||
else:
|
||||
response = chat_with_specialists(user_input, user_id)
|
||||
print(f"Assistant: {response}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
interactive_chat()
|
||||
```
|
||||
|
||||
## Key Features
|
||||
|
||||
### 1. Memory-Enhanced Function Tools
|
||||
- **Function Tools**: Standard Python functions that can search and save memories
|
||||
- **Tool Context**: Access to session state and memory through function parameters
|
||||
- **Structured Returns**: Dictionary-based returns with status indicators for better LLM understanding
|
||||
|
||||
### 2. Multi-Agent Memory Sharing
|
||||
- **Agent-as-a-Tool**: Specialists can be called as tools while maintaining shared memory
|
||||
- **Hierarchical Delegation**: Coordinator agents route to specialists based on context
|
||||
- **Memory Categories**: Store interactions with metadata for better organization
|
||||
|
||||
### 3. Flexible Memory Operations
|
||||
- **Search Capabilities**: Retrieve relevant memories through conversation history
|
||||
- **User Segmentation**: Organize memories by user ID
|
||||
- **Memory Management**: Built-in tools for saving and retrieving information
|
||||
|
||||
## Configuration Options
|
||||
|
||||
Customize memory behavior and agent setup:
|
||||
|
||||
```python
|
||||
# Configure memory search with metadata
|
||||
memories = mem0.search(
|
||||
query="travel preferences",
|
||||
user_id="alice",
|
||||
limit=5,
|
||||
filters={"category": "travel"} # Filter by category if supported
|
||||
)
|
||||
|
||||
# Configure agent with custom model settings
|
||||
agent = Agent(
|
||||
name="custom_agent",
|
||||
model="gemini-2.0-flash", # or use LiteLLM for other models
|
||||
instruction="Custom agent behavior",
|
||||
tools=[memory_tools],
|
||||
# Additional ADK configurations
|
||||
)
|
||||
|
||||
# Use Google Cloud Vertex AI instead of AI Studio
|
||||
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
|
||||
os.environ["GOOGLE_CLOUD_PROJECT"] = "your-project-id"
|
||||
os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"
|
||||
```
|
||||
|
||||
## Help
|
||||
|
||||
- [Google ADK Documentation](https://google.github.io/adk-docs/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Keywords AI
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Build AI applications with persistent memory and comprehensive LLM observability by integrating Mem0 with Keywords AI.
|
||||
|
||||
@@ -135,8 +135,8 @@ Integrating Mem0 with Keywords AI provides a powerful combination for building A
|
||||
|
||||
## Help
|
||||
|
||||
For more information on using Mem0 and Keywords AI together, refer to:
|
||||
- [Mem0 Documentation](https://docs.mem0.ai)
|
||||
For more information, refer to:
|
||||
- [Keywords AI Documentation](https://docs.keywordsai.co)
|
||||
- [Mem0 Platform]((https://app.mem0.ai/))
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -3,7 +3,7 @@ title: Langchain Tools
|
||||
description: 'Integrate Mem0 with LangChain tools to enable AI agents to store, search, and manage memories through structured interfaces'
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Langchain
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Build a personalized Travel Agent AI using LangChain for conversation flow and Mem0 for memory retention. This integration enables context-aware and efficient travel planning experiences.
|
||||
|
||||
@@ -152,7 +152,7 @@ By integrating LangChain with Mem0, you can build a personalized Travel Agent AI
|
||||
## Help
|
||||
|
||||
- For more details on LangChain, visit the [LangChain documentation](https://python.langchain.com/).
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: LangGraph
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Build a personalized Customer Support AI Agent using LangGraph for conversation flow and Mem0 for memory retention. This integration enables context-aware and efficient support experiences.
|
||||
|
||||
@@ -140,7 +140,7 @@ By integrating LangGraph with Mem0, you can build a personalized Customer Suppor
|
||||
## Help
|
||||
|
||||
- For more details on LangGraph, visit the [LangChain documentation](https://python.langchain.com/docs/langgraph).
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Livekit
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
This guide demonstrates how to create a memory-enabled voice assistant using LiveKit, Deepgram, OpenAI, and Mem0, focusing on creating an intelligent, context-aware travel planning agent.
|
||||
|
||||
@@ -12,10 +12,7 @@ Before you begin, make sure you have:
|
||||
|
||||
1. Installed Livekit Agents SDK with voice dependencies of silero and deepgram:
|
||||
```bash
|
||||
pip install livekit-agents[voice] \
|
||||
livekit-plugins-silero \
|
||||
livekit-plugins-deepgram \
|
||||
livekit-plugins-openai
|
||||
pip install livekit-agents[silero,openai,deepgram]
|
||||
```
|
||||
|
||||
2. Installed Mem0 SDK:
|
||||
@@ -382,4 +379,12 @@ logging.basicConfig(
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
|
||||
)
|
||||
logger = logging.getLogger("memory_voice_agent")
|
||||
```
|
||||
```
|
||||
|
||||
## Help & Resources
|
||||
|
||||
- [LiveKit Documentation](https://docs.livekit.io/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- Need assistance? Reach out through:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -2,7 +2,7 @@
|
||||
title: LlamaIndex
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
@@ -63,7 +63,7 @@ context = {
|
||||
Set your Mem0 OSS by providing configuration details:
|
||||
|
||||
<Note type="info">
|
||||
To know more about Mem0 OSS, read [Mem0 OSS Quickstart](https://docs.mem0.ai/open-source/quickstart).
|
||||
To know more about Mem0 OSS, read [Mem0 OSS Quickstart](https://docs.mem0.ai/open-source/overview).
|
||||
</Note>
|
||||
|
||||
```python
|
||||
@@ -202,7 +202,7 @@ By integrating LlamaIndex with Mem0, you can build a personalized agent that can
|
||||
## Help
|
||||
|
||||
- For more details on LlamaIndex, visit the [LlamaIndex documentation](https://llamahub.ai/l/memory/llama-index-memory-mem0).
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Mastra
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
The [**Mastra**](https://mastra.ai/) integration demonstrates how to use Mastra's agent system with Mem0 as the memory backend through custom tools. This enables agents to remember and recall information across conversations.
|
||||
|
||||
@@ -130,7 +130,7 @@ By integrating Mastra with Mem0, you can build intelligent agents that learn and
|
||||
## Help
|
||||
|
||||
- For more details on Mastra, visit the [Mastra documentation](https://docs.mastra.ai/).
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -2,7 +2,7 @@
|
||||
title: MCP Server
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Integrating mem0 as an MCP Server in Cursor
|
||||
[mem0](https://github.com/mem0ai/mem0-mcp) is a powerful tool designed to enhance AI-driven workflows, particularly in code generation and contextual memory. In this guide, we'll walk through integrating mem0 as an **MCP (Model Context Protocol) server** within [Cursor](https://cursor.sh/), an AI-powered coding editor.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: MultiOn
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Build a personal browser agent that remembers user preferences and automates web tasks. It integrates Mem0 for memory management with MultiOn for executing browser actions, enabling personalized and efficient web interactions.
|
||||
|
||||
|
||||
@@ -0,0 +1,236 @@
|
||||
---
|
||||
title: OpenAI Agents SDK
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Integrate [**Mem0**](https://github.com/mem0ai/mem0) with [OpenAI Agents SDK](https://github.com/openai/openai-agents-python), a lightweight framework for building multi-agent workflows. This integration enables agents to access persistent memory across conversations, enhancing context retention and personalization.
|
||||
|
||||
## Overview
|
||||
|
||||
1. Store and retrieve memories from Mem0 within OpenAI agents
|
||||
2. Multi-agent workflows with shared memory
|
||||
3. Retrieve relevant memories for past conversations
|
||||
4. Personalized responses based on user history
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before setting up Mem0 with OpenAI Agents SDK, ensure you have:
|
||||
|
||||
1. Installed the required packages:
|
||||
```bash
|
||||
pip install openai-agents mem0ai
|
||||
```
|
||||
|
||||
2. Valid API keys:
|
||||
- [Mem0 API Key](https://app.mem0.ai/dashboard/api-keys)
|
||||
- [OpenAI API Key](https://platform.openai.com/api-keys)
|
||||
|
||||
## Basic Integration Example
|
||||
|
||||
The following example demonstrates how to create an OpenAI agent with Mem0 memory integration:
|
||||
|
||||
```python
|
||||
import os
|
||||
from agents import Agent, Runner, function_tool
|
||||
from mem0 import MemoryClient
|
||||
|
||||
# Set up environment variables
|
||||
os.environ["OPENAI_API_KEY"] = "your-openai-api-key"
|
||||
os.environ["MEM0_API_KEY"] = "your-mem0-api-key"
|
||||
|
||||
# Initialize Mem0 client
|
||||
mem0 = MemoryClient()
|
||||
|
||||
# Define memory tools for the agent
|
||||
@function_tool
|
||||
def search_memory(query: str, user_id: str) -> str:
|
||||
"""Search through past conversations and memories"""
|
||||
memories = mem0.search(query, user_id=user_id, limit=3)
|
||||
if memories:
|
||||
return "\n".join([f"- {mem['memory']}" for mem in memories])
|
||||
return "No relevant memories found."
|
||||
|
||||
@function_tool
|
||||
def save_memory(content: str, user_id: str) -> str:
|
||||
"""Save important information to memory"""
|
||||
mem0.add([{"role": "user", "content": content}], user_id=user_id)
|
||||
return "Information saved to memory."
|
||||
|
||||
# Create agent with memory capabilities
|
||||
agent = Agent(
|
||||
name="Personal Assistant",
|
||||
instructions="""You are a helpful personal assistant with memory capabilities.
|
||||
Use the search_memory tool to recall past conversations and user preferences.
|
||||
Use the save_memory tool to store important information about the user.
|
||||
Always personalize your responses based on available memory.""",
|
||||
tools=[search_memory, save_memory],
|
||||
model="gpt-4o"
|
||||
)
|
||||
|
||||
def chat_with_agent(user_input: str, user_id: str) -> str:
|
||||
"""
|
||||
Handle user input with automatic memory integration.
|
||||
|
||||
Args:
|
||||
user_input: The user's message
|
||||
user_id: Unique identifier for the user
|
||||
|
||||
Returns:
|
||||
The agent's response
|
||||
"""
|
||||
# Run the agent (it will automatically use memory tools when needed)
|
||||
result = Runner.run_sync(agent, user_input)
|
||||
|
||||
return result.final_output
|
||||
|
||||
# Example usage
|
||||
if __name__ == "__main__":
|
||||
|
||||
# preferences will be saved in memory (using save_memory tool)
|
||||
response_1 = chat_with_agent(
|
||||
"I love Italian food and I'm planning a trip to Rome next month",
|
||||
user_id="alice"
|
||||
)
|
||||
print(response_1)
|
||||
|
||||
# memory will be retrieved using search_memory tool to answer the user query
|
||||
response_2 = chat_with_agent(
|
||||
"Give me some recommendations for food",
|
||||
user_id="alice"
|
||||
)
|
||||
print(response_2)
|
||||
```
|
||||
|
||||
## Multi-Agent Workflow with Handoffs
|
||||
|
||||
Create multiple specialized agents with proper handoffs and shared memory:
|
||||
|
||||
```python
|
||||
from agents import Agent, Runner, handoffs, function_tool
|
||||
|
||||
# Specialized agents
|
||||
travel_agent = Agent(
|
||||
name="Travel Planner",
|
||||
instructions="""You are a travel planning specialist. Use get_user_context to
|
||||
understand the user's travel preferences and history before making recommendations.
|
||||
After providing your response, use store_conversation to save important details.""",
|
||||
tools=[search_memory, save_memory],
|
||||
model="gpt-4o"
|
||||
)
|
||||
|
||||
health_agent = Agent(
|
||||
name="Health Advisor",
|
||||
instructions="""You are a health and wellness advisor. Use get_user_context to
|
||||
understand the user's health goals and dietary preferences.
|
||||
After providing advice, use store_conversation to save relevant information.""",
|
||||
tools=[search_memory, save_memory],
|
||||
model="gpt-4o"
|
||||
)
|
||||
|
||||
# Triage agent with handoffs
|
||||
triage_agent = Agent(
|
||||
name="Personal Assistant",
|
||||
instructions="""You are a helpful personal assistant that routes requests to specialists.
|
||||
For travel-related questions (trips, hotels, flights, destinations), hand off to Travel Planner.
|
||||
For health-related questions (fitness, diet, wellness, exercise), hand off to Health Advisor.
|
||||
For general questions, you can handle them directly using available tools.""",
|
||||
handoffs=[travel_agent, health_agent],
|
||||
model="gpt-4o"
|
||||
)
|
||||
|
||||
def chat_with_handoffs(user_input: str, user_id: str) -> str:
|
||||
"""
|
||||
Handle user input with automatic agent handoffs and memory integration.
|
||||
|
||||
Args:
|
||||
user_input: The user's message
|
||||
user_id: Unique identifier for the user
|
||||
|
||||
Returns:
|
||||
The agent's response
|
||||
"""
|
||||
# Run the triage agent (it will automatically handoff when needed)
|
||||
result = Runner.run_sync(triage_agent, user_input)
|
||||
|
||||
# Store the original conversation in memory
|
||||
conversation = [
|
||||
{"role": "user", "content": user_input},
|
||||
{"role": "assistant", "content": result.final_output}
|
||||
]
|
||||
mem0.add(conversation, user_id=user_id)
|
||||
|
||||
return result.final_output
|
||||
|
||||
# Example usage
|
||||
response = chat_with_handoffs("Plan a healthy meal for my Italy trip", user_id="alex")
|
||||
print(response)
|
||||
```
|
||||
|
||||
## Quick Start Chat Interface
|
||||
|
||||
Simple interactive chat with memory:
|
||||
|
||||
```python
|
||||
def interactive_chat():
|
||||
"""Interactive chat interface with memory and handoffs"""
|
||||
user_id = input("Enter your user ID: ") or "demo_user"
|
||||
print(f"Chat started for user: {user_id}")
|
||||
print("Type 'quit' to exit\n")
|
||||
|
||||
while True:
|
||||
user_input = input("You: ")
|
||||
if user_input.lower() == 'quit':
|
||||
break
|
||||
|
||||
response = chat_with_handoffs(user_input, user_id)
|
||||
print(f"Assistant: {response}\n")
|
||||
|
||||
if __name__ == "__main__":
|
||||
interactive_chat()
|
||||
```
|
||||
|
||||
## Key Features
|
||||
|
||||
### 1. Automatic Memory Integration
|
||||
- **Tool-Based Memory**: Agents use function tools to search and save memories
|
||||
- **Conversation Storage**: All interactions are automatically stored
|
||||
- **Context Retrieval**: Agents can access relevant past conversations
|
||||
|
||||
### 2. Multi-Agent Memory Sharing
|
||||
- **Shared Context**: Multiple agents access the same memory store
|
||||
- **Specialized Agents**: Create domain-specific agents with shared memory
|
||||
- **Seamless Handoffs**: Agents maintain context across handoffs
|
||||
|
||||
### 3. Flexible Memory Operations
|
||||
- **Retrieve Capabilities**: Retrieve relevant memories from previous conversation
|
||||
- **User Segmentation**: Organize memories by user ID
|
||||
- **Memory Management**: Built-in tools for saving and retrieving information
|
||||
|
||||
## Configuration Options
|
||||
|
||||
Customize memory behavior:
|
||||
|
||||
```python
|
||||
# Configure memory search
|
||||
memories = mem0.search(
|
||||
query="travel preferences",
|
||||
user_id="alex",
|
||||
limit=5 # Number of memories to retrieve
|
||||
)
|
||||
|
||||
# Add metadata to memories
|
||||
mem0.add(
|
||||
messages=[{"role": "user", "content": "I prefer luxury hotels"}],
|
||||
user_id="alex",
|
||||
metadata={"category": "travel", "importance": "high"}
|
||||
)
|
||||
```
|
||||
|
||||
## Help
|
||||
|
||||
- [OpenAI Agents SDK Documentation](https://openai.github.io/openai-agents-python/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -3,7 +3,7 @@ title: 'Pipecat'
|
||||
description: 'Integrate Mem0 with Pipecat for conversational memory in AI agents'
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
# Pipecat Integration
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ title: "Raycast Extension"
|
||||
description: "Mem0 Raycast extension for intelligent memory management"
|
||||
---
|
||||
|
||||
# Mem0
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 is a self-improving memory layer for LLM applications, enabling personalized AI experiences that save costs and delight users. This extension lets you store and retrieve text snippets using Mem0's intelligent memory system. Find Mem0 in [Raycast Store](https://www.raycast.com/dev_khant/mem0) for using it.
|
||||
|
||||
## 🚀 Getting Started
|
||||
## Getting Started
|
||||
|
||||
**Get your API Key**: You'll need a Mem0 API key to use this extension:
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Vercel AI SDK
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
The [**Mem0 AI SDK Provider**](https://www.npmjs.com/package/@mem0/vercel-ai-provider) is a library developed by **Mem0** to integrate with the Vercel AI SDK. This library brings enhanced AI interaction capabilities to your applications by introducing persistent memory functionality.
|
||||
|
||||
@@ -225,6 +225,18 @@ const memories = await getMemories(prompt, { user_id: "borat", mem0ApiKey: "m0-x
|
||||
|
||||
The `getMemories` function will return an object with two keys: `results` and `relations`, if `enable_graph` is set to `true`. Otherwise, it will return an array of objects.
|
||||
|
||||
## Supported LLM Providers
|
||||
|
||||
| Provider | Configuration Value |
|
||||
|----------|-------------------|
|
||||
| OpenAI | openai |
|
||||
| Anthropic | anthropic |
|
||||
| Gemini | gemini |
|
||||
| Google | google |
|
||||
| Mistral | mistral |
|
||||
| Groq | groq |
|
||||
|
||||
> **Note**: You can use `google` as provider for Gemini (Google) models. They are same and internally they use `@ai-sdk/google` package.
|
||||
|
||||
## Key Features
|
||||
|
||||
@@ -246,8 +258,8 @@ Mem0’s Vercel AI SDK enables the creation of intelligent, context-aware applic
|
||||
|
||||
## Help
|
||||
|
||||
- For more details on Vercel AI SDK, visit the [Vercel AI SDK documentation](https://sdk.vercel.ai/docs/introduction).
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/).
|
||||
- For more details on Vercel AI SDK, visit the [Vercel AI SDK documentation](https://sdk.vercel.ai/docs/introduction)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- If you need further assistance, please feel free to reach out to us through following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -5,6 +5,8 @@ icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## AsyncMemory
|
||||
|
||||
The `AsyncMemory` class is a direct asynchronous interface to Mem0's in-process memory operations. Unlike the memory, which interacts with an API, `AsyncMemory` works directly with the underlying storage systems. This makes it ideal for applications where you want to embed Mem0 directly into your codebase.
|
||||
|
||||
@@ -5,7 +5,7 @@ icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
## Introduction to Custom Fact Extraction Prompt
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Update memory prompt is a prompt used to determine the action to be performed on the memory.
|
||||
By customizing this prompt, you can control how the memory is updated.
|
||||
|
||||
@@ -5,7 +5,7 @@ icon: "image"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data. With this feature, users can seamlessly integrate images into their interactions—allowing Mem0 to extract relevant information.
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "code"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@ icon: "server"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 provides a REST API server (written using FastAPI). Users can perform all operations through REST endpoints. The API also includes OpenAPI documentation, accessible at `/docs` when the server is running.
|
||||
|
||||
<Frame caption="APIs supported by Mem0 REST API Server">
|
||||
|
||||
@@ -5,7 +5,7 @@ icon: "list-check"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Graph Memory is a powerful feature that allows users to create and utilize complex relationships between pieces of information.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Overview
|
||||
description: 'Enhance your memory system with graph-based knowledge representation and retrieval'
|
||||
icon: "database"
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 now supports **Graph Memory**.
|
||||
With Graph Memory, users can now create and utilize complex relationships between pieces of information, allowing for more nuanced and context-aware responses.
|
||||
@@ -232,6 +232,66 @@ m = Memory.from_config(config_dict=config)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Initialize Neptune Analytics
|
||||
|
||||
Mem0 now supports Amazon Neptune Analytics as a graph store provider. This integration allows you to use Neptune Analytics for storing and querying graph-based memories.
|
||||
|
||||
#### Instance Setup
|
||||
|
||||
Create an Amazon Neptune Analytics instance in your AWS account following the [AWS documentation](https://docs.aws.amazon.com/neptune-analytics/latest/userguide/get-started.html).
|
||||
- Public connectivity is not enabled by default, and if accessing from outside a VPC, it needs to be enabled.
|
||||
- Once the Amazon Neptune Analytics instance is available, you will need the graph-identifier to connect.
|
||||
- The Neptune Analytics instance must be created using the same vector dimensions as the embedding model creates. See: https://docs.aws.amazon.com/neptune-analytics/latest/userguide/vector-index.html
|
||||
|
||||
#### Attach Credentials
|
||||
|
||||
Configure your AWS credentials with access to your Amazon Neptune Analytics resources by following the [Configuration and credentials precedence](https://docs.aws.amazon.com/cli/v1/userguide/cli-chap-configure.html#configure-precedence).
|
||||
- For example, add your SSH access key session token via environment variables:
|
||||
```bash
|
||||
export AWS_ACCESS_KEY_ID=your-access-key
|
||||
export AWS_SECRET_ACCESS_KEY=your-secret-key
|
||||
export AWS_SESSION_TOKEN=your-session-token
|
||||
export AWS_DEFAULT_REGION=your-region
|
||||
```
|
||||
- The IAM user or role making the request must have a policy attached that allows one of the following IAM actions in that neptune-graph:
|
||||
- neptune-graph:ReadDataViaQuery
|
||||
- neptune-graph:WriteDataViaQuery
|
||||
- neptune-graph:DeleteDataViaQuery
|
||||
|
||||
#### Usage
|
||||
|
||||
The Neptune memory store uses AWS LangChain Python API to connect to Neptune instances. For additional configuration options for connecting to your Amazon Neptune Analytics instance see [AWS LangChain API documentation](https://python.langchain.com/api_reference/aws/graphs/langchain_aws.graphs.neptune_graph.NeptuneAnalyticsGraph.html).
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import Memory
|
||||
|
||||
# This example must connect to a neptune-graph instance with 1536 vector dimensions specified.
|
||||
config = {
|
||||
"embedder": {
|
||||
"provider": "openai",
|
||||
"config": {"model": "text-embedding-3-large", "embedding_dims": 1536},
|
||||
},
|
||||
"graph_store": {
|
||||
"provider": "neptune",
|
||||
"config": {
|
||||
"endpoint": "neptune-graph://<GRAPH_ID>",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
m = Memory.from_config(config_dict=config)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
#### Troubleshooting
|
||||
|
||||
- For issues connecting to Amazon Neptune Analytics, please refer to the [Connecting to a graph guide](https://docs.aws.amazon.com/neptune-analytics/latest/userguide/gettingStarted-connecting.html).
|
||||
|
||||
- For issues related to authentication, refer to the [boto3 client configuration options](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html).
|
||||
|
||||
- For more details on how to connect, configure, and use the graph_memory graph store, see the [Neptune Analytics example notebook](examples/graph-db-demo/neptune-analytics-example.ipynb).
|
||||
|
||||
## Graph Operations
|
||||
The Mem0's graph supports the following operations:
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ icon: "image"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data, including images. Users can seamlessly integrate images into their interactions, allowing Mem0 to extract pertinent information from visual content and enrich the memory system.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Node SDK
|
||||
title: Node SDK Quickstart
|
||||
description: 'Get started with Mem0 quickly!'
|
||||
icon: "node"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
> Welcome to the Mem0 quickstart guide. This guide will help you get up and running with Mem0 in no time.
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
icon: "eye"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
Welcome to Mem0 Open Source - a powerful, self-hosted memory management solution for AI agents and assistants. With Mem0 OSS, you get full control over your infrastructure while maintaining complete customization flexibility.
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
title: Python SDK
|
||||
title: Python SDK Quickstart
|
||||
description: 'Get started with Mem0 quickly!'
|
||||
icon: "python"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
> Welcome to the Mem0 quickstart guide. This guide will help you get up and running with Mem0 in no time.
|
||||
|
||||
@@ -513,7 +513,7 @@ chat_completion = client.chat.completions.create(
|
||||
|
||||
## APIs
|
||||
|
||||
Get started with using Mem0 APIs in your applications. For more details, refer to the [Platform](/platform/quickstart.mdx).
|
||||
Get started with using Mem0 APIs in your applications. For more details, refer to the [Platform](../platform/quickstart).
|
||||
|
||||
Here is an example of how to use Mem0 APIs:
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user