Update Docs (#3520)
This commit is contained in:
@@ -31,10 +31,10 @@ All API requests require authentication using HTTP Basic Auth. Ensure you includ
|
||||
|
||||
Organizations and projects provide the following capabilities:
|
||||
|
||||
- **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately
|
||||
- **Member Management**: Control access to data through organization and project membership
|
||||
- **Access Control**: Only members can access memories and data within their organization/project scope
|
||||
- **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration
|
||||
- **Multi-org/project Support**: Specify organization and project when initializing the Mem0 client to attribute API usage appropriately.
|
||||
- **Member Management**: Control access to data through organization and project membership.
|
||||
- **Access Control**: Only members can access memories and data within their organization/project scope.
|
||||
- **Team Isolation**: Maintain data separation between different teams and projects for secure collaboration.
|
||||
|
||||
Example with the mem0 Python package:
|
||||
|
||||
@@ -157,8 +157,8 @@ client.project.remove_member(email="colleague@company.com")
|
||||
|
||||
#### Member Roles
|
||||
|
||||
- **READER**: Can view and search memories, but cannot modify project settings or manage members
|
||||
- **OWNER**: Full access including project modification, member management, and all reader permissions
|
||||
- **READER**: Can view and search memories, but cannot modify project settings or manage members.
|
||||
- **OWNER**: Full access including project modification, member management, and all reader permissions.
|
||||
|
||||
#### Async Support
|
||||
|
||||
|
||||
@@ -3,4 +3,4 @@ title: 'Create Memory Export'
|
||||
openapi: post /v1/exports/
|
||||
---
|
||||
|
||||
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you’re exporting a large number of memories. You can tailor the export by applying various filters (e.g., user_id, agent_id, run_id, or session_id) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
|
||||
Submit a job to create a structured export of memories using a customizable Pydantic schema. This process may take some time to complete, especially if you're exporting a large number of memories. You can tailor the export by applying various filters (e.g., `user_id`, `agent_id`, `run_id`, or `session_id`) and by modifying the Pydantic schema to ensure the final data matches your exact needs.
|
||||
|
||||
@@ -13,96 +13,96 @@ The v2 search API is powerful and flexible, allowing for more precise memory ret
|
||||
- `icontains`: Case-insensitive containment check
|
||||
- `*`: Wildcard character that matches everything
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
related_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"OR": [
|
||||
{
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
related_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"OR": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"agent_id": {"in": ["travel-agent", "sports-agent"]}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"memories": [
|
||||
{
|
||||
"id": "ea925981-272f-40dd-b576-be64e4871429",
|
||||
"memory": "Likes to play cricket and plays cricket on weekends.",
|
||||
"metadata": {
|
||||
"category": "hobbies"
|
||||
},
|
||||
"score": 0.32116443111457704,
|
||||
"created_at": "2024-07-26T10:29:36.630547-07:00",
|
||||
"updated_at": null,
|
||||
"user_id": "alice",
|
||||
"agent_id": "sports-agent"
|
||||
}
|
||||
],
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to match all run_ids for a specific user
|
||||
all_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"agent_id": {"in": ["travel-agent", "sports-agent"]}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
```json Output
|
||||
{
|
||||
"memories": [
|
||||
{
|
||||
"id": "ea925981-272f-40dd-b576-be64e4871429",
|
||||
"memory": "Likes to play cricket and plays cricket on weekends.",
|
||||
"metadata": {
|
||||
"category": "hobbies"
|
||||
},
|
||||
"score": 0.32116443111457704,
|
||||
"created_at": "2024-07-26T10:29:36.630547-07:00",
|
||||
"updated_at": null,
|
||||
"user_id": "alice",
|
||||
"agent_id": "sports-agent"
|
||||
}
|
||||
],
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
<CodeGroup>
|
||||
```python Categories Filter Examples
|
||||
# Example 1: Using 'contains' for partial matching
|
||||
finance_memories = m.search(
|
||||
query="What are my financial goals?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"contains": "finance"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to match all run_ids for a specific user
|
||||
all_memories = m.search(
|
||||
query="What are Alice's hobbies?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Categories Filter Examples
|
||||
# Example 1: Using 'contains' for partial matching
|
||||
finance_memories = m.search(
|
||||
query="What are my financial goals?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"contains": "finance"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
|
||||
# Example 2: Using 'in' for exact matching
|
||||
personal_memories = m.search(
|
||||
query="What personal information do you have?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"in": ["personal_information"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
# Example 2: Using 'in' for exact matching
|
||||
personal_memories = m.search(
|
||||
query="What personal information do you have?",
|
||||
version="v2",
|
||||
filters={
|
||||
"AND": [
|
||||
{ "user_id": "alice" },
|
||||
{
|
||||
"categories": {
|
||||
"in": ["personal_information"]
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
@@ -3,7 +3,3 @@ title: 'Create Webhook'
|
||||
openapi: post /api/v1/webhooks/projects/{project_id}/
|
||||
---
|
||||
|
||||
## Create Webhook
|
||||
|
||||
Create a webhook by providing the project ID and the webhook details.
|
||||
|
||||
|
||||
@@ -2,7 +2,3 @@
|
||||
title: 'Delete Webhook'
|
||||
openapi: delete /api/v1/webhooks/{webhook_id}/
|
||||
---
|
||||
|
||||
## Delete Webhook
|
||||
|
||||
Delete a webhook by providing the webhook ID.
|
||||
|
||||
@@ -3,7 +3,3 @@ title: 'Get Webhook'
|
||||
openapi: get /api/v1/webhooks/projects/{project_id}/
|
||||
---
|
||||
|
||||
## Get Webhook
|
||||
|
||||
Get a webhook by providing the project ID.
|
||||
|
||||
|
||||
@@ -3,7 +3,3 @@ title: 'Update Webhook'
|
||||
openapi: put /api/v1/webhooks/{webhook_id}/
|
||||
---
|
||||
|
||||
## Update Webhook
|
||||
|
||||
Update a webhook by providing the webhook ID and the fields to update.
|
||||
|
||||
|
||||
+3
-3
@@ -673,17 +673,17 @@ mode: "wide"
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-24" description="v2.1.33">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Added `immutable` param to `add` method.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-20" description="v2.1.32">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Made `api_version` V2 as default.
|
||||
</Update>
|
||||
|
||||
<Update label="2025-06-17" description="v2.1.31">
|
||||
**Improvement :**
|
||||
**Improvement:**
|
||||
- **Client:** Added param `filter_memories`.
|
||||
</Update>
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ config = {
|
||||
"embedder": {
|
||||
"provider": "azure_openai",
|
||||
"config": {
|
||||
"model": "text-embedding-3-large"
|
||||
"model": "text-embedding-3-large",
|
||||
"azure_kwargs": {
|
||||
"api_version": "",
|
||||
"azure_deployment": "",
|
||||
@@ -40,7 +40,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -68,7 +68,7 @@ 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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -26,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -50,7 +50,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -24,7 +24,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -36,7 +36,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -66,7 +66,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -20,7 +20,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -29,10 +29,10 @@ m.add(messages, user_id="john")
|
||||
|
||||
### Config
|
||||
|
||||
Here are the parameters available for configuring Ollama embedder:
|
||||
Here are the parameters available for configuring LM Studio embedder:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
| `model` | The name of the OpenAI model to use | `nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.f16.gguf` |
|
||||
| `model` | The name of the LM Studio model to use | `nomic-embed-text-v1.5-GGUF/nomic-embed-text-v1.5.f16.gguf` |
|
||||
| `embedding_dims` | Dimensions of the embedding model | `1536` |
|
||||
| `lmstudio_base_url` | Base URL for LM Studio connection | `http://localhost:1234/v1` |
|
||||
@@ -21,7 +21,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -44,7 +44,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -25,7 +25,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -27,7 +27,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -27,7 +27,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -29,6 +29,6 @@ See the list of supported embedders below.
|
||||
|
||||
## Usage
|
||||
|
||||
To utilize a embedder, you must provide a configuration to customize its usage. If no configuration is supplied, a default configuration will be applied, and `OpenAI` will be used as the embedder.
|
||||
To utilize an embedding model, you must provide a configuration to customize its usage. If no configuration is supplied, a default configuration will be applied, and `OpenAI` will be used as the embedding model.
|
||||
|
||||
For a comprehensive list of available parameters for embedder configuration, please refer to [Config](./config).
|
||||
For a comprehensive list of available parameters for embedding model configuration, please refer to [Config](./config).
|
||||
|
||||
@@ -29,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -54,7 +54,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -31,7 +31,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -77,7 +77,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -28,7 +28,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -30,7 +30,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -55,7 +55,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -38,7 +38,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -69,7 +69,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -22,7 +22,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -29,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -57,7 +57,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -28,7 +28,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -53,7 +53,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
You can use LLMs from Ollama to run Mem0 locally. These [models](https://ollama.com/search?c=tools) support tool support.
|
||||
---
|
||||
title: Ollama
|
||||
---
|
||||
|
||||
You can use LLMs from Ollama to run Mem0 locally. These [models](https://ollama.com/search?c=tools) support tool calling.
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -23,7 +27,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -47,7 +51,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -40,7 +40,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -65,7 +65,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -28,7 +28,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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).
|
||||
---
|
||||
title: Together
|
||||
---
|
||||
|
||||
To use Together LLM models, you have to set the `TOGETHER_API_KEY` environment variable. You can obtain the Together API key from their [Account settings page](https://api.together.xyz/settings/api-keys).
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -23,7 +27,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -32,4 +36,4 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
## Config
|
||||
|
||||
All available parameters for the `togetherai` config are present in [Master List of All Params in Config](../config).
|
||||
All available parameters for the `together` config are present in [Master List of All Params in Config](../config).
|
||||
@@ -29,7 +29,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -27,7 +27,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -108,12 +108,12 @@ To enable Role-Based Access Control (RBAC) for Azure AI Search, follow these ste
|
||||
6. **Choose Role:**
|
||||
- Mem0 requires the **Search Index Data Contributor** and **Search Service Contributor** role.
|
||||
7. **Choose Member**
|
||||
- To assign to a User, Group, Service Principle or Managed Identity:
|
||||
- To assign to a User, Group, Service Principal or Managed Identity:
|
||||
- For production it is recommended to use a service principal or managed identity.
|
||||
- For a service principal: select **User, group, or service principal** and search for the service principal.
|
||||
- For a managed identity: select **Managed identity** and choose the managed identity.
|
||||
- For development, you can assign the role to a user account.
|
||||
- For development: select ***User, group, or service principal** and pick a Azure Entra ID account (the same used with `az login`).
|
||||
- For development: select **User, group, or service principal** and pick an Azure Entra ID account (the same used with `az login`).
|
||||
8. **Complete the Assignment:**
|
||||
- Click **Review + Assign**.
|
||||
|
||||
@@ -133,7 +133,7 @@ config = {
|
||||
}
|
||||
```
|
||||
|
||||
### Environment Variables to set to use Azure Identity Credential:
|
||||
### Environment Variables to Use Azure Identity Credential
|
||||
* For an Environment Credential, you will need to setup a Service Principal and set the following environment variables:
|
||||
- `AZURE_TENANT_ID`: Your Azure Active Directory tenant ID.
|
||||
- `AZURE_CLIENT_ID`: The client ID of your service principal or managed identity.
|
||||
@@ -142,7 +142,7 @@ config = {
|
||||
- `AZURE_CLIENT_ID`: The client ID of the user-assigned managed identity.
|
||||
* For a System-Assigned Managed Identity, no additional environment variables are needed.
|
||||
|
||||
### Developer logins to use for a Azure Identity Credential:
|
||||
### Developer Logins for Azure Identity Credential
|
||||
* For an Azure CLI Credential, you need to have the Azure CLI installed and logged in with `az login`.
|
||||
* For an Azure PowerShell Credential, you need to have the Azure PowerShell module installed and logged in with `Connect-AzAccount`.
|
||||
* For an Azure Developer CLI Credential, you need to have the Azure Developer CLI installed and logged in with `azd auth login`.
|
||||
|
||||
@@ -37,7 +37,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
### Config
|
||||
|
||||
Here are the available parameters for the `mochow` config:
|
||||
Here are the parameters available for configuring Baidu VectorDB:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
|
||||
@@ -26,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -31,7 +31,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -40,7 +40,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
### Config
|
||||
|
||||
Let's see the available parameters for the `elasticsearch` config:
|
||||
Here are the parameters available for configuring Elasticsearch:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| ---------------------- | -------------------------------------------------- | ------------- |
|
||||
|
||||
@@ -22,7 +22,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -38,7 +38,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -64,12 +64,12 @@ 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 a thriller movies? They can be quite engaging." },
|
||||
{ role: "assistant", content: "How about 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." }
|
||||
]
|
||||
|
||||
memory.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
await memory.add(messages, { userId: "alice", metadata: { category: "movies" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[Milvus](https://milvus.io/) Milvus is an open-source vector database that suits AI applications of every size from running a demo chatbot in Jupyter notebook to building web-scale search that serves billions of users.
|
||||
[Milvus](https://milvus.io/) is an open-source vector database that suits AI applications of every size, from running a demo chatbot in a Jupyter notebook to building web-scale search that serves billions of users.
|
||||
|
||||
### Usage
|
||||
|
||||
@@ -22,7 +22,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -31,7 +31,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
### Config
|
||||
|
||||
Here's the parameters available for configuring Milvus Database:
|
||||
Here are the parameters available for configuring Milvus:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
|
||||
@@ -24,7 +24,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -40,6 +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` |
|
||||
| mongo_uri | The mongo URI connection string | mongodb://username:password@localhost:27017 |
|
||||
| mongo_uri | The MongoDB URI connection string | `mongodb://username:password@localhost:27017` |
|
||||
|
||||
> **Note**: If Mongo_uri is not provided it will default to mongodb://username:password@localhost:27017.
|
||||
> **Note**: If `mongo_uri` is not provided, it will default to `mongodb://username:password@localhost:27017`.
|
||||
|
||||
@@ -58,7 +58,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -74,8 +74,8 @@ results = m.search("What kind of movies does Alice like?", user_id="alice")
|
||||
### Features
|
||||
|
||||
- Fast and Efficient Vector Search
|
||||
- Can be deployed on-premises, in containers, or on cloud platforms like AWS OpenSearch Service.
|
||||
- Multiple Authentication and Security Methods (Basic Authentication, API Keys, LDAP, SAML, and OpenID Connect)
|
||||
- Can be deployed on-premises, in containers, or on cloud platforms like AWS OpenSearch Service
|
||||
- Multiple authentication and security methods (Basic Authentication, API Keys, LDAP, SAML, and OpenID Connect)
|
||||
- Automatic index creation with optimized mappings for vector search
|
||||
- Memory Optimization through Disk-Based Vector Search and Quantization
|
||||
- Real-Time Analytics and Observability
|
||||
- Memory optimization through disk-based vector search and quantization
|
||||
- Real-time analytics and observability
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[pgvector](https://github.com/pgvector/pgvector) is open-source vector similarity search for Postgres. After connecting with postgres run `CREATE EXTENSION IF NOT EXISTS vector;` to create the vector extension.
|
||||
[pgvector](https://github.com/pgvector/pgvector) is an open-source vector similarity search extension for Postgres. After connecting to Postgres, run `CREATE EXTENSION IF NOT EXISTS vector;` to create the vector extension.
|
||||
|
||||
### Usage
|
||||
|
||||
@@ -24,7 +24,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -54,7 +54,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -64,7 +64,7 @@ await memory.add(messages, { userId: "alice", metadata: { category: "movies" } }
|
||||
|
||||
### Config
|
||||
|
||||
Here's the parameters available for configuring pgvector:
|
||||
Here are the parameters available for configuring pgvector:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
|
||||
@@ -33,7 +33,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -23,7 +23,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -48,7 +48,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -34,7 +34,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -60,7 +60,7 @@ const config = {
|
||||
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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
### Config
|
||||
|
||||
Here are the available parameters for the `s3_vectors` config:
|
||||
Here are the parameters available for configuring Amazon S3 Vectors:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| ---------------------- | -------------------------------------------------------------------------------- | ------------------------------------- |
|
||||
|
||||
@@ -26,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -53,7 +53,7 @@ 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 a thriller movies? They can be quite engaging."},
|
||||
{"role": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -109,7 +109,7 @@ end;
|
||||
$$;
|
||||
```
|
||||
|
||||
Goto [Supabase](https://supabase.com/dashboard/projects) and run the above SQL migrations inside the SQL Editor.
|
||||
Go to [Supabase](https://supabase.com/dashboard/projects) and run the above SQL migrations in the SQL Editor.
|
||||
|
||||
### Config
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ config = {
|
||||
m = Memory.from_config(config)
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -35,7 +35,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
## Parameters
|
||||
|
||||
Let's see the available parameters for the `valkey` config:
|
||||
Here are the parameters available for configuring Valkey:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
|
||||
@@ -31,7 +31,7 @@ await memory.add(messages, { userId: "bob", metadata: { interest: "books" } });
|
||||
|
||||
### Config
|
||||
|
||||
Let's see the available parameters for the `vectorize` config:
|
||||
Here are the parameters available for configuring Vectorize:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="TypeScript">
|
||||
|
||||
@@ -37,7 +37,7 @@ m.add(messages, user_id="alice", metadata={"category": "movies"})
|
||||
|
||||
### Config
|
||||
|
||||
Let's see the available parameters for the `weaviate` config:
|
||||
Here are the parameters available for configuring Weaviate:
|
||||
|
||||
| Parameter | Description | Default Value |
|
||||
| --- | --- | --- |
|
||||
|
||||
@@ -17,7 +17,7 @@ See the list of supported vector databases below.
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Qdrant" href="/components/vectordbs/dbs/qdrant"></Card>
|
||||
<Card title="Chroma" href="/components/vectordbs/dbs/chroma"></Card>
|
||||
<Card title="Pgvector" href="/components/vectordbs/dbs/pgvector"></Card>
|
||||
<Card title="PGVector" href="/components/vectordbs/dbs/pgvector"></Card>
|
||||
<Card title="Upstash Vector" href="/components/vectordbs/dbs/upstash-vector"></Card>
|
||||
<Card title="Milvus" href="/components/vectordbs/dbs/milvus"></Card>
|
||||
<Card title="Pinecone" href="/components/vectordbs/dbs/pinecone"></Card>
|
||||
@@ -44,12 +44,11 @@ For a comprehensive list of available parameters for vector database configurati
|
||||
|
||||
## Common issues
|
||||
|
||||
### Using model with different dimensions
|
||||
### Using Model with Different Dimensions
|
||||
|
||||
If you are using customized model, which is having different dimensions other than 1536
|
||||
for example 768, you may encounter below error:
|
||||
If you are using a customized model with different dimensions other than 1536 (for example, 768), you may encounter the following error:
|
||||
|
||||
`ValueError: shapes (0,1536) and (768,) not aligned: 1536 (dim 1) != 768 (dim 0)`
|
||||
|
||||
you could add `"embedding_model_dims": 768,` to the config of the vector_store to overcome this issue.
|
||||
You can add `"embedding_model_dims": 768,` to the config of the vector_store to resolve this issue.
|
||||
|
||||
|
||||
@@ -19,25 +19,25 @@ To contribute, follow these steps:
|
||||
4. **Code Quality Checks**:
|
||||
- Run **linting** to catch style issues
|
||||
- Ensure **all tests pass**
|
||||
5. **Submit a Pull Request** 🚀
|
||||
5. **Submit a Pull Request**
|
||||
|
||||
For detailed guidance on pull requests, refer to [GitHub's documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
|
||||
|
||||
---
|
||||
|
||||
## 📦 Dependency Management
|
||||
## Dependency Management
|
||||
|
||||
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, follow these steps in order:
|
||||
**Do NOT use `pip` or `conda` for dependency management.** Instead, follow these steps in order:
|
||||
|
||||
```bash
|
||||
# 1. Install base dependencies
|
||||
make install
|
||||
|
||||
# 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)
|
||||
# 2. Activate virtual environment (this will install dependencies)
|
||||
hatch shell # For default environment
|
||||
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
|
||||
@@ -45,9 +45,9 @@ make install_all
|
||||
|
||||
---
|
||||
|
||||
## 🛠️ Development Standards
|
||||
## Development Standards
|
||||
|
||||
### ✅ Pre-commit Hooks
|
||||
### Pre-commit Hooks
|
||||
|
||||
Ensure `pre-commit` is installed before contributing:
|
||||
|
||||
@@ -55,7 +55,7 @@ Ensure `pre-commit` is installed before contributing:
|
||||
pre-commit install
|
||||
```
|
||||
|
||||
### 🔍 Linting with `ruff`
|
||||
### Linting with `ruff`
|
||||
|
||||
Run the linter and fix any reported issues before submitting your PR:
|
||||
|
||||
@@ -63,7 +63,7 @@ Run the linter and fix any reported issues before submitting your PR:
|
||||
make lint
|
||||
```
|
||||
|
||||
### 🎨 Code Formatting
|
||||
### Code Formatting
|
||||
|
||||
To maintain a consistent code style, format your code:
|
||||
|
||||
@@ -71,7 +71,7 @@ To maintain a consistent code style, format your code:
|
||||
make format
|
||||
```
|
||||
|
||||
### 🧪 Testing with `pytest`
|
||||
### Testing with `pytest`
|
||||
|
||||
Run tests to verify functionality before submitting your PR:
|
||||
|
||||
@@ -79,14 +79,14 @@ Run tests to verify functionality before submitting your PR:
|
||||
make test
|
||||
```
|
||||
|
||||
💡 **Note:** Some dependencies have been removed from the main dependencies to reduce package size. Run `make install_all` to install necessary dependencies before running tests.
|
||||
**Note:** Some dependencies have been removed from the main dependencies to reduce package size. Run `make install_all` to install necessary dependencies before running tests.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Release Process
|
||||
## Release Process
|
||||
|
||||
Currently, releases are handled manually. We aim for frequent releases, typically when new features or bug fixes are introduced.
|
||||
|
||||
---
|
||||
|
||||
Thank you for contributing to Mem0! 🎉
|
||||
Thank you for contributing to Mem0!
|
||||
@@ -5,13 +5,13 @@ icon: "book"
|
||||
|
||||
# Documentation Contributions
|
||||
|
||||
## 📌 Prerequisites
|
||||
## Prerequisites
|
||||
|
||||
Before getting started, ensure you have **Node.js (version 23.6.0 or higher)** installed on your system.
|
||||
|
||||
---
|
||||
|
||||
## 🚀 Setting Up Mintlify
|
||||
## Setting Up Mintlify
|
||||
|
||||
### Step 1: Install Mintlify
|
||||
|
||||
@@ -41,7 +41,7 @@ The documentation website will be available at: [http://localhost:3000](http://l
|
||||
|
||||
---
|
||||
|
||||
## 🔧 Custom Ports
|
||||
## Custom Ports
|
||||
|
||||
By default, Mintlify runs on **port 3000**. To use a different port, add the `--port` flag:
|
||||
|
||||
@@ -51,5 +51,5 @@ mintlify dev --port 3333
|
||||
|
||||
---
|
||||
|
||||
By following these steps, you can efficiently contribute to **Mem0's documentation**. Happy documenting! ✍️
|
||||
By following these steps, you can efficiently contribute to Mem0's documentation.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ iconType: "solid"
|
||||
|
||||
## 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.
|
||||
The `add` operation stores 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.
|
||||
|
||||
@@ -17,7 +17,7 @@ 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.
|
||||
Each supports the same core memory operations, but with slightly different setup.
|
||||
|
||||
|
||||
## Architecture
|
||||
@@ -37,7 +37,7 @@ When you call `add`, Mem0 performs the following steps under the hood:
|
||||
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.
|
||||
You don't need to handle any of this manually - Mem0 takes care of it with a single API call or SDK method.
|
||||
|
||||
---
|
||||
|
||||
@@ -94,7 +94,7 @@ 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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
|
||||
@@ -13,7 +13,7 @@ Memories can become outdated, irrelevant, or need to be removed for privacy or c
|
||||
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.
|
||||
This page walks through code examples for each method.
|
||||
|
||||
|
||||
## Use Cases
|
||||
@@ -109,6 +109,7 @@ client.deleteAll({ user_id: "alice" })
|
||||
</CodeGroup>
|
||||
|
||||
You can also filter by other parameters such as:
|
||||
|
||||
- `agent_id`
|
||||
- `run_id`
|
||||
- `metadata` (as JSON string)
|
||||
@@ -133,8 +134,6 @@ For request/response schema and additional filtering options, see:
|
||||
|
||||
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:
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ This applies to both:
|
||||
<img src="../../images/search_architecture.png" />
|
||||
</Frame>
|
||||
|
||||
The search flow follows these steps:
|
||||
When you call `search`, Mem0 performs the following steps:
|
||||
|
||||
1. **Query Processing**
|
||||
An LLM refines and optimizes your natural language query.
|
||||
@@ -105,7 +105,7 @@ const relatedMemories = memory.search("Should I drink coffee or tea?", { userId:
|
||||
## Tips for Better Search
|
||||
|
||||
- Use descriptive natural queries (Mem0 can interpret intent)
|
||||
- Apply filters for scoped, faster lookup
|
||||
- Apply filters for scoped, faster lookups
|
||||
- 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
|
||||
@@ -116,8 +116,6 @@ const relatedMemories = memory.search("Should I drink coffee or tea?", { userId:
|
||||
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:
|
||||
|
||||
|
||||
@@ -7,21 +7,21 @@ iconType: "solid"
|
||||
|
||||
## 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.
|
||||
User preferences, interests, and behaviors often evolve over time. The `update` operation lets you revise a stored memory, whether it's updating facts, 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**
|
||||
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.”
|
||||
- Evolve factual knowledge as the user's profile changes
|
||||
- Handle profile evolution: "I love spicy food" → later says "Actually, I can't handle spicy food"
|
||||
|
||||
Updating memory ensures your agents remain accurate, adaptive, and personalized.
|
||||
|
||||
@@ -99,18 +99,16 @@ client.batchUpdate(updateMemories)
|
||||
|
||||
## 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.
|
||||
- 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:
|
||||
|
||||
|
||||
@@ -42,6 +42,7 @@ Each memory type has distinct characteristics:
|
||||
| Long-Term | Persistent | Fast | User preferences and history |
|
||||
|
||||
## How Mem0 Implements Long-Term Memory
|
||||
|
||||
Mem0's long-term memory system builds on these foundations by:
|
||||
|
||||
1. Using vector embeddings to store and retrieve semantic information
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: AI Companion in Node.js
|
||||
---
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ This sets up Mem0 with:
|
||||
- [AWS Bedrock for LLM](https://docs.mem0.ai/components/llms/models/aws_bedrock)
|
||||
- [AWS Bedrock for embeddings](https://docs.mem0.ai/components/embedders/models/aws_bedrock#aws-bedrock)
|
||||
- [OpenSearch as the vector store](https://docs.mem0.ai/components/vectordbs/dbs/opensearch)
|
||||
- [Neptune Analytics as your graph store](https://docs.mem0.ai/open-source/graph_memory/overview#initialize-neptune-analytics).
|
||||
- [Neptune Analytics as your graph store](https://docs.mem0.ai/open-source/graph_memory/overview#initialize-neptune-analytics)
|
||||
|
||||
```python
|
||||
import boto3
|
||||
@@ -93,12 +93,12 @@ m = Memory.from_config(config)
|
||||
|
||||
Reference [Notebook example](https://github.com/mem0ai/mem0/blob/main/examples/graph-db-demo/neptune-example.ipynb)
|
||||
|
||||
#### Add a memory:
|
||||
### Add a memory
|
||||
|
||||
```python
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -107,24 +107,24 @@ messages = [
|
||||
result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"})
|
||||
```
|
||||
|
||||
#### Search a memory:
|
||||
### Search a memory
|
||||
|
||||
```python
|
||||
relevant_memories = m.search(query, user_id="alice")
|
||||
```
|
||||
|
||||
#### Get all memories:
|
||||
### Get all memories
|
||||
|
||||
```python
|
||||
all_memories = m.get_all(user_id="alice")
|
||||
```
|
||||
|
||||
#### Get a specific memory:
|
||||
### Get a specific memory
|
||||
|
||||
```python
|
||||
memory = m.get(memory_id)
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
## Conclusion
|
||||
|
||||
With Mem0 and AWS services like Bedrock, OpenSearch, and Neptune Analytics, you can build intelligent AI companions that remember, adapt, and personalize their responses over time. This makes them ideal for long-term assistants, tutors, or support bots with persistent memory and natural conversation abilities.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# Mem0 Chrome Extension
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
<Note>
|
||||
🎉 We now support Grok! The Mem0 Chrome Extension has been updated to work with Grok, bringing the same powerful memory capabilities to your Grok conversations.
|
||||
We now support Grok! The Mem0 Chrome Extension has been updated to work with Grok, bringing the same powerful memory capabilities to your Grok conversations.
|
||||
</Note>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ You can install the Mem0 Chrome Extension using one of the following methods:
|
||||
## Configuration
|
||||
|
||||
- **API Key**: Obtain your API key from the Mem0 Dashboard to connect the extension to the Mem0 API.
|
||||
- **User ID**: This is your unique identifier in the Mem0 system. If not provided, it defaults to 'chrome-extension-user'.
|
||||
- **User ID**: This is your unique identifier in the Mem0 system. If not provided, it defaults to `chrome-extension-user`.
|
||||
|
||||
## Demo Video
|
||||
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
title: Eliza OS Character
|
||||
---
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Overview
|
||||
|
||||
ElizaOS is a powerful AI agent framework for autonomy & personality. It is a collection of tools that help you create a personalised AI agent.
|
||||
ElizaOS is a powerful AI agent framework for autonomy and personality. It is a collection of tools that help you create a personalized AI agent.
|
||||
|
||||
## Setup
|
||||
|
||||
You can start by cloning the eliza-os repository:
|
||||
|
||||
```bash
|
||||
@@ -35,14 +36,14 @@ pnpm build
|
||||
|
||||
## Setup ENVs
|
||||
|
||||
Create a `.env` file in the root of the project and add the following ( You can use the `.env.example` file as a reference):
|
||||
Create a `.env` file in the root of the project and add the following (you can use the `.env.example` file as a reference):
|
||||
|
||||
```bash
|
||||
# Mem0 Configuration
|
||||
MEM0_API_KEY= # Mem0 API Key ( Get from https://app.mem0.ai/dashboard/api-keys )
|
||||
MEM0_API_KEY= # Mem0 API Key (get from https://app.mem0.ai/dashboard/api-keys)
|
||||
MEM0_USER_ID= # Default: eliza-os-user
|
||||
MEM0_PROVIDER= # Default: openai
|
||||
MEM0_PROVIDER_API_KEY= # API Key for the provider (openai, anthropic, etc.)
|
||||
MEM0_PROVIDER_API_KEY= # API Key for the provider (OpenAI, Anthropic, etc.)
|
||||
SMALL_MEM0_MODEL= # Default: gpt-4o-mini
|
||||
MEDIUM_MEM0_MODEL= # Default: gpt-4o
|
||||
LARGE_MEM0_MODEL= # Default: gpt-4o
|
||||
@@ -50,7 +51,7 @@ LARGE_MEM0_MODEL= # Default: gpt-4o
|
||||
|
||||
## Make the default character use Mem0
|
||||
|
||||
By default, there is a character called `eliza` that uses the `ollama` model. You can make this character use Mem0 by changing the config in the `agent/src/defaultCharacter.ts` file.
|
||||
By default, there is a character called `eliza` that uses the Ollama model. You can make this character use Mem0 by changing the config in the `agent/src/defaultCharacter.ts` file.
|
||||
|
||||
```ts
|
||||
modelProvider: ModelProviderName.MEM0,
|
||||
@@ -66,8 +67,6 @@ pnpm start
|
||||
|
||||
## Conclusion
|
||||
|
||||
You have now created a personalised Eliza OS Character using Mem0. You can now start interacting with the character by running the project and talking to the character.
|
||||
|
||||
This is a simple example of how to use Mem0 to create a personalised AI agent. You can use this as a starting point to create your own AI agent.
|
||||
|
||||
You have now created a personalized Eliza OS Character using Mem0. You can now start interacting with the character by running the project and talking to the character.
|
||||
|
||||
This is a simple example of how to use Mem0 to create a personalized AI agent. You can use this as a starting point to create your own AI agent.
|
||||
|
||||
@@ -180,5 +180,5 @@ print(f"Found {len(meeting_emails['results'])} relevant emails")
|
||||
|
||||
## Conclusion
|
||||
|
||||
By combining Mem0's memory capabilities with email processing, you can create intelligent email management systems that help users organize, prioritize, and act on their inbox effectively. The advanced capabilities like automatic categorization, action item extraction, and priority management can significantly reduce the time spent on email management, allowing users to focus on more important tasks.
|
||||
By combining Mem0's memory capabilities with email processing, you can create intelligent email management systems that help users organize, prioritize, and act on their inbox effectively. Advanced capabilities like automatic categorization, action item extraction, and priority management can significantly reduce the time spent on email management, allowing users to focus on more important tasks.
|
||||
|
||||
|
||||
@@ -4,10 +4,12 @@ title: LlamaIndex ReAct Agent
|
||||
|
||||
Create a ReAct Agent with LlamaIndex which uses Mem0 as the memory store.
|
||||
|
||||
### Overview
|
||||
## Overview
|
||||
|
||||
A ReAct agent combines reasoning and action capabilities, making it versatile for tasks requiring both thought processes (reasoning) and interaction with tools or APIs (acting). Mem0 as memory enhances these capabilities by allowing the agent to store and retrieve contextual information from past interactions.
|
||||
|
||||
### Setup
|
||||
## Setup
|
||||
|
||||
```bash
|
||||
pip install llama-index-core llama-index-memory-mem0
|
||||
```
|
||||
@@ -67,6 +69,7 @@ order_food_tool = FunctionTool.from_defaults(fn=order_food)
|
||||
```
|
||||
|
||||
Initialize the agent with tools and memory.
|
||||
|
||||
```python
|
||||
from llama_index.core.agent import FunctionCallingAgent
|
||||
|
||||
@@ -79,14 +82,16 @@ agent = FunctionCallingAgent.from_tools(
|
||||
```
|
||||
|
||||
Start the chat.
|
||||
<Note> The agent will use the Mem0 to store the relevant memories from the chat. </Note>
|
||||
|
||||
Input
|
||||
<Note>The agent will use Mem0 to store the relevant memories from the chat.</Note>
|
||||
|
||||
**Input**
|
||||
```python
|
||||
response = agent.chat("Hi, My name is David")
|
||||
print(response)
|
||||
```
|
||||
Output
|
||||
|
||||
**Output**
|
||||
```text
|
||||
> Running step bf44a75a-a920-4cf3-944e-b6e6b5695043. Step input: Hi, My name is David
|
||||
Added user message to memory: Hi, My name is David
|
||||
@@ -94,24 +99,27 @@ Added user message to memory: Hi, My name is David
|
||||
Hello, David! How can I assist you today?
|
||||
```
|
||||
|
||||
Input
|
||||
**Input**
|
||||
```python
|
||||
response = agent.chat("I love to eat pizza on weekends")
|
||||
print(response)
|
||||
```
|
||||
Output
|
||||
|
||||
**Output**
|
||||
```text
|
||||
> Running step 845783b0-b85b-487c-baee-8460ebe8b38d. Step input: I love to eat pizza on weekends
|
||||
Added user message to memory: I love to eat pizza on weekends
|
||||
=== LLM Response ===
|
||||
Pizza is a great choice for the weekend! If you'd like, I can help you order some. Just let me know what kind of pizza you prefer!
|
||||
```
|
||||
Input
|
||||
|
||||
**Input**
|
||||
```python
|
||||
response = agent.chat("My preferred way of communication is email")
|
||||
print(response)
|
||||
```
|
||||
Output
|
||||
|
||||
**Output**
|
||||
```text
|
||||
> Running step 345842f0-f8a0-42ea-a1b7-612265d72a92. Step input: My preferred way of communication is email
|
||||
Added user message to memory: My preferred way of communication is email
|
||||
@@ -119,8 +127,9 @@ Added user message to memory: My preferred way of communication is email
|
||||
Got it! If you need any assistance or have any requests, feel free to let me know, and I can communicate with you via email.
|
||||
```
|
||||
|
||||
### Using the agent WITHOUT memory
|
||||
Input
|
||||
## Using the Agent Without Memory
|
||||
|
||||
**Input**
|
||||
```python
|
||||
agent = FunctionCallingAgent.from_tools(
|
||||
[call_tool, email_tool, order_food_tool],
|
||||
@@ -131,17 +140,20 @@ agent = FunctionCallingAgent.from_tools(
|
||||
response = agent.chat("I am feeling hungry, order me something and send me the bill")
|
||||
print(response)
|
||||
```
|
||||
Output
|
||||
|
||||
**Output**
|
||||
```text
|
||||
> Running step e89eb75d-75e1-4dea-a8c8-5c3d4b77882d. Step input: I am feeling hungry, order me something and send me the bill
|
||||
Added user message to memory: I am feeling hungry, order me something and send me the bill
|
||||
=== LLM Response ===
|
||||
Please let me know your name and the dish you'd like to order, and I'll take care of it for you!
|
||||
```
|
||||
<Note> The agent is not able to remember the past preferences that user shared in previous chats. </Note>
|
||||
|
||||
### Using the agent WITH memory
|
||||
Input
|
||||
<Note>The agent is not able to remember the past preferences the user shared in previous chats.</Note>
|
||||
|
||||
## Using the Agent With Memory
|
||||
|
||||
**Input**
|
||||
```python
|
||||
agent = FunctionCallingAgent.from_tools(
|
||||
[call_tool, email_tool, order_food_tool],
|
||||
@@ -170,4 +182,5 @@ Emailing... David
|
||||
=== LLM Response ===
|
||||
I've ordered a pizza for you, and the bill has been sent to your email. Enjoy your meal! If there's anything else you need, feel free to let me know.
|
||||
```
|
||||
<Note> The agent is able to remember the past preferences that user shared and use them to perform actions. </Note>
|
||||
|
||||
<Note>The agent is able to remember the past preferences the user shared and use them to perform actions.</Note>
|
||||
|
||||
@@ -11,7 +11,7 @@ Build an intelligent multi-agent learning system that uses Mem0 to maintain pers
|
||||
This example showcases a **Multi-Agent Personal Learning System** that combines:
|
||||
- **LlamaIndex AgentWorkflow** for multi-agent orchestration
|
||||
- **Mem0** for persistent, shared memory across agents
|
||||
- **Multi-agents** that collaborate on teaching tasks
|
||||
- **Multiple agents** that collaborate on teaching tasks
|
||||
|
||||
The system consists of two agents:
|
||||
- **TutorAgent**: Primary instructor for explanations and concept teaching
|
||||
@@ -350,7 +350,7 @@ Based on our previous session, I remember we covered Vision Language Models and
|
||||
1. **Clear Agent Roles**: Define specific responsibilities for each agent
|
||||
2. **Memory Context**: Use descriptive context for memory isolation
|
||||
3. **Handoff Strategy**: Design clear handoff criteria between agents
|
||||
5. **Memory Hygiene**: Regularly review and clean memory for optimal performance
|
||||
4. **Memory Hygiene**: Regularly review and clean memory for optimal performance
|
||||
|
||||
## Help & Resources
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ title: Mem0 as an Agentic Tool
|
||||
---
|
||||
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ Before you begin, follow these steps to set up the demo application:
|
||||
## Enhancing the Next.js Application
|
||||
|
||||
Once the demo is running, you can customize and enhance the Next.js application by modifying the components in the `mem0-demo` folder. Consider:
|
||||
- Adding new memory features to improve contextual retention.
|
||||
- Customizing the UI to better suit your application needs.
|
||||
- Integrating additional APIs or third-party services to extend functionality.
|
||||
- Adding new memory features to improve contextual retention
|
||||
- Customizing the UI to better suit your application needs
|
||||
- Integrating additional APIs or third-party services to extend functionality
|
||||
|
||||
## Full Code
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ description: 'Build a personalized healthcare agent that remembers patient infor
|
||||
---
|
||||
|
||||
|
||||
# Healthcare Assistant with Memory
|
||||
## Healthcare Assistant with Memory
|
||||
|
||||
This example demonstrates how to build a healthcare assistant that remembers patient information across conversations using Google ADK and Mem0.
|
||||
|
||||
@@ -257,7 +257,7 @@ This healthcare assistant demonstrates several key capabilities:
|
||||
|
||||
## Key Implementation Details
|
||||
|
||||
### User ID Management
|
||||
## User ID Management
|
||||
|
||||
Instead of passing the user ID as a parameter to the memory tools (which would require modifying the ADK's tool calling system), we attach it directly to the function object:
|
||||
|
||||
@@ -276,7 +276,7 @@ user_id = getattr(save_patient_info, 'user_id', 'default_user')
|
||||
|
||||
This approach allows our tools to maintain user context without complicating their parameter signatures.
|
||||
|
||||
### Mem0 Integration
|
||||
## Mem0 Integration
|
||||
|
||||
The integration with Mem0 happens through two primary functions:
|
||||
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
title: Mem0 with Mastra
|
||||
---
|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
@@ -11,9 +10,9 @@ You can find the complete example code in the [Mastra repository](https://github
|
||||
|
||||
This guide will show you how to integrate Mem0 with Mastra to add long-term memory capabilities to your agents. We'll create tools that allow agents to save and retrieve memories using Mem0's API.
|
||||
|
||||
### Installation
|
||||
## Installation
|
||||
|
||||
1. **Install the Integration Package**
|
||||
**Install the Integration Package**
|
||||
|
||||
To install the Mem0 integration, run:
|
||||
|
||||
@@ -21,7 +20,7 @@ To install the Mem0 integration, run:
|
||||
npm install @mastra/mem0
|
||||
```
|
||||
|
||||
2. **Add the Integration to Your Project**
|
||||
**Add the Integration to Your Project**
|
||||
|
||||
Create a new file for your integrations and import the integration:
|
||||
|
||||
@@ -36,7 +35,7 @@ export const mem0 = new Mem0Integration({
|
||||
});
|
||||
```
|
||||
|
||||
3. **Use the Integration in Tools or Workflows**
|
||||
**Use the Integration in Tools or Workflows**
|
||||
|
||||
You can now use the integration when defining tools for your agents or in workflows.
|
||||
|
||||
@@ -86,7 +85,7 @@ export const mem0MemorizeTool = createTool({
|
||||
});
|
||||
```
|
||||
|
||||
4. **Create a new agent**
|
||||
**Create a New Agent**
|
||||
|
||||
```typescript agents/index.ts
|
||||
import { openai } from '@ai-sdk/openai';
|
||||
@@ -103,7 +102,7 @@ export const mem0Agent = new Agent({
|
||||
});
|
||||
```
|
||||
|
||||
5. **Run the agent**
|
||||
**Run the Agent**
|
||||
|
||||
```typescript index.ts
|
||||
import { Mastra } from '@mastra/core/mastra';
|
||||
@@ -121,6 +120,6 @@ export const mastra = new Mastra({
|
||||
```
|
||||
|
||||
In the example above:
|
||||
- We import the `@mastra/mem0` integration.
|
||||
- We define two tools that uses the Mem0 API client to create new memories and recall previously saved memories.
|
||||
- The tool accepts `question` as an input and returns the memory as a string.
|
||||
- We import the `@mastra/mem0` integration
|
||||
- We define two tools that use the Mem0 API client to create new memories and recall previously saved memories
|
||||
- The tool accepts `question` as an input and returns the memory as a string
|
||||
@@ -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'
|
||||
---
|
||||
|
||||
# Building Voice Agents with Memory using Mem0 and OpenAI Agents SDK
|
||||
## Building Voice Agents with Memory using Mem0 and OpenAI Agents SDK
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -6,15 +6,15 @@ title: Mem0 with Ollama
|
||||
|
||||
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.
|
||||
|
||||
### Overview
|
||||
## Overview
|
||||
|
||||
By using Ollama, you can run Mem0 locally, which allows for greater control over your data and models. This setup uses Ollama for both the embedding model and the language model, providing a fully local solution.
|
||||
|
||||
### Setup
|
||||
## Setup
|
||||
|
||||
Before you begin, ensure you have Mem0 and Ollama installed and properly configured on your local machine.
|
||||
|
||||
### Full Code Example
|
||||
## Full Code Example
|
||||
|
||||
Below is the complete code to set up and use Mem0 locally with Ollama:
|
||||
|
||||
@@ -60,13 +60,13 @@ m.add("I'm visiting Paris", user_id="john")
|
||||
memories = m.get_all(user_id="john")
|
||||
```
|
||||
|
||||
### Key Points
|
||||
## Key Points
|
||||
|
||||
- **Configuration**: The setup involves configuring the vector store, language model, and embedding model to use local resources.
|
||||
- **Vector Store**: Qdrant is used as the vector store, running on localhost.
|
||||
- **Language Model**: Ollama is used as the LLM provider, with the "llama3.1:latest" model.
|
||||
- **Embedding Model**: Ollama is also used for embeddings, with the "nomic-embed-text:latest" model.
|
||||
- **Configuration**: The setup involves configuring the vector store, language model, and embedding model to use local resources
|
||||
- **Vector Store**: Qdrant is used as the vector store, running on localhost
|
||||
- **Language Model**: Ollama is used as the LLM provider, with the `llama3.1:latest` model
|
||||
- **Embedding Model**: Ollama is also used for embeddings, with the `nomic-embed-text:latest` model
|
||||
|
||||
### Conclusion
|
||||
## Conclusion
|
||||
|
||||
This local setup of Mem0 using Ollama provides a fully self-contained solution for memory management and AI interactions. It allows for greater control over your data and models while still leveraging the powerful capabilities of Mem0.
|
||||
@@ -31,7 +31,7 @@ USER_ID = "content_writer"
|
||||
RUN_ID = "smart_editing_session"
|
||||
```
|
||||
|
||||
## **Storing Your Writing Preferences in Mem0**
|
||||
## Storing Your Writing Preferences in Mem0
|
||||
|
||||
```python
|
||||
def store_writing_preferences():
|
||||
@@ -60,7 +60,7 @@ def store_writing_preferences():
|
||||
return response
|
||||
```
|
||||
|
||||
## **Editing Content Using Stored Preferences**
|
||||
## Editing Content Using Stored Preferences
|
||||
|
||||
```python
|
||||
def apply_writing_style(original_content):
|
||||
@@ -111,7 +111,7 @@ Preferences:
|
||||
return clean_response
|
||||
```
|
||||
|
||||
## **Complete Workflow: Content Editing**
|
||||
## Complete Workflow: Content Editing
|
||||
|
||||
```python
|
||||
def content_writing_workflow(content):
|
||||
@@ -136,7 +136,7 @@ def content_writing_workflow(content):
|
||||
return edited_content
|
||||
```
|
||||
|
||||
## **Example Usage**
|
||||
## Example Usage
|
||||
|
||||
```python
|
||||
# Define your document
|
||||
@@ -156,11 +156,11 @@ We plan to launch the campaign in July and continue through September.
|
||||
result = content_writing_workflow(original_content)
|
||||
```
|
||||
|
||||
## **Expected Output**
|
||||
## Expected Output
|
||||
|
||||
Your document will be transformed into a structured, well-formatted version based on your preferences.
|
||||
|
||||
### **Original Document**
|
||||
### Original Document
|
||||
```
|
||||
Project Proposal
|
||||
|
||||
@@ -174,37 +174,38 @@ Expand our social media following
|
||||
We plan to launch the campaign in July and continue through September.
|
||||
```
|
||||
|
||||
### **Edited Document**
|
||||
```
|
||||
# **Project Proposal**
|
||||
### Edited Document
|
||||
|
||||
## **Q3 Marketing Campaign Strategy**
|
||||
```
|
||||
# Project Proposal
|
||||
|
||||
## Q3 Marketing Campaign Strategy
|
||||
|
||||
This proposal outlines our strategy for the Q3 marketing campaign. We aim to significantly increase our market share with this approach.
|
||||
|
||||
### **Objectives**
|
||||
### Objectives
|
||||
|
||||
- **Increase Brand Awareness**: Implement targeted advertising and community engagement to enhance visibility.
|
||||
- **Boost Sales by 15%**: Increase sales by 15% compared to Q2 figures.
|
||||
- **Expand Social Media Following**: Grow our social media audience by 20%.
|
||||
|
||||
### **Timeline**
|
||||
### Timeline
|
||||
|
||||
- **Launch Date**: July
|
||||
- **Duration**: July – September
|
||||
|
||||
### **Key Actions**
|
||||
### Key Actions
|
||||
|
||||
- **Targeted Advertising**: Utilize platforms like Google Ads and Facebook to reach specific demographics.
|
||||
- **Community Engagement**: Host webinars and live Q&A sessions.
|
||||
- **Content Creation**: Produce engaging videos and infographics.
|
||||
|
||||
### **Supporting Data**
|
||||
### Supporting Data
|
||||
|
||||
- **Previous Campaign Success**: Our Q2 campaign increased sales by 12%. We will refine similar strategies for Q3.
|
||||
- **Social Media Growth**: Last year, our Instagram followers grew by 25% during a similar campaign.
|
||||
|
||||
### **Conclusion**
|
||||
### Conclusion
|
||||
|
||||
We believe this strategy will effectively increase our market share. To achieve these goals, we need your support and collaboration. Let’s work together to make this campaign a success. Please review the proposal and provide your feedback by the end of the week.
|
||||
```
|
||||
|
||||
@@ -2,24 +2,24 @@
|
||||
title: Multimodal Demo with Mem0
|
||||
---
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
> Experience the power of multimodal AI! Test out Mem0's image understanding capabilities at [multimodal-demo.mem0.ai](https://multimodal-demo.mem0.ai)
|
||||
|
||||
## Features
|
||||
|
||||
- **Image Understanding**: Share and discuss images with AI assistants while maintaining context.
|
||||
- **Smart Visual Context**: Automatically capture and reference visual elements in conversations.
|
||||
- **Cross-Modal Memory**: Link visual and textual information seamlessly in your memory layer.
|
||||
- **Cross-Session Recall**: Reference previously discussed visual content across different conversations.
|
||||
- **Seamless Integration**: Works naturally with existing chat interfaces for a smooth experience.
|
||||
- **Image Understanding**: Share and discuss images with AI assistants while maintaining context
|
||||
- **Smart Visual Context**: Automatically capture and reference visual elements in conversations
|
||||
- **Cross-Modal Memory**: Link visual and textual information seamlessly in your memory layer
|
||||
- **Cross-Session Recall**: Reference previously discussed visual content across different conversations
|
||||
- **Seamless Integration**: Works naturally with existing chat interfaces for a smooth experience
|
||||
|
||||
## How It Works
|
||||
|
||||
1. **Upload Visual Content**: Simply drag and drop or paste images into your conversations.
|
||||
2. **Natural Interaction**: Discuss the visual content naturally with AI assistants.
|
||||
3. **Memory Integration**: Visual context is automatically stored and linked with your conversation history.
|
||||
4. **Persistent Recall**: Retrieve and reference past visual content effortlessly.
|
||||
1. **Upload Visual Content**: Simply drag and drop or paste images into your conversations
|
||||
2. **Natural Interaction**: Discuss the visual content naturally with AI assistants
|
||||
3. **Memory Integration**: Visual context is automatically stored and linked with your conversation history
|
||||
4. **Persistent Recall**: Retrieve and reference past visual content effortlessly
|
||||
|
||||
## Demo Video
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ const openAIClient = new OpenAI();
|
||||
const mem0Client = new MemoryClient(mem0Config);
|
||||
```
|
||||
|
||||
### Adding Memories
|
||||
## Adding Memories
|
||||
|
||||
Store user preferences, past interactions, or any relevant information:
|
||||
<CodeGroup>
|
||||
@@ -84,7 +84,7 @@ await addUserPreferences();
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
### Retrieving Memories
|
||||
## Retrieving Memories
|
||||
|
||||
Search for relevant memories based on the current user input:
|
||||
|
||||
@@ -92,7 +92,7 @@ Search for relevant memories based on the current user input:
|
||||
const relevantMemories = await mem0Client.search(userInput, mem0Config);
|
||||
```
|
||||
|
||||
### Structured Responses with Zod
|
||||
## Structured Responses with Zod
|
||||
|
||||
Define structured response schemas to get consistent output formats:
|
||||
|
||||
@@ -125,7 +125,7 @@ const response = await openAIClient.responses.create({
|
||||
});
|
||||
```
|
||||
|
||||
### Using Web Search
|
||||
## Using Web Search
|
||||
|
||||
Combine memory with web search for up-to-date recommendations:
|
||||
|
||||
@@ -139,7 +139,7 @@ const response = await openAIClient.responses.create({
|
||||
|
||||
## Examples
|
||||
|
||||
### Complete Car Recommendation System
|
||||
## Complete Car Recommendation System
|
||||
|
||||
```javascript
|
||||
import MemoryClient from "mem0ai";
|
||||
@@ -230,7 +230,7 @@ const getMemoryString = (memories) => {
|
||||
run().catch(console.error);
|
||||
```
|
||||
|
||||
### Responses
|
||||
## Responses
|
||||
|
||||
<CodeGroup>
|
||||
```json Without Memories
|
||||
|
||||
@@ -9,6 +9,7 @@ You can create a personalized AI Tutor using Mem0. This guide will walk you thro
|
||||
The Personalized AI Tutor leverages Mem0 to retain information across interactions, enabling a tailored learning experience. By integrating with OpenAI's GPT-4 model, the tutor can provide detailed and context-aware responses to user queries.
|
||||
|
||||
## Setup
|
||||
|
||||
Before you begin, ensure you have the required dependencies installed. You can install the necessary packages using pip:
|
||||
|
||||
```bash
|
||||
@@ -100,12 +101,12 @@ for m in memories['results']:
|
||||
print(m['memory'])
|
||||
```
|
||||
|
||||
### Key Points
|
||||
## Key Points
|
||||
|
||||
- **Initialization**: The PersonalAITutor class is initialized with the necessary memory configuration and OpenAI client setup.
|
||||
- **Asking Questions**: The ask method sends a question to the AI and stores the relevant information in memory.
|
||||
- **Retrieving Memories**: The get_memories method fetches all stored memories associated with a user.
|
||||
- **Initialization**: The PersonalAITutor class is initialized with the necessary memory configuration and OpenAI client setup
|
||||
- **Asking Questions**: The ask method sends a question to the AI and stores the relevant information in memory
|
||||
- **Retrieving Memories**: The get_memories method fetches all stored memories associated with a user
|
||||
|
||||
### Conclusion
|
||||
## Conclusion
|
||||
|
||||
As the conversation progresses, Mem0's memory automatically updates based on the interactions, providing a continuously improving personalized learning experience. This setup ensures that the AI Tutor can offer contextually relevant and accurate responses, enhancing the overall educational process.
|
||||
|
||||
@@ -4,7 +4,7 @@ title: Personalized Deep Research
|
||||
|
||||
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 checkout GitHub repositry here: [Personalized Deep Research](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
|
||||
You can check out the GitHub repository here: [Personalized Deep Research](https://github.com/mem0ai/personalized-deep-research/tree/mem0)
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -59,7 +59,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.
|
||||
|
||||
@@ -4,19 +4,19 @@ title: 'Personalized Search with Mem0 and Tavily'
|
||||
|
||||
<Snippet file="security-compliance.mdx" />
|
||||
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
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.
|
||||
|
||||
- With **Mem0**, your assistant builds a memory of the user’s world.
|
||||
- With **Tavily**, it fetches fresh and accurate results in real time.
|
||||
- With Mem0, your assistant builds a memory of the user's world.
|
||||
- With Tavily, it fetches fresh and accurate results in real time.
|
||||
|
||||
Together, they make every interaction **smarter, faster, and more personal**.
|
||||
Together, they make every interaction smarter, faster, and more personal.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -55,7 +55,7 @@ and extract facts and memories accordingly.
|
||||
'''
|
||||
)
|
||||
```
|
||||
Now, if a user casually mentions "I need to pick up my daughter", or "What's the weather at Los Angeles", Mem0 remembers they have a daughter or user is somewhat interested/connected with Los Angeles in terms of location, those will be referred for future searches.
|
||||
Now, if a user casually mentions "I need to pick up my daughter" or "What's the weather at Los Angeles", Mem0 remembers they have a daughter or the user is interested in or connected with Los Angeles in terms of location. These details will be referenced for future searches.
|
||||
|
||||
### 2. Simulating User History
|
||||
To test personalization, we preload some sample conversation history for a user:
|
||||
@@ -173,17 +173,19 @@ if __name__ == "__main__":
|
||||
```
|
||||
|
||||
## How It Works in Practice
|
||||
Here’s how personalization plays out:
|
||||
|
||||
- Context Gathering: User previously mentioned living in Los Angeles, being vegan, and having a 7-year-old daughter allergic to peanuts.
|
||||
- Enhanced Search Query:
|
||||
Query -> "good coffee shops nearby for working"
|
||||
Enhanced Query -> "good coffee shops in Los Angeles with strong wifi, remote-work-friendly"
|
||||
- Personalized Results: The assistant only returns wifi-friendly, work-friendly cafes near Los Angeles.
|
||||
- Memory Update: Interaction is saved for better future recommendations.
|
||||
Here's how personalization plays out:
|
||||
|
||||
- **Context Gathering**: User previously mentioned living in Los Angeles, being vegan, and having a 7-year-old daughter allergic to peanuts.
|
||||
- **Enhanced Search Query**:
|
||||
- Query: "good coffee shops nearby for working"
|
||||
- Enhanced Query: "good coffee shops in Los Angeles with strong WiFi, remote-work-friendly"
|
||||
- **Personalized Results**: The assistant only returns WiFi-friendly, work-friendly cafes near Los Angeles.
|
||||
- **Memory Update**: Interaction is saved for better future recommendations.
|
||||
|
||||
## Conclusion
|
||||
With Mem0 + Tavily, you can build a search assistant that doesn’t just fetch results but it understands the person behind the query.
|
||||
|
||||
With Mem0 and Tavily, you can build a search assistant that doesn't just fetch results but understands the person behind the query.
|
||||
|
||||
Whether for shopping, travel, or daily life, this approach turns a generic search into a truly personalized experience.
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: YouTube Assistant Extension
|
||||
---
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -29,12 +29,12 @@ This extension is not available on the Chrome Web Store yet. You can install it
|
||||
|
||||
### Manual Installation (Developer Mode)
|
||||
|
||||
1. **Download the Extension**: Clone or download the extension files from the [Mem0 GitHub repository](https://github.com/mem0ai/mem0/tree/main/examples).
|
||||
2. **Build**: Run `npm install` followed by `npm run build` to install the dependencies and build the extension.
|
||||
3. **Access Chrome Extensions**: Open Google Chrome and navigate to `chrome://extensions`.
|
||||
4. **Enable Developer Mode**: Toggle the "Developer mode" switch in the top right corner.
|
||||
5. **Load Unpacked Extension**: Click "Load unpacked" and select the directory containing the extension files.
|
||||
6. **Confirm Installation**: The Mem0 YouTube Assistant Extension should now appear in your Chrome toolbar.
|
||||
1. **Download the Extension**: Clone or download the extension files from the [Mem0 GitHub repository](https://github.com/mem0ai/mem0/tree/main/examples)
|
||||
2. **Build**: Run `npm install` followed by `npm run build` to install the dependencies and build the extension
|
||||
3. **Access Chrome Extensions**: Open Google Chrome and navigate to `chrome://extensions`
|
||||
4. **Enable Developer Mode**: Toggle the "Developer mode" switch in the top right corner
|
||||
5. **Load Unpacked Extension**: Click "Load unpacked" and select the directory containing the extension files
|
||||
6. **Confirm Installation**: The Mem0 YouTube Assistant Extension should now appear in your Chrome toolbar
|
||||
|
||||
## Setup
|
||||
|
||||
@@ -50,7 +50,6 @@ This extension is not available on the Chrome Web Store yet. You can install it
|
||||
- "How does this relate to what I already know?"
|
||||
- "What are some practical applications of this topic related to my work?"
|
||||
|
||||
|
||||
## Privacy and Data Security
|
||||
|
||||
Your API keys are stored locally in your browser. Your messages are sent to the Mem0 API for extracting and retrieving memories. Mem0 is committed to ensuring your data's privacy and security.
|
||||
|
||||
+2
-2
@@ -21,10 +21,10 @@ iconType: "solid"
|
||||
- **Developer-Friendly API**: Offers a straightforward API for seamless integration into various applications.
|
||||
- **Platform Consistency**: Ensures consistent behavior and data across different platforms and devices.
|
||||
- **Managed Service**: Provides a hosted solution for easy deployment and maintenance.
|
||||
- **Save Costs**: Saves costs by adding relevant memories instead of complete transcripts to context window
|
||||
- **Cost Savings**: Saves costs by adding relevant memories instead of complete transcripts to context window
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="How Mem0 is different from traditional RAG?">
|
||||
<Accordion title="How is Mem0 different from traditional RAG?">
|
||||
Mem0's memory implementation for Large Language Models (LLMs) offers several advantages over Retrieval-Augmented Generation (RAG):
|
||||
|
||||
- **Entity Relationships**: Mem0 can understand and relate entities across different interactions, unlike RAG which retrieves information from static documents. This leads to a deeper understanding of context and relationships.
|
||||
|
||||
@@ -163,11 +163,10 @@ Organize your monitoring with structured sessions:
|
||||
4. **Tagging**: Use tags to organize different types of memory operations
|
||||
5. **Environment Separation**: Use different projects or tags for dev/staging/prod
|
||||
|
||||
## Help & Resources
|
||||
## Help
|
||||
|
||||
- [AgentOps Documentation](https://docs.agentops.ai/)
|
||||
- [AgentOps Dashboard](https://app.agentops.ai/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
title: Agno
|
||||
---
|
||||
|
||||
This integration of [**Mem0**](https://github.com/mem0ai/mem0) with [Agno](https://github.com/agno-agi/agno, enables persistent, multimodal memory for Agno-based agents - improving personalization, context awareness, and continuity across conversations.
|
||||
This integration of [**Mem0**](https://github.com/mem0ai/mem0) with [Agno](https://github.com/agno-agi/agno) enables persistent, multimodal memory for Agno-based agents - improving personalization, context awareness, and continuity across conversations.
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -195,7 +195,7 @@ Customize the integration to your needs:
|
||||
- **Memory Search**: Configure search relevance and result count
|
||||
- **Memory Formatting**: Support for various OpenAI message formats
|
||||
|
||||
## Help & Resources
|
||||
## Help
|
||||
|
||||
- [Agno Documentation](https://docs.agno.com/introduction)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
@@ -6,8 +6,7 @@ Build conversational AI agents with memory capabilities. This integration combin
|
||||
|
||||
## Overview
|
||||
|
||||
In this guide, we'll explore an example of creating a conversational AI system with memory:
|
||||
- A customer service bot that can recall previous interactions and provide personalized responses.
|
||||
This guide demonstrates creating a conversational AI system with memory. We'll build a customer service bot that can recall previous interactions and provide personalized responses.
|
||||
|
||||
## Setup and Configuration
|
||||
|
||||
@@ -133,6 +132,4 @@ This integration enables the creation of more intelligent and personalized AI ag
|
||||
|
||||
## Help
|
||||
|
||||
In case of any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -29,9 +29,9 @@ Install required packages:
|
||||
pip install mem0ai boto3 opensearch-py
|
||||
```
|
||||
|
||||
Set environment variables:
|
||||
Set environment variables.
|
||||
|
||||
Be sure to configure your AWS credentials using environment variables, IAM roles, or the AWS CLI.
|
||||
Configure your AWS credentials using environment variables, IAM roles, or the AWS CLI.
|
||||
|
||||
```python
|
||||
import os
|
||||
|
||||
@@ -60,9 +60,9 @@ messages = [
|
||||
{"role": "user", "content": "I am more of a beach person than a mountain person."},
|
||||
{
|
||||
"role": "assistant",
|
||||
"content": "That's interesting. Do you like hotels or airbnb?",
|
||||
"content": "That's interesting. Do you like hotels or Airbnb?",
|
||||
},
|
||||
{"role": "user", "content": "I like airbnb more."},
|
||||
{"role": "user", "content": "I like Airbnb more."},
|
||||
]
|
||||
|
||||
store_user_preferences("crew_user_1", messages)
|
||||
@@ -154,7 +154,7 @@ if __name__ == "__main__":
|
||||
## Benefits
|
||||
|
||||
1. **Persistent Context & Memory**: Maintains user preferences and interaction history across sessions
|
||||
2. **Flexible & Scalable Design**: Easily extendable with new agents, tasks and capabilities
|
||||
2. **Flexible & Scalable Design**: Easily extendable with new agents, tasks, and capabilities
|
||||
|
||||
## Conclusion
|
||||
|
||||
|
||||
@@ -447,8 +447,7 @@ By integrating ElevenLabs Conversational AI with Mem0, you can create voice agen
|
||||
|
||||
## Help
|
||||
|
||||
- For more details on ElevenLabs, visit the [ElevenLabs Conversational AI Documentation](https://elevenlabs.io/docs/api-reference/conversational-ai)
|
||||
- For Mem0 documentation, refer to the [Mem0 Platform](https://app.mem0.ai/)
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
- [ElevenLabs Conversational AI Documentation](https://elevenlabs.io/docs/api-reference/conversational-ai)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -6,11 +6,11 @@ The [**Mem0 Memory**](https://github.com/mem0ai/mem0) integration with [Flowise]
|
||||
|
||||
## Overview
|
||||
|
||||
1. 🧠 Provides persistent memory storage for Flowise chatflows
|
||||
2. 🔄 Seamless integration with existing Flowise templates
|
||||
3. 🚀 Compatible with various LLM nodes in Flowise
|
||||
4. 📝 Supports custom memory configurations
|
||||
5. ⚡ Easy to set up and manage
|
||||
1. Provides persistent memory storage for Flowise chatflows
|
||||
2. Seamless integration with existing Flowise templates
|
||||
3. Compatible with various LLM nodes in Flowise
|
||||
4. Supports custom memory configurations
|
||||
5. Easy to set up and manage
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -115,12 +115,11 @@ Additional settings available in [Mem0 Project Settings](https://app.mem0.ai/das
|
||||
2. **Memory Organization**: Utilize projects and organizations for better memory management
|
||||
3. **Regular Maintenance**: Monitor and clean up unused memories periodically
|
||||
|
||||
## Help & Resources
|
||||
## Help
|
||||
|
||||
- [Flowise Documentation](https://flowiseai.com/docs)
|
||||
- [Flowise GitHub Repository](https://github.com/FlowiseAI/Flowise)
|
||||
- [Flowise Website](https://flowiseai.com/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- Need assistance? Reach out through:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -9,7 +9,7 @@ Integrate [**Mem0**](https://github.com/mem0ai/mem0) with [Google Agent Developm
|
||||
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
|
||||
4. Personalized responses based on user history
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -130,9 +130,9 @@ from google.adk.tools.agent_tool import AgentTool
|
||||
travel_agent = Agent(
|
||||
name="travel_specialist",
|
||||
model="gemini-2.0-flash",
|
||||
instruction="""You are a travel planning specialist. Use get_user_context to
|
||||
instruction="""You are a travel planning specialist. Use search_memory to
|
||||
understand the user's travel preferences and history before making recommendations.
|
||||
After providing advice, use store_interaction to save travel-related information.""",
|
||||
After providing advice, use save_memory to save travel-related information.""",
|
||||
description="Specialist in travel planning and recommendations",
|
||||
tools=[search_memory, save_memory]
|
||||
)
|
||||
@@ -141,9 +141,9 @@ travel_agent = 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
|
||||
instruction="""You are a health and wellness advisor. Use search_memory to
|
||||
understand the user's health goals and dietary preferences.
|
||||
After providing advice, use store_interaction to save health-related information.""",
|
||||
After providing advice, use save_memory to save health-related information.""",
|
||||
description="Specialist in health and wellness advice",
|
||||
tools=[search_memory, save_memory]
|
||||
)
|
||||
@@ -155,7 +155,7 @@ coordinator_agent = Agent(
|
||||
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.""",
|
||||
Use search_memory to understand the user before delegation.""",
|
||||
description="Coordinates requests between specialist agents",
|
||||
tools=[
|
||||
AgentTool(agent=travel_agent, skip_summarization=False),
|
||||
@@ -282,6 +282,5 @@ os.environ["GOOGLE_CLOUD_LOCATION"] = "us-central1"
|
||||
|
||||
- [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" />
|
||||
@@ -94,7 +94,7 @@ client = OpenAI(
|
||||
# Sample conversation messages
|
||||
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": "assistant", "content": "How about 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."}
|
||||
]
|
||||
@@ -133,7 +133,6 @@ Integrating Mem0 with Keywords AI provides a powerful combination for building A
|
||||
|
||||
## Help
|
||||
|
||||
For more information, refer to:
|
||||
- [Keywords AI Documentation](https://docs.keywordsai.co)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
|
||||
@@ -331,6 +331,4 @@ Each tool provides structured input validation through Pydantic models and retur
|
||||
|
||||
## Help
|
||||
|
||||
In case of any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -163,9 +163,8 @@ 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/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
- [LangChain Documentation](https://python.langchain.com/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
|
||||
@@ -165,8 +165,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).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through following methods:
|
||||
- [LangGraph Documentation](https://python.langchain.com/docs/langgraph)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -33,7 +33,7 @@ MEM0_API_KEY=your_mem0_api_key
|
||||
OPENAI_API_KEY=your_openai_api_key
|
||||
```
|
||||
|
||||
> **Note**: Make sure to have a Livekit and Deepgram account. You can find these variables `LIVEKIT_URL` , `LIVEKIT_API_KEY` and `LIVEKIT_API_SECRET` from [LiveKit Cloud Console](https://cloud.livekit.io/) and for more information you can refer this website [LiveKit Documentation](https://docs.livekit.io/home/cloud/keys-and-tokens/). For `DEEPGRAM_API_KEY` you can get from [Deepgram Console](https://console.deepgram.com/) refer this website [Deepgram Documentation](https://developers.deepgram.com/docs/create-additional-api-keys) for more details.
|
||||
> **Note**: Make sure to have a Livekit and Deepgram account. You can find these variables `LIVEKIT_URL`, `LIVEKIT_API_KEY`, and `LIVEKIT_API_SECRET` from the [LiveKit Cloud Console](https://cloud.livekit.io/). For more information, refer to the [LiveKit Documentation](https://docs.livekit.io/home/cloud/keys-and-tokens/). For `DEEPGRAM_API_KEY`, you can get it from the [Deepgram Console](https://console.deepgram.com/). Refer to the [Deepgram Documentation](https://developers.deepgram.com/docs/create-additional-api-keys) for more details.
|
||||
|
||||
## Code Breakdown
|
||||
|
||||
@@ -196,7 +196,7 @@ or to start your agent in console mode to run inside your terminal:
|
||||
```sh
|
||||
python mem0-livekit-voice-agent.py console
|
||||
```
|
||||
5. After the script starts, you can interact with the voice agent using [Livekit's Agent Platform](https://agents-playground.livekit.io/) and connect to the agent inorder to start conversations.
|
||||
5. After the script starts, you can interact with the voice agent using [LiveKit's Agent Platform](https://agents-playground.livekit.io/) and connect to the agent to start conversations.
|
||||
|
||||
## Best Practices for Voice Agents with Memory
|
||||
|
||||
@@ -229,10 +229,9 @@ logger = logging.getLogger("memory_voice_agent")
|
||||
- Ensure your `.env` file is correctly configured and loaded.
|
||||
|
||||
|
||||
## Help & Resources
|
||||
## Help
|
||||
|
||||
- [LiveKit Documentation](https://docs.livekit.io/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
- Need assistance? Reach out through:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
@@ -5,7 +5,7 @@ title: LlamaIndex
|
||||
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">
|
||||
🎉 Exciting news! [**Mem0Memory**](https://docs.llamaindex.ai/en/stable/examples/memory/Mem0Memory/) now supports **ReAct** and **FunctionCalling** agents.
|
||||
[**Mem0Memory**](https://docs.llamaindex.ai/en/stable/examples/memory/Mem0Memory/) now supports **ReAct** and **FunctionCalling** agents.
|
||||
</Note>
|
||||
|
||||
### Installation
|
||||
@@ -207,9 +207,8 @@ 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).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through following methods:
|
||||
- [LlamaIndex Documentation](https://llamahub.ai/l/memory/llama-index-memory-mem0)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
|
||||
@@ -127,8 +127,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/).
|
||||
- [Mem0 Platform](https://app.mem0.ai/).
|
||||
- If you need further assistance, please feel free to reach out to us through the following methods:
|
||||
- [Mastra Documentation](https://docs.mastra.ai/)
|
||||
- [Mem0 Platform](https://app.mem0.ai/)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
@@ -130,9 +130,9 @@ health_agent = Agent(
|
||||
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.""",
|
||||
For travel-related questions (trips, hotels, flights, destinations), hand off to the Travel Planner.
|
||||
For health-related questions (fitness, diet, wellness, exercise), hand off to the Health Advisor.
|
||||
For general questions, handle them directly using available tools.""",
|
||||
handoffs=[travel_agent, health_agent],
|
||||
model="gpt-4o"
|
||||
)
|
||||
@@ -201,7 +201,7 @@ if __name__ == "__main__":
|
||||
- **Seamless Handoffs**: Agents maintain context across handoffs
|
||||
|
||||
### 3. Flexible Memory Operations
|
||||
- **Retrieve Capabilities**: Retrieve relevant memories from previous conversation
|
||||
- **Retrieve Capabilities**: Retrieve relevant memories from previous conversations
|
||||
- **User Segmentation**: Organize memories by user ID
|
||||
- **Memory Management**: Built-in tools for saving and retrieving information
|
||||
|
||||
@@ -229,6 +229,5 @@ mem0.add(
|
||||
|
||||
- [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" />
|
||||
@@ -24,21 +24,21 @@ d. Enter this key in the extension preferences
|
||||
- Manage persistent user preferences
|
||||
- Search through stored memories
|
||||
|
||||
## ✨ Features
|
||||
## Features
|
||||
|
||||
**Remember Everything**: Never lose important information - store notes, preferences, and conversations that your AI can recall later
|
||||
**Remember Everything**: Never lose important information. Store notes, preferences, and conversations that your AI can recall later.
|
||||
|
||||
**Smart Connections**: Automatically links related topics, just like your brain does - helping you discover useful connections
|
||||
**Smart Connections**: Automatically links related topics, helping you discover useful connections.
|
||||
|
||||
**Cost Saver**: Spend less on AI usage by efficiently retrieving relevant information instead of regenerating responses
|
||||
**Cost Saver**: Spend less on AI usage by efficiently retrieving relevant information instead of regenerating responses.
|
||||
|
||||
## 🔑 How This Helps You
|
||||
## How This Helps You
|
||||
|
||||
**More Personal Experience**: Your AI remembers your preferences and past conversations, making interactions feel more natural
|
||||
**More Personal Experience**: Your AI remembers your preferences and past conversations, making interactions feel more natural.
|
||||
|
||||
**Learn Your Style**: Adapts to how you work and what you like, becoming more helpful over time
|
||||
**Learn Your Style**: Adapts to how you work and what you like, becoming more helpful over time.
|
||||
|
||||
**No More Repetition**: Stop explaining the same things over and over - your AI remembers your context and preferences
|
||||
**No More Repetition**: Stop explaining the same things repeatedly. Your AI remembers your context and preferences.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -5,16 +5,16 @@ title: Vercel AI SDK
|
||||
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.
|
||||
|
||||
<Note type="info">
|
||||
🎉 Exciting news! Mem0 AI SDK now supports <strong>Vercel AI SDK V5</strong>.
|
||||
Mem0 AI SDK now supports <strong>Vercel AI SDK V5</strong>.
|
||||
</Note>
|
||||
|
||||
## Overview
|
||||
|
||||
1. 🧠 Offers persistent memory storage for conversational AI
|
||||
2. 🔄 Enables smooth integration with the Vercel AI SDK
|
||||
3. 🚀 Ensures compatibility with multiple LLM providers
|
||||
4. 📝 Supports structured message formats for clarity
|
||||
5. ⚡ Facilitates streaming response capabilities
|
||||
1. Offers persistent memory storage for conversational AI
|
||||
2. Enables smooth integration with the Vercel AI SDK
|
||||
3. Ensures compatibility with multiple LLM providers
|
||||
4. Supports structured message formats for clarity
|
||||
5. Facilitates streaming response capabilities
|
||||
|
||||
## Setup and Configuration
|
||||
|
||||
@@ -318,8 +318,7 @@ 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)
|
||||
- [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" />
|
||||
@@ -32,7 +32,7 @@ Mem0 sits alongside your retriever, planner, and LLM. Unlike retrieval-based sys
|
||||
<img src="/images/memory-agent-stack.png" />
|
||||
</Frame>
|
||||
|
||||
Memory is not about pushing more tokens into a prompt but about intelligently remembering context that matters. This distinction matters:
|
||||
Memory isn't about pushing more tokens into a prompt—it's about intelligently remembering context that matters. This distinction is important:
|
||||
|
||||
| Capability | Context Window | Mem0 Memory |
|
||||
|------------------|------------------------|-----------------------------|
|
||||
@@ -55,12 +55,12 @@ Mem0 provides continuity. It stores decisions, preferences, and context—not ju
|
||||
| Recall Type | Document lookup | Evolving user context |
|
||||
| Use Case | Ground answers in data | Guide behavior across time |
|
||||
|
||||
Together, they’re stronger: RAG informs the LLM; Mem0 shapes its memory.
|
||||
Together, they're stronger: RAG informs the LLM while Mem0 shapes its memory.
|
||||
|
||||
|
||||
## Types of Memory in Mem0
|
||||
|
||||
Mem0 supports different kinds of memory to mimic how humans store information:
|
||||
Mem0 supports different types of memory to mimic how humans store information:
|
||||
|
||||
- **Working Memory**: short-term session awareness
|
||||
- **Factual Memory**: long-term structured knowledge (e.g., preferences, settings)
|
||||
@@ -74,11 +74,11 @@ Mem0 isn’t a wrapper around a vector store. It’s a full memory engine with:
|
||||
|
||||
- **LLM-based extraction**: Intelligently decides what to remember
|
||||
- **Filtering & decay**: Avoids memory bloat, forgets irrelevant info
|
||||
- **Costs Reduction**: Save compute costs with smart prompt injection of only relevant memories
|
||||
- **Cost Reduction**: Save compute costs with smart prompt injection of only relevant memories
|
||||
- **Dashboards & APIs**: Observability, fine-grained control
|
||||
- **Cloud and OSS**: Use our platform version or our open-source SDK version
|
||||
|
||||
You plug Mem0 into your agent framework, it doesn’t replace your LLM or workflows. Instead, it adds a smart memory layer on top.
|
||||
Plug Mem0 into your agent framework—it doesn't replace your LLM or workflows. Instead, it adds a smart memory layer on top.
|
||||
|
||||
|
||||
## Core Capabilities
|
||||
|
||||
@@ -7,7 +7,7 @@ iconType: "solid"
|
||||
|
||||
## 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.
|
||||
The `AsyncMemory` class is a direct asynchronous interface to Mem0's in-process memory operations. Unlike the synchronous memory class, 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.
|
||||
|
||||
### Initialization
|
||||
|
||||
@@ -30,10 +30,10 @@ memory = AsyncMemory(config=custom_config)
|
||||
|
||||
### Key Features
|
||||
|
||||
1. **Non-blocking Operations** - All memory operations use `asyncio` to avoid blocking the event loop
|
||||
2. **Concurrent Processing** - Parallel execution of vector store and graph operations
|
||||
3. **Efficient Resource Utilization** - Better handling of I/O bound operations
|
||||
4. **Compatible with Async Frameworks** - Seamless integration with FastAPI, aiohttp, and other async frameworks
|
||||
1. **Non-blocking Operations**: All memory operations use `asyncio` to avoid blocking the event loop.
|
||||
2. **Concurrent Processing**: Parallel execution of vector store and graph operations.
|
||||
3. **Efficient Resource Utilization**: Better handling of I/O-bound operations.
|
||||
4. **Compatible with Async Frameworks**: Seamless integration with FastAPI, aiohttp, and other async frameworks.
|
||||
|
||||
### Methods
|
||||
|
||||
@@ -182,7 +182,7 @@ except Exception as e:
|
||||
|
||||
### Example: Concurrent Usage with Other APIs
|
||||
|
||||
`AsyncMemory` can be effectively combined with other async operations. Here's an example showing how to use it alongside OpenAI API calls in separate threads:
|
||||
`AsyncMemory` can be effectively combined with other async operations. Here's an example showing how to use it alongside OpenAI API calls:
|
||||
|
||||
```python Python
|
||||
import asyncio
|
||||
@@ -199,7 +199,7 @@ async def chat_with_memories(message: str, user_id: str = "default_user") -> str
|
||||
relevant_memories = search_result["results"]
|
||||
memories_str = "\n".join(f"- {entry['memory']}" for entry in relevant_memories)
|
||||
|
||||
# Generate Assistant response
|
||||
# Generate assistant response
|
||||
system_prompt = f"You are a helpful AI. Answer the question based on query and memories.\nUser Memories:\n{memories_str}"
|
||||
messages = [{"role": "system", "content": system_prompt}, {"role": "user", "content": message}]
|
||||
response = await async_openai_client.chat.completions.create(model="gpt-4o-mini", messages=messages)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user