Added improved docs index and overview pages and quickstart (#3603)
This commit is contained in:
+63
-173
@@ -1,44 +1,79 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
title: "Overview"
|
||||
icon: "terminal"
|
||||
iconType: "solid"
|
||||
description: "REST APIs for memory management, search, and entity operations"
|
||||
---
|
||||
|
||||
Mem0 provides a powerful set of APIs that allow you to integrate advanced memory management capabilities into your applications. Our APIs are designed to be intuitive, efficient, and scalable, enabling you to create, retrieve, update, and delete memories across various entities such as users, agents, apps, and runs.
|
||||
## Mem0 REST API
|
||||
|
||||
Mem0 provides a comprehensive REST API for integrating advanced memory capabilities into your applications. Create, search, update, and manage memories across users, agents, and custom entities with simple HTTP requests.
|
||||
|
||||
<Info>
|
||||
**Quick start:** Get your API key from the [Mem0 Dashboard](https://app.mem0.ai/dashboard/api-keys) and make your first memory operation in minutes.
|
||||
</Info>
|
||||
|
||||
---
|
||||
|
||||
## Quick Start Guide
|
||||
|
||||
Get started with Mem0 API in three simple steps:
|
||||
|
||||
1. **[Add Memories](/api-reference/memory/add-memories)** - Store information and context from user conversations
|
||||
2. **[Search Memories](/api-reference/memory/search-memories)** - Retrieve relevant memories based on queries
|
||||
3. **[Get Memories](/api-reference/memory/get-memories)** - Fetch all memories for a specific entity
|
||||
2. **[Search Memories](/api-reference/memory/v2-search-memories)** - Retrieve relevant memories using semantic search
|
||||
3. **[Get Memories](/api-reference/memory/v2-get-memories)** - Fetch all memories for a specific entity
|
||||
|
||||
### Common Operations
|
||||
---
|
||||
|
||||
## Core Operations
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Add Memories" icon="plus" href="/api-reference/memory/add-memories">
|
||||
Store new memories from conversations and interactions
|
||||
</Card>
|
||||
|
||||
<Card title="Search Memories" icon="magnifying-glass" href="/api-reference/memory/v2-search-memories">
|
||||
Find relevant memories using semantic search
|
||||
Find relevant memories using semantic search with filters
|
||||
</Card>
|
||||
|
||||
<Card title="Update Memory" icon="pen" href="/api-reference/memory/update-memory">
|
||||
Modify existing memory content
|
||||
Modify existing memory content and metadata
|
||||
</Card>
|
||||
|
||||
<Card title="Delete Memory" icon="trash" href="/api-reference/memory/delete-memory">
|
||||
Remove specific memories or batch delete
|
||||
Remove specific memories or batch delete operations
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## API Structure
|
||||
---
|
||||
|
||||
Our API is organized into several main categories:
|
||||
## API Categories
|
||||
|
||||
1. **[Memory APIs](#memory-apis)**: Core operations for managing individual memories and collections
|
||||
2. **[Entities APIs](#entities-apis)**: Manage different entity types (users, agents, etc.) and their associated memories
|
||||
3. **[Organizations APIs](#organizations-apis)**: Manage organizations and their members (optional)
|
||||
4. **[Project APIs](#project-apis)**: Manage projects within organizations (optional)
|
||||
Explore the full API organized by functionality:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Memory APIs" icon="microchip" href="/api-reference/memory/add-memories">
|
||||
Core and advanced operations: CRUD, search, batch updates, history, and exports
|
||||
</Card>
|
||||
|
||||
<Card title="Entities APIs" icon="users" href="/api-reference/entities/get-users">
|
||||
Manage users, agents, and their associated memory data
|
||||
</Card>
|
||||
|
||||
<Card title="Organizations & Projects" icon="building" href="/api-reference/organizations-projects">
|
||||
Multi-tenant support, access control, and team collaboration
|
||||
</Card>
|
||||
|
||||
<Card title="Webhooks" icon="webhook" href="/api-reference/webhook/create-webhook">
|
||||
Real-time notifications for memory events and updates
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Note>
|
||||
**Building multi-tenant apps?** Learn about [Organizations & Projects](/api-reference/organizations-projects) for team isolation and access control.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Authentication
|
||||
|
||||
@@ -50,165 +85,20 @@ Authorization: Token <your-api-key>
|
||||
|
||||
Get your API key from the [Mem0 Dashboard](https://app.mem0.ai/dashboard/api-keys).
|
||||
|
||||
## Organizations and projects (optional)
|
||||
<Warning>
|
||||
**Keep your API key secure.** Never expose it in client-side code or public repositories. Use environment variables and server-side requests only.
|
||||
</Warning>
|
||||
|
||||
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.
|
||||
## Next Steps
|
||||
|
||||
Example with the mem0 Python package:
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Add Your First Memory" icon="rocket" href="/api-reference/memory/add-memories">
|
||||
Start storing memories via the REST API
|
||||
</Card>
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
```python
|
||||
from mem0 import MemoryClient
|
||||
client = MemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Node.js">
|
||||
|
||||
```javascript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
const client = new MemoryClient({organizationId: "YOUR_ORG_ID", projectId: "YOUR_PROJECT_ID"});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
### Project Management Methods
|
||||
|
||||
The Mem0 client provides comprehensive project management capabilities through the `client.project` interface:
|
||||
|
||||
#### Get Project Details
|
||||
|
||||
Retrieve information about the current project:
|
||||
|
||||
```python
|
||||
# Get all project details
|
||||
project_info = client.project.get()
|
||||
|
||||
# Get specific fields only
|
||||
project_info = client.project.get(fields=["name", "description", "custom_categories"])
|
||||
```
|
||||
|
||||
#### Create a New Project
|
||||
|
||||
Create a new project within your organization:
|
||||
|
||||
```python
|
||||
# Create a project with name and description
|
||||
new_project = client.project.create(
|
||||
name="My New Project",
|
||||
description="A project for managing customer support memories"
|
||||
)
|
||||
```
|
||||
|
||||
#### Update Project Settings
|
||||
|
||||
Modify project configuration including custom instructions, categories, and graph settings:
|
||||
|
||||
```python
|
||||
# Update project with custom categories
|
||||
client.project.update(
|
||||
custom_categories=[
|
||||
{"customer_preferences": "Customer likes, dislikes, and preferences"},
|
||||
{"support_history": "Previous support interactions and resolutions"}
|
||||
]
|
||||
)
|
||||
|
||||
# Update project with custom instructions
|
||||
client.project.update(
|
||||
custom_instructions="..."
|
||||
)
|
||||
|
||||
# Enable graph memory for the project
|
||||
client.project.update(enable_graph=True)
|
||||
|
||||
# Update multiple settings at once
|
||||
client.project.update(
|
||||
custom_instructions="...",
|
||||
custom_categories=[
|
||||
{"personal_info": "User personal information and preferences"},
|
||||
{"work_context": "Professional context and work-related information"}
|
||||
],
|
||||
enable_graph=True
|
||||
)
|
||||
```
|
||||
|
||||
#### Delete Project
|
||||
|
||||
<Note>
|
||||
This action will remove all memories, messages, and other related data in the project. This operation is irreversible.
|
||||
</Note>
|
||||
|
||||
Remove a project and all its associated data:
|
||||
|
||||
```python
|
||||
# Delete the current project (irreversible)
|
||||
result = client.project.delete()
|
||||
```
|
||||
|
||||
#### Member Management
|
||||
|
||||
Manage project members and their access levels:
|
||||
|
||||
```python
|
||||
# Get all project members
|
||||
members = client.project.get_members()
|
||||
|
||||
# Add a new member as a reader
|
||||
client.project.add_member(
|
||||
email="colleague@company.com",
|
||||
role="READER" # or "OWNER"
|
||||
)
|
||||
|
||||
# Update a member's role
|
||||
client.project.update_member(
|
||||
email="colleague@company.com",
|
||||
role="OWNER"
|
||||
)
|
||||
|
||||
# Remove a member from the project
|
||||
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.
|
||||
|
||||
#### Async Support
|
||||
|
||||
All project methods are also available in async mode:
|
||||
|
||||
```python
|
||||
from mem0 import AsyncMemoryClient
|
||||
|
||||
async def manage_project():
|
||||
client = AsyncMemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
|
||||
# All methods support async/await
|
||||
project_info = await client.project.get()
|
||||
await client.project.update(enable_graph=True)
|
||||
members = await client.project.get_members()
|
||||
|
||||
# To call the async function properly
|
||||
import asyncio
|
||||
asyncio.run(manage_project())
|
||||
```
|
||||
|
||||
## Getting Started
|
||||
|
||||
To begin using the Mem0 API, you'll need to:
|
||||
|
||||
1. Sign up for a [Mem0 account](https://app.mem0.ai) and obtain your API key.
|
||||
2. Familiarize yourself with the API endpoints and their functionalities.
|
||||
3. Make your first API call to add or retrieve a memory.
|
||||
|
||||
Explore the detailed documentation for each API endpoint to learn more about request/response formats, parameters, and example usage.
|
||||
<Card title="Search with Filters" icon="filter" href="/api-reference/memory/v2-search-memories">
|
||||
Learn advanced search and filtering techniques
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
title: 'Get Memories'
|
||||
title: "Get Memories"
|
||||
openapi: post /v2/memories/
|
||||
---
|
||||
|
||||
The v2 get memories API is powerful and flexible, allowing for more precise memory listing without the need for a search query. It supports complex logical operations (AND, OR, NOT) and comparison operators for advanced filtering capabilities. The comparison operators include:
|
||||
|
||||
- `in`: Matches any of the values specified
|
||||
- `gte`: Greater than or equal to
|
||||
- `lte`: Less than or equal to
|
||||
@@ -29,43 +30,70 @@ memories = m.get_all(
|
||||
)
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
```python Output
|
||||
{
|
||||
"id":"f38b689d-6b24-45b7-bced-17fbb4d8bac7",
|
||||
"memory":"Name: Alex. Vegetarian. Allergic to nuts.",
|
||||
"user_id":"alex",
|
||||
"hash":"62bc074f56d1f909f1b4c2b639f56f6a",
|
||||
"metadata":null,
|
||||
"created_at":"2024-07-25T23:57:00.108347-07:00",
|
||||
"updated_at":"2024-07-25T23:57:00.108367-07:00"
|
||||
"results": [
|
||||
{
|
||||
"id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
|
||||
"memory": "Alex is planning a trip to San Francisco from July 1st to July 10th",
|
||||
"created_at": "2024-07-01T12:00:00Z",
|
||||
"updated_at": "2024-07-01T12:00:00Z"
|
||||
},
|
||||
{
|
||||
"id": "a2b8c3d4-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
|
||||
"memory": "Alex prefers vegetarian restaurants",
|
||||
"created_at": "2024-07-05T15:30:00Z",
|
||||
"updated_at": "2024-07-05T15:30:00Z"
|
||||
}
|
||||
],
|
||||
"total": 2
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
<CodeGroup>
|
||||
```python Wildcard Example
|
||||
# Using wildcard to get all memories for a specific user across all run_ids
|
||||
memories = m.get_all(
|
||||
filters={
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
},
|
||||
{
|
||||
"run_id": "*"
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Graph Memory
|
||||
|
||||
To retrieve memories with graph-based relationships, pass the `enable_graph=True` parameter. This includes relationship data in the response for more contextual results.
|
||||
To retrieve graph memory relationships between entities, pass `output_format="v1.1"` in your request. This will return memories with entity and relationship information from the knowledge graph.
|
||||
|
||||
<Note>
|
||||
Learn more in the [Graph Memory documentation](/platform/features/graph-memory).
|
||||
</Note>
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
memories = m.get_all(
|
||||
filters={
|
||||
"user_id": "alex"
|
||||
},
|
||||
output_format="v1.1"
|
||||
)
|
||||
```
|
||||
|
||||
```python Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "f4cbdb08-7062-4f3e-8eb2-9f5c80dfe64c",
|
||||
"memory": "Alex is planning a trip to San Francisco",
|
||||
"entities": [
|
||||
{
|
||||
"id": "entity-1",
|
||||
"name": "Alex",
|
||||
"type": "person"
|
||||
},
|
||||
{
|
||||
"id": "entity-2",
|
||||
"name": "San Francisco",
|
||||
"type": "location"
|
||||
}
|
||||
],
|
||||
"relations": [
|
||||
{
|
||||
"source": "entity-1",
|
||||
"target": "entity-2",
|
||||
"relationship": "traveling_to"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
---
|
||||
title: Organizations & Projects
|
||||
icon: "building"
|
||||
description: "Manage multi-tenant applications with organization and project APIs"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Organizations and projects provide multi-tenant support, access control, and team collaboration capabilities for Mem0 Platform. Use these APIs to build applications that support multiple teams, customers, or isolated environments.
|
||||
|
||||
<Info>
|
||||
Organizations and projects are **optional** features. You can use Mem0 without them for single-user or simple multi-user applications.
|
||||
</Info>
|
||||
|
||||
## Key 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
|
||||
|
||||
---
|
||||
|
||||
## Using Organizations & Projects
|
||||
|
||||
### Initialize with Org/Project Context
|
||||
|
||||
Example with the mem0 Python package:
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
```python
|
||||
from mem0 import MemoryClient
|
||||
client = MemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
```
|
||||
|
||||
</Tab>
|
||||
|
||||
<Tab title="Node.js">
|
||||
|
||||
```javascript
|
||||
import { MemoryClient } from "mem0ai";
|
||||
const client = new MemoryClient({
|
||||
organizationId: "YOUR_ORG_ID",
|
||||
projectId: "YOUR_PROJECT_ID"
|
||||
});
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
---
|
||||
|
||||
## Project Management
|
||||
|
||||
The Mem0 client provides comprehensive project management through the `client.project` interface:
|
||||
|
||||
### Get Project Details
|
||||
|
||||
Retrieve information about the current project:
|
||||
|
||||
```python
|
||||
# Get all project details
|
||||
project_info = client.project.get()
|
||||
|
||||
# Get specific fields only
|
||||
project_info = client.project.get(fields=["name", "description", "custom_categories"])
|
||||
```
|
||||
|
||||
### Create a New Project
|
||||
|
||||
Create a new project within your organization:
|
||||
|
||||
```python
|
||||
# Create a project with name and description
|
||||
new_project = client.project.create(
|
||||
name="My New Project",
|
||||
description="A project for managing customer support memories"
|
||||
)
|
||||
```
|
||||
|
||||
### Update Project Settings
|
||||
|
||||
Modify project configuration including custom instructions, categories, and graph settings:
|
||||
|
||||
```python
|
||||
# Update project with custom categories
|
||||
client.project.update(
|
||||
custom_categories=[
|
||||
{"customer_preferences": "Customer likes, dislikes, and preferences"},
|
||||
{"support_history": "Previous support interactions and resolutions"}
|
||||
]
|
||||
)
|
||||
|
||||
# Update project with custom instructions
|
||||
client.project.update(
|
||||
custom_instructions="..."
|
||||
)
|
||||
|
||||
# Enable graph memory for the project
|
||||
client.project.update(enable_graph=True)
|
||||
|
||||
# Update multiple settings at once
|
||||
client.project.update(
|
||||
custom_instructions="...",
|
||||
custom_categories=[
|
||||
{"personal_info": "User personal information and preferences"},
|
||||
{"work_context": "Professional context and work-related information"}
|
||||
],
|
||||
enable_graph=True
|
||||
)
|
||||
```
|
||||
|
||||
### Delete Project
|
||||
|
||||
<Warning>
|
||||
This action will remove all memories, messages, and other related data in the project. **This operation is irreversible.**
|
||||
</Warning>
|
||||
|
||||
Remove a project and all its associated data:
|
||||
|
||||
```python
|
||||
# Delete the current project (irreversible)
|
||||
result = client.project.delete()
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Member Management
|
||||
|
||||
Manage project members and their access levels:
|
||||
|
||||
```python
|
||||
# Get all project members
|
||||
members = client.project.get_members()
|
||||
|
||||
# Add a new member as a reader
|
||||
client.project.add_member(
|
||||
email="colleague@company.com",
|
||||
role="READER" # or "OWNER"
|
||||
)
|
||||
|
||||
# Update a member's role
|
||||
client.project.update_member(
|
||||
email="colleague@company.com",
|
||||
role="OWNER"
|
||||
)
|
||||
|
||||
# Remove a member from the project
|
||||
client.project.remove_member(email="colleague@company.com")
|
||||
```
|
||||
|
||||
### Member Roles
|
||||
|
||||
| Role | 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
|
||||
|
||||
All project methods are available in async mode:
|
||||
|
||||
```python
|
||||
from mem0 import AsyncMemoryClient
|
||||
|
||||
async def manage_project():
|
||||
client = AsyncMemoryClient(org_id='YOUR_ORG_ID', project_id='YOUR_PROJECT_ID')
|
||||
|
||||
# All methods support async/await
|
||||
project_info = await client.project.get()
|
||||
await client.project.update(enable_graph=True)
|
||||
members = await client.project.get_members()
|
||||
|
||||
# To call the async function properly
|
||||
import asyncio
|
||||
asyncio.run(manage_project())
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## API Reference
|
||||
|
||||
For complete API specifications and additional endpoints, see:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Organizations APIs" icon="building" href="/api-reference/organization/create-org">
|
||||
Create, get, and manage organizations
|
||||
</Card>
|
||||
|
||||
<Card title="Project APIs" icon="folder" href="/api-reference/project/create-project">
|
||||
Full project CRUD and member management endpoints
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -7,6 +7,41 @@ mode: "wide"
|
||||
<Tabs>
|
||||
<Tab title="Python">
|
||||
|
||||
<Update label="2025-10-16" description="v1.0.0">
|
||||
|
||||
**New Features & Updates:**
|
||||
- **Vector Stores:**
|
||||
- Added Azure MySQL support
|
||||
- Added Azure AI Search Vector Store support
|
||||
- **LLMs:**
|
||||
- Added Tool Call support for LangchainLLM
|
||||
- Enabled custom model and parameters for Hugging Face with huggingface_base_url
|
||||
- Updated default LLM configuration
|
||||
- **Rerankers:**
|
||||
- Added reranker support: Cohere, ZeroEntropy, Hugging Face, Sentence Transformers, and LLMs
|
||||
- **Core:**
|
||||
- Added metadata filtering for OSS
|
||||
- Added Assistant memory retrieval
|
||||
- Enabled async mode as default
|
||||
|
||||
**Improvements:**
|
||||
- **Prompts:**
|
||||
- Improved prompt for better memory retrieval
|
||||
- **Dependencies:**
|
||||
- Updated dependency compatibility with OpenAI 2.x
|
||||
- **Validation:**
|
||||
- Validated embedding_dims for Kuzu integration
|
||||
|
||||
**Bug Fixes:**
|
||||
- **Vector Stores:**
|
||||
- Fixed Databricks Vector Store integration
|
||||
- Fixed Milvus DB bug and added test coverage
|
||||
- Fixed Weaviate search method
|
||||
- **LLMs:**
|
||||
- Fixed bug with thinking LLM in vLLM
|
||||
|
||||
</Update>
|
||||
|
||||
<Update label="2025-09-25" description="v0.1.118">
|
||||
|
||||
**New Features & Updates:**
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Configurations
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 offers support for various embedding models, allowing users to choose the one that best suits their needs.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Configurations
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## How to define configurations?
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 includes built-in support for various popular large language models. Memory can utilize the LLM provided by the user, ensuring efficient use for specific needs.
|
||||
|
||||
@@ -1,73 +1,71 @@
|
||||
---
|
||||
title: Config
|
||||
description: 'Configuration options for rerankers in Mem0'
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
description: "Configuration options for rerankers in Mem0"
|
||||
---
|
||||
|
||||
## Common Configuration Parameters
|
||||
|
||||
All rerankers share these common configuration parameters:
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `provider` | Reranker provider name | `str` | Required |
|
||||
| `top_k` | Maximum number of results to return after reranking | `int` | `None` |
|
||||
| `api_key` | API key for the reranker service | `str` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| ---------- | --------------------------------------------------- | ----- | -------- |
|
||||
| `provider` | Reranker provider name | `str` | Required |
|
||||
| `top_k` | Maximum number of results to return after reranking | `int` | `None` |
|
||||
| `api_key` | API key for the reranker service | `str` | `None` |
|
||||
|
||||
## Provider-Specific Configuration
|
||||
|
||||
### Zero Entropy
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | Model to use: `zerank-1` or `zerank-1-small` | `str` | `"zerank-1"` |
|
||||
| `api_key` | Zero Entropy API key | `str` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| --------- | -------------------------------------------- | ----- | ------------ |
|
||||
| `model` | Model to use: `zerank-1` or `zerank-1-small` | `str` | `"zerank-1"` |
|
||||
| `api_key` | Zero Entropy API key | `str` | `None` |
|
||||
|
||||
### Cohere
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | Cohere rerank model | `str` | `"rerank-english-v3.0"` |
|
||||
| `api_key` | Cohere API key | `str` | `None` |
|
||||
| `return_documents` | Whether to return document texts in response | `bool` | `False` |
|
||||
| `max_chunks_per_doc` | Maximum chunks per document | `int` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| -------------------- | -------------------------------------------- | ------ | ----------------------- |
|
||||
| `model` | Cohere rerank model | `str` | `"rerank-english-v3.0"` |
|
||||
| `api_key` | Cohere API key | `str` | `None` |
|
||||
| `return_documents` | Whether to return document texts in response | `bool` | `False` |
|
||||
| `max_chunks_per_doc` | Maximum chunks per document | `int` | `None` |
|
||||
|
||||
### Sentence Transformer
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | HuggingFace cross-encoder model name | `str` | `"cross-encoder/ms-marco-MiniLM-L-6-v2"` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
| `batch_size` | Batch size for processing | `int` | `32` |
|
||||
| `show_progress_bar` | Show progress during processing | `bool` | `False` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| ------------------- | -------------------------------------------- | ------ | ---------------------------------------- |
|
||||
| `model` | HuggingFace cross-encoder model name | `str` | `"cross-encoder/ms-marco-MiniLM-L-6-v2"` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
| `batch_size` | Batch size for processing | `int` | `32` |
|
||||
| `show_progress_bar` | Show progress during processing | `bool` | `False` |
|
||||
|
||||
### Hugging Face
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | HuggingFace reranker model name | `str` | `"BAAI/bge-reranker-large"` |
|
||||
| `api_key` | HuggingFace API token | `str` | `None` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| --------- | -------------------------------------------- | ----- | --------------------------- |
|
||||
| `model` | HuggingFace reranker model name | `str` | `"BAAI/bge-reranker-large"` |
|
||||
| `api_key` | HuggingFace API token | `str` | `None` |
|
||||
| `device` | Device to run model on (`cpu`, `cuda`, etc.) | `str` | `None` |
|
||||
|
||||
### LLM-based
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | LLM model to use for scoring | `str` | `"gpt-4o-mini"` |
|
||||
| `provider` | LLM provider (`openai`, `anthropic`, etc.) | `str` | `"openai"` |
|
||||
| `api_key` | API key for LLM provider | `str` | `None` |
|
||||
| `temperature` | Temperature for LLM generation | `float` | `0.0` |
|
||||
| `max_tokens` | Maximum tokens for LLM response | `int` | `100` |
|
||||
| `scoring_prompt` | Custom prompt template for scoring | `str` | Default scoring prompt |
|
||||
| Parameter | Description | Type | Default |
|
||||
| ---------------- | ------------------------------------------ | ------- | ---------------------- |
|
||||
| `model` | LLM model to use for scoring | `str` | `"gpt-4o-mini"` |
|
||||
| `provider` | LLM provider (`openai`, `anthropic`, etc.) | `str` | `"openai"` |
|
||||
| `api_key` | API key for LLM provider | `str` | `None` |
|
||||
| `temperature` | Temperature for LLM generation | `float` | `0.0` |
|
||||
| `max_tokens` | Maximum tokens for LLM response | `int` | `100` |
|
||||
| `scoring_prompt` | Custom prompt template for scoring | `str` | Default scoring prompt |
|
||||
|
||||
### LLM Reranker
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `llm.provider` | LLM provider for reranking | `str` | Required |
|
||||
| `llm.config` | LLM configuration object | `dict` | Required |
|
||||
| `top_n` | Number of results to return | `int` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| -------------- | --------------------------- | ------ | -------- |
|
||||
| `llm.provider` | LLM provider for reranking | `str` | Required |
|
||||
| `llm.config` | LLM configuration object | `dict` | Required |
|
||||
| `top_n` | Number of results to return | `int` | `None` |
|
||||
|
||||
## Environment Variables
|
||||
|
||||
@@ -93,7 +91,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini"
|
||||
"model": "gpt-4.1-nano-2025-04-14"
|
||||
}
|
||||
},
|
||||
"rerank": {
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Custom Prompts
|
||||
icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
When using LLM rerankers, you can customize the prompts used for ranking to better suit your specific use case and domain.
|
||||
@@ -54,7 +52,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4",
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"api_key": "your-openai-key"
|
||||
}
|
||||
},
|
||||
@@ -71,16 +69,17 @@ memory = Memory.from_config(config)
|
||||
|
||||
Your custom prompt can use the following variables:
|
||||
|
||||
| Variable | Description |
|
||||
|----------|-------------|
|
||||
| `{query}` | The search query |
|
||||
| `{memories}` | The list of memory entries to rank |
|
||||
| `{user_id}` | The user ID (if available) |
|
||||
| Variable | Description |
|
||||
| ---------------- | ------------------------------------- |
|
||||
| `{query}` | The search query |
|
||||
| `{memories}` | The list of memory entries to rank |
|
||||
| `{user_id}` | The user ID (if available) |
|
||||
| `{user_context}` | Additional user context (if provided) |
|
||||
|
||||
## Domain-Specific Examples
|
||||
|
||||
### Customer Support
|
||||
|
||||
```python
|
||||
customer_support_prompt = """
|
||||
You are ranking customer support conversation memories.
|
||||
@@ -100,6 +99,7 @@ Rank each memory 1-10 based on support relevance.
|
||||
```
|
||||
|
||||
### Educational Content
|
||||
|
||||
```python
|
||||
educational_prompt = """
|
||||
Rank these learning memories for a student query.
|
||||
@@ -119,6 +119,7 @@ Score each memory for educational value (1-10).
|
||||
```
|
||||
|
||||
### Personal Assistant
|
||||
|
||||
```python
|
||||
personal_assistant_prompt = """
|
||||
Rank personal memories for relevance to the user's query.
|
||||
@@ -140,6 +141,7 @@ Provide relevance scores (1-10) with brief explanations.
|
||||
## Advanced Prompt Techniques
|
||||
|
||||
### Multi-Criteria Ranking
|
||||
|
||||
```python
|
||||
multi_criteria_prompt = """
|
||||
Evaluate memories using multiple criteria:
|
||||
@@ -165,6 +167,7 @@ Format: JSON with detailed scoring
|
||||
```
|
||||
|
||||
### Contextual Ranking
|
||||
|
||||
```python
|
||||
contextual_prompt = """
|
||||
Consider the following context when ranking memories:
|
||||
@@ -214,4 +217,4 @@ for i, prompt in enumerate(prompts):
|
||||
- **Too Long**: Keep prompts under token limits for your chosen LLM
|
||||
- **Too Vague**: Be specific about ranking criteria
|
||||
- **Inconsistent Format**: Ensure JSON output format is clearly specified
|
||||
- **Missing Context**: Include relevant variables for your use case
|
||||
- **Missing Context**: Include relevant variables for your use case
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Cohere
|
||||
description: 'Reranking with Cohere'
|
||||
icon: "building"
|
||||
iconType: "solid"
|
||||
description: "Reranking with Cohere"
|
||||
---
|
||||
|
||||
Cohere provides enterprise-grade reranking models with excellent multilingual support and production-ready performance.
|
||||
@@ -37,7 +35,7 @@ config = {
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4o-mini"
|
||||
"model": "gpt-4.1-nano-2025-04-14"
|
||||
}
|
||||
},
|
||||
"reranker": {
|
||||
@@ -124,13 +122,13 @@ config = {
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
| Parameter | Description | Type | Default |
|
||||
|-----------|-------------|------|---------|
|
||||
| `model` | Cohere rerank model to use | `str` | `"rerank-english-v3.0"` |
|
||||
| `api_key` | Cohere API key | `str` | `None` |
|
||||
| `top_k` | Maximum documents to return | `int` | `None` |
|
||||
| `return_documents` | Whether to return document texts | `bool` | `False` |
|
||||
| `max_chunks_per_doc` | Maximum chunks per document | `int` | `None` |
|
||||
| Parameter | Description | Type | Default |
|
||||
| -------------------- | -------------------------------- | ------ | ----------------------- |
|
||||
| `model` | Cohere rerank model to use | `str` | `"rerank-english-v3.0"` |
|
||||
| `api_key` | Cohere API key | `str` | `None` |
|
||||
| `top_k` | Maximum documents to return | `int` | `None` |
|
||||
| `return_documents` | Whether to return document texts | `bool` | `False` |
|
||||
| `max_chunks_per_doc` | Maximum chunks per document | `int` | `None` |
|
||||
|
||||
## Features
|
||||
|
||||
@@ -144,4 +142,4 @@ config = {
|
||||
1. **Model Selection**: Use `rerank-english-v3.0` for English, `rerank-multilingual-v3.0` for other languages
|
||||
2. **Batch Processing**: Process multiple queries efficiently
|
||||
3. **Error Handling**: Implement retry logic for production systems
|
||||
4. **Monitoring**: Track reranking performance and costs
|
||||
4. **Monitoring**: Track reranking performance and costs
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Hugging Face Reranker
|
||||
description: 'Access thousands of reranking models from Hugging Face Hub'
|
||||
icon: "face-smile"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: LLM as Reranker
|
||||
description: 'Flexible reranking using LLMs'
|
||||
icon: "robot"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
LLM-based reranker provides maximum flexibility by using any Large Language Model to score document relevance. This approach allows for custom prompts and domain-specific scoring logic.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: LLM Reranker
|
||||
description: 'Use any language model as a reranker with custom prompts'
|
||||
icon: "robot"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Sentence Transformer
|
||||
description: 'Local reranking with HuggingFace cross-encoder models'
|
||||
icon: "server"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Sentence Transformer reranker provides local reranking using HuggingFace cross-encoder models, perfect for privacy-focused deployments where you want to keep data on-premises.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Zero Entropy
|
||||
description: 'Neural reranking with Zero Entropy'
|
||||
icon: "sparkles"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
[Zero Entropy](https://www.zeroentropy.dev) provides neural reranking models that significantly improve search relevance with fast performance.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Performance Optimization
|
||||
icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Optimizing reranker performance is crucial for maintaining fast search response times while improving result quality. This guide covers best practices for different reranker types.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "arrow-up-arrow-down"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 includes built-in support for various reranking providers to improve the relevance of memory search results. Rerankers post-process initial vector search results by re-scoring and re-ordering them using more sophisticated relevance models.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Configurations
|
||||
icon: "gear"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## How to define configurations?
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 includes built-in support for various popular databases. Memory can utilize the database provided by the user, ensuring efficient use for specific needs.
|
||||
@@ -51,4 +49,3 @@ If you are using a customized model with different dimensions other than 1536 (f
|
||||
`ValueError: shapes (0,1536) and (768,) not aligned: 1536 (dim 1) != 768 (dim 0)`
|
||||
|
||||
You can add `"embedding_model_dims": 768,` to the config of the vector_store to resolve this issue.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Update Memory
|
||||
description: Modify an existing memory by updating its content or metadata.
|
||||
icon: "pencil"
|
||||
icon: "pen-to-square"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
|
||||
+764
-667
File diff suppressed because it is too large
Load Diff
+55
-100
@@ -1,116 +1,71 @@
|
||||
---
|
||||
title: Introduction
|
||||
icon: "book"
|
||||
iconType: "solid"
|
||||
title: "Welcome to Mem0"
|
||||
description: "Memory layer for AI agents"
|
||||
mode: "custom"
|
||||
---
|
||||
|
||||
<Info>
|
||||
Check out our [research paper](https://mem0.ai/research) to learn about the technical foundations and innovations behind Mem0's memory architecture.
|
||||
</Info>
|
||||
{/* debug: welcome-layout-v2 */}
|
||||
|
||||
Mem0 is a memory layer designed for modern AI agents. It acts as a persistent memory layer that agents can use to:
|
||||
<div className="px-4 pt-16 pb-12 lg:pt-20 max-w-4xl mx-auto text-center space-y-4">
|
||||
<h1 className="text-3xl lg:text-4xl font-bold text-gray-900 dark:text-zinc-50 tracking-tight mb-3">
|
||||
Build with <span className="text-primary">mem0</span>
|
||||
</h1>
|
||||
|
||||
- Recall relevant past interactions
|
||||
- Store important user preferences and factual context
|
||||
- Learn from successes and failures
|
||||
<p className="max-w-2xl mx-auto text-base text-gray-600 dark:text-zinc-400 leading-relaxed">
|
||||
Universal, Self-improving memory layer for LLM applications.
|
||||
</p>
|
||||
|
||||
It gives AI agents memory so they can remember, learn, and evolve across interactions. Mem0 integrates easily into your agent stack and scales from prototypes to production systems.
|
||||
<a
|
||||
href="/platform/quickstart"
|
||||
className="inline-flex items-center gap-1 text-sm text-gray-500 dark:text-zinc-500 hover:text-primary dark:hover:text-primary transition-colors"
|
||||
>
|
||||
Write your first memory
|
||||
<span className="group-hover:translate-x-0.5 transition-transform">→</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<section className="px-4 max-w-6xl mx-auto space-y-4">
|
||||
<div className="text-center">
|
||||
<h2 className="text-xl font-semibold text-gray-900 dark:text-zinc-100">
|
||||
Mem0 Products
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
## Stateless vs. Stateful Agents
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Mem0 Platform" icon="rocket" href="/platform/overview">
|
||||
Managed memory with production-scale infrastructure, ready in minutes.
|
||||
</Card>
|
||||
|
||||
Most current agents are stateless: they process a query, generate a response, and forget everything. Even with huge context windows, everything resets the next session.
|
||||
<Card title="Mem0 Open Source" icon="code-branch" href="/open-source/overview">
|
||||
Self-host the Mem0 stack for full control over data, deployment, and customization.
|
||||
</Card>
|
||||
|
||||
Stateful agents, powered by Mem0, are different. They retain context, recall what matters, and behave more intelligently over time.
|
||||
<Card title="OpenMemory" icon="brain" href="/openmemory/overview">
|
||||
Workspace-based memory for teams collaborating across agents and projects.
|
||||
</Card>
|
||||
|
||||
<Frame>
|
||||
<img src="/images/stateless-vs-stateful-agent.png" />
|
||||
</Frame>
|
||||
</CardGroup>
|
||||
</section>
|
||||
|
||||
<section className="px-4 pt-12 pb-20 max-w-6xl mx-auto space-y-4">
|
||||
<div className="text-center">
|
||||
<h2 className="text-xl font-semibold text-gray-900 dark:text-zinc-100">
|
||||
Developer Resources
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
## Where Memory Fits in the Agent Stack
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Cookbooks" icon="book-open" href="/examples">
|
||||
Production-ready tutorials that show how to ship memorable AI experiences.
|
||||
</Card>
|
||||
|
||||
Mem0 sits alongside your retriever, planner, and LLM. Unlike retrieval-based systems (like RAG), Mem0 tracks past interactions, stores long-term knowledge, and evolves the agent’s behavior.
|
||||
<Card title="Integrations" icon="plug" href="/integrations">
|
||||
Connect Mem0 to LangChain, CrewAI, Vercel AI SDK, and 20+ partner frameworks.
|
||||
</Card>
|
||||
|
||||
<Frame>
|
||||
<img src="/images/memory-agent-stack.png" />
|
||||
</Frame>
|
||||
<Card title="API reference" icon="terminal" href="/api-reference">
|
||||
Explore every REST endpoint with payload examples and usage guidance.
|
||||
</Card>
|
||||
|
||||
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 |
|
||||
|------------------|------------------------|-----------------------------|
|
||||
| Retention | Temporary | Persistent |
|
||||
| Cost | Grows with input size | Optimized (only what matters) |
|
||||
| Recall | Token proximity | Relevance + intent-based |
|
||||
| Personalization | None | Deep, evolving profile |
|
||||
| Behavior | Reactive | Adaptive |
|
||||
|
||||
|
||||
## Memory vs. RAG: Complementary Tools
|
||||
|
||||
RAG (Retrieval-Augmented Generation) is great for fetching facts from documents. But it’s stateless. It doesn’t know who the user is, what they’ve asked before, or what failed last time.
|
||||
|
||||
Mem0 provides continuity. It stores decisions, preferences, and context—not just knowledge.
|
||||
|
||||
| Aspect | RAG | Mem0 Memory |
|
||||
|--------------------|-------------------------------|-------------------------------|
|
||||
| Statefulness | Stateless | Stateful |
|
||||
| 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 while Mem0 shapes its memory.
|
||||
|
||||
|
||||
## Types of Memory in Mem0
|
||||
|
||||
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)
|
||||
- **Episodic Memory**: records specific past conversations
|
||||
- **Semantic Memory**: builds general knowledge over time
|
||||
|
||||
|
||||
## Why Developers Choose Mem0
|
||||
|
||||
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
|
||||
- **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
|
||||
|
||||
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
|
||||
|
||||
- **Reduced token usage and faster responses**: sub-50 ms lookups
|
||||
- **Semantic memory**: procedural, episodic, and factual support
|
||||
- **Multimodal support**: handle both text and images
|
||||
- **Graph memory**: connect insights and entities across sessions
|
||||
- **Host your way**: either a managed service or a self-hosted version
|
||||
|
||||
|
||||
## Getting Started
|
||||
Mem0 offers two powerful ways to leverage our technology: our [managed platform](/platform/overview) and our [open source solution](/open-source/overview).
|
||||
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Quickstart" icon="rocket" href="/quickstart">
|
||||
Integrate Mem0 in a few lines of code
|
||||
</Card>
|
||||
<Card title="Playground" icon="play" href="https://app.mem0.ai/playground">
|
||||
Mem0 in action
|
||||
</Card>
|
||||
<Card title="Examples" icon="lightbulb" href="/examples">
|
||||
See what you can build with Mem0
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Need help?
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx"/>
|
||||
</CardGroup>
|
||||
</section>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<svg width="307" height="307" viewBox="0 0 307 307" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M162.496 25.3505C165.003 25.3505 167.453 24.6071 169.538 23.2144C171.622 21.8216 173.247 19.8419 174.206 17.5258C175.165 15.2097 175.416 12.6612 174.927 10.2024C174.438 7.74365 173.231 5.48516 171.458 3.71249C169.686 1.93983 167.427 0.73263 164.968 0.243552C162.51 -0.245525 159.961 0.00550576 157.645 0.964866C155.329 1.92423 153.349 3.54885 151.956 5.63328C150.564 7.71772 149.82 10.1683 149.82 12.6753C149.818 14.3404 150.145 15.9895 150.781 17.5283C151.417 19.0671 152.351 20.4653 153.528 21.6427C154.706 22.8201 156.104 23.7537 157.643 24.39C159.181 25.0262 160.83 25.3526 162.496 25.3505Z" fill="white"/>
|
||||
<path d="M69.3342 56.559C71.1066 54.7862 72.3135 52.5277 72.8024 50.069C73.2913 47.6103 73.0401 45.0619 72.0807 42.7459C71.1213 40.43 69.4967 38.4505 67.4123 37.0579C65.3279 35.6652 62.8774 34.9219 60.3706 34.9219C57.8637 34.9219 55.4132 35.6652 53.3288 37.0579C51.2444 38.4505 49.6198 40.43 48.6604 42.7459C47.701 45.0619 47.4498 47.6103 47.9387 50.069C48.4276 52.5277 49.6345 54.7862 51.4069 56.559C52.5839 57.7363 53.9813 58.6701 55.5193 59.3073C57.0573 59.9444 58.7058 60.2724 60.3706 60.2724C62.0353 60.2724 63.6838 59.9444 65.2218 59.3073C66.7598 58.6701 68.1572 57.7363 69.3342 56.559Z" fill="white"/>
|
||||
<path d="M25.3505 144.504C25.3505 141.997 24.6071 139.547 23.2143 137.462C21.8216 135.378 19.842 133.753 17.5259 132.794C15.2098 131.835 12.6612 131.584 10.2024 132.073C7.74368 132.562 5.48513 133.769 3.71247 135.542C1.9398 137.314 0.732655 139.573 0.243578 142.032C-0.2455 144.49 0.00543354 147.039 0.964793 149.355C1.92415 151.671 3.54877 153.651 5.63321 155.044C7.71764 156.436 10.1683 157.18 12.6752 157.18C16.0369 157.18 19.261 155.844 21.638 153.467C24.0151 151.09 25.3505 147.866 25.3505 144.504Z" fill="white"/>
|
||||
<path d="M56.5589 237.749C54.7862 235.976 52.5277 234.769 50.069 234.28C47.6103 233.792 45.0619 234.043 42.7459 235.002C40.43 235.962 38.4505 237.586 37.0579 239.671C35.6652 241.755 34.9219 244.206 34.9219 246.712C34.9219 249.219 35.6652 251.67 37.0579 253.754C38.4505 255.838 40.43 257.463 42.7459 258.423C45.0619 259.382 47.6103 259.633 50.069 259.144C52.5277 258.655 54.7862 257.448 56.5589 255.676C57.7362 254.499 58.6701 253.102 59.3073 251.564C59.9444 250.026 60.2724 248.377 60.2724 246.712C60.2724 245.048 59.9444 243.399 59.3073 241.861C58.6701 240.323 57.7362 238.926 56.5589 237.749Z" fill="white"/>
|
||||
<path d="M144.488 281.648C141.981 281.648 139.53 282.392 137.446 283.785C135.361 285.177 133.737 287.157 132.777 289.473C131.818 291.789 131.567 294.338 132.056 296.797C132.545 299.255 133.752 301.514 135.525 303.286C137.298 305.059 139.556 306.266 142.015 306.755C144.474 307.244 147.022 306.993 149.338 306.034C151.655 305.075 153.634 303.45 155.027 301.366C156.42 299.281 157.163 296.831 157.163 294.324C157.159 290.963 155.822 287.742 153.446 285.366C151.07 282.989 147.848 281.653 144.488 281.648Z" fill="white"/>
|
||||
<path d="M237.751 250.487C235.978 252.26 234.771 254.518 234.282 256.977C233.794 259.435 234.045 261.984 235.004 264.3C235.964 266.616 237.588 268.595 239.673 269.988C241.757 271.381 244.207 272.124 246.714 272.124C249.221 272.124 251.672 271.381 253.756 269.988C255.84 268.595 257.465 266.616 258.424 264.3C259.384 261.984 259.635 259.435 259.146 256.977C258.657 254.518 257.45 252.26 255.678 250.487C254.501 249.31 253.104 248.376 251.566 247.739C250.028 247.101 248.379 246.773 246.714 246.773C245.05 246.773 243.401 247.101 241.863 247.739C240.325 248.376 238.928 249.31 237.751 250.487Z" fill="white"/>
|
||||
<path d="M281.648 162.512C281.648 165.019 282.392 167.469 283.785 169.554C285.177 171.638 287.157 173.263 289.473 174.222C291.789 175.181 294.338 175.432 296.797 174.943C299.255 174.454 301.514 173.247 303.286 171.474C305.059 169.702 306.266 167.443 306.755 164.984C307.244 162.526 306.993 159.977 306.034 157.661C305.075 155.345 303.45 153.365 301.366 151.973C299.281 150.58 296.831 149.836 294.324 149.836C290.962 149.836 287.738 151.172 285.361 153.549C282.984 155.926 281.648 159.15 281.648 162.512Z" fill="white"/>
|
||||
<path d="M250.471 69.3303C252.244 71.1027 254.503 72.3097 256.961 72.7985C259.42 73.2874 261.968 73.0363 264.284 72.0768C266.6 71.1174 268.58 69.4928 269.972 67.4084C271.365 65.324 272.108 62.8735 272.108 60.3667C272.108 57.8599 271.365 55.4093 269.972 53.3249C268.58 51.2406 266.6 49.616 264.284 48.6565C261.968 47.6971 259.42 47.4459 256.961 47.9348C254.503 48.4236 252.244 49.6306 250.471 51.403C249.294 52.58 248.36 53.9775 247.723 55.5155C247.086 57.0535 246.758 58.7019 246.758 60.3667C246.758 62.0314 247.086 63.6799 247.723 65.2179C248.36 66.7559 249.294 68.1533 250.471 69.3303Z" fill="white"/>
|
||||
<path d="M184.782 60.8054C180.168 63.4713 178.3 69.0427 177.63 74.3267C177.047 78.9358 175.033 83.2457 171.87 86.6488C168.707 90.052 164.556 92.3766 160.002 93.2951C155.448 94.2136 150.721 93.6796 146.487 91.7683C142.252 89.857 138.724 86.6649 136.401 82.642C134.077 78.6192 133.075 73.9684 133.535 69.3455C133.995 64.7226 135.895 60.3607 138.966 56.8748C142.037 53.389 146.125 50.9549 150.653 49.9159C155.181 48.8768 159.921 49.2852 164.204 51.0834C169.121 53.1428 174.884 54.2762 179.514 51.6422C184.143 49.0082 185.995 43.4049 186.665 38.1208C187.245 33.5107 189.257 29.1987 192.418 25.7931C195.579 22.3876 199.73 20.0603 204.284 19.1394C208.838 18.2185 213.567 18.7505 217.803 20.6605C222.039 22.5704 225.568 25.7618 227.893 29.7846C230.218 33.8075 231.222 38.4587 230.763 43.0824C230.303 47.7062 228.404 52.0691 225.333 55.5559C222.262 59.0426 218.173 61.4773 213.645 62.5165C209.116 63.5557 204.375 63.147 200.091 61.3481C195.174 59.3048 189.411 58.1554 184.782 60.8054Z" fill="white"/>
|
||||
<path d="M110.073 65.8178C108.7 70.9742 111.318 76.2422 114.575 80.4567C117.417 84.1261 119.036 88.595 119.204 93.2335C119.372 97.872 118.08 102.446 115.51 106.311C112.941 110.177 109.223 113.138 104.881 114.778C100.538 116.419 95.7912 116.655 91.3077 115.454C86.8242 114.253 82.8306 111.675 79.8898 108.084C76.9489 104.493 75.2091 100.07 74.9155 95.4379C74.6219 90.8057 75.7894 86.1981 78.2533 82.2645C80.7173 78.331 84.3534 75.2698 88.6494 73.5124C93.5822 71.485 98.4991 68.2444 99.8241 63.0881C101.149 57.9317 98.579 52.6637 95.3224 48.4493C92.4827 44.7781 90.8665 40.3083 90.7018 35.6699C90.537 31.0315 91.8319 26.4583 94.4039 22.5949C96.976 18.7314 100.695 15.7724 105.038 14.1349C109.381 12.4974 114.128 12.2639 118.611 13.4673C123.094 14.6708 127.085 17.2505 130.024 20.8429C132.963 24.4354 134.7 28.8594 134.991 33.4916C135.283 38.1237 134.113 42.7305 131.647 46.6627C129.182 50.5948 125.544 53.6541 121.248 55.4095C116.363 57.4209 111.462 60.6775 110.073 65.8178Z" fill="white"/>
|
||||
<path d="M60.7892 122.218C63.4552 126.831 69.0425 128.699 74.3265 129.37C78.9361 129.955 83.2455 131.973 86.6471 135.138C90.0487 138.304 92.3707 142.457 93.2857 147.013C94.2006 151.569 93.6625 156.296 91.747 160.53C89.8314 164.763 86.6353 168.288 82.6093 170.608C78.5833 172.928 73.9305 173.926 69.3073 173.46C64.6841 172.995 60.3236 171.09 56.841 168.014C53.3583 164.938 50.9292 160.846 49.8962 156.316C48.8631 151.785 49.2783 147.045 51.0832 142.763C53.1426 137.846 54.2759 132.083 51.6419 127.454C49.0079 122.824 43.4046 120.973 38.1047 120.302C33.4951 119.717 29.1856 117.699 25.7841 114.533C22.3825 111.368 20.0604 107.214 19.1454 102.659C18.2304 98.1032 18.7687 93.3752 20.6842 89.1418C22.5997 84.9084 25.7959 81.3832 29.8219 79.0632C33.8479 76.7433 38.5006 75.7457 43.1238 76.2113C47.7471 76.6768 52.1075 78.582 55.5902 81.658C59.0728 84.7341 61.502 88.8258 62.535 93.3561C63.568 97.8865 63.1528 102.627 61.3479 106.908C59.2886 111.825 58.1552 117.588 60.7892 122.218Z" fill="white"/>
|
||||
<path d="M65.8204 196.93C70.9767 198.303 76.2287 195.685 80.4592 192.428C84.1286 189.586 88.5975 187.967 93.236 187.799C97.8745 187.631 102.449 188.923 106.314 191.493C110.179 194.062 113.141 197.78 114.781 202.122C116.421 206.464 116.657 211.212 115.457 215.695C114.256 220.179 111.678 224.172 108.087 227.113C104.496 230.054 100.073 231.794 95.4404 232.087C90.8082 232.381 86.2006 231.214 82.2671 228.75C78.3335 226.286 75.2723 222.649 73.5149 218.353C71.4875 213.421 68.231 208.504 63.0906 207.179C57.9503 205.854 52.6662 208.424 48.4518 211.681C44.7804 214.528 40.308 216.151 35.6652 216.32C31.0224 216.49 26.4435 215.199 22.5738 212.628C18.7042 210.057 15.7391 206.336 14.0968 201.99C12.4544 197.644 12.2176 192.892 13.4197 188.404C14.6218 183.917 17.2021 179.919 20.7969 176.976C24.3917 174.033 28.8195 172.293 33.4562 172C38.0929 171.708 42.7045 172.878 46.6407 175.345C50.577 177.813 53.6394 181.454 55.3961 185.755C57.4235 190.656 60.6641 195.541 65.8204 196.93Z" fill="white"/>
|
||||
<path d="M122.205 246.21C126.818 243.544 128.686 237.956 129.373 232.672C129.96 228.068 131.978 223.763 135.142 220.366C138.306 216.969 142.456 214.651 147.008 213.738C151.559 212.825 156.283 213.364 160.512 215.278C164.741 217.192 168.263 220.385 170.58 224.408C172.898 228.43 173.895 233.078 173.43 237.697C172.966 242.316 171.064 246.673 167.991 250.153C164.919 253.633 160.832 256.061 156.306 257.095C151.781 258.129 147.045 257.717 142.766 255.916C137.833 253.856 132.07 252.723 127.457 255.357C122.843 257.991 120.96 263.594 120.289 268.894C119.7 273.498 117.681 277.8 114.517 281.196C111.353 284.591 107.204 286.908 102.653 287.821C98.1027 288.733 93.3808 288.194 89.1525 286.281C84.9243 284.367 81.4031 281.175 79.085 277.154C76.767 273.134 75.7689 268.487 76.2316 263.869C76.6942 259.251 78.5942 254.895 81.6638 251.414C84.7334 247.933 88.8179 245.503 93.3417 244.466C97.8655 243.429 102.601 243.838 106.88 245.635C111.828 247.694 117.591 248.876 122.205 246.21Z" fill="white"/>
|
||||
<path d="M196.915 241.18C198.304 236.024 195.686 230.756 192.414 226.542C189.567 222.87 187.944 218.398 187.774 213.755C187.604 209.112 188.896 204.533 191.467 200.664C194.038 196.794 197.759 193.829 202.104 192.187C206.45 190.544 211.202 190.307 215.69 191.509C220.178 192.712 224.175 195.292 227.118 198.887C230.061 202.481 231.802 206.909 232.094 211.546C232.387 216.183 231.217 220.794 228.749 224.731C226.281 228.667 222.64 231.729 218.339 233.486C213.406 235.513 208.505 238.77 207.164 243.91C205.823 249.051 208.393 254.335 211.666 258.549C214.513 262.22 216.136 266.693 216.306 271.335C216.476 275.978 215.184 280.557 212.613 284.427C210.042 288.297 206.321 291.262 201.975 292.904C197.629 294.546 192.877 294.783 188.39 293.581C183.902 292.379 179.905 289.799 176.962 286.204C174.019 282.609 172.278 278.181 171.985 273.545C171.693 268.908 172.863 264.296 175.331 260.36C177.799 256.424 181.44 253.361 185.741 251.605C190.658 249.577 195.543 246.337 196.915 241.18Z" fill="white"/>
|
||||
<path d="M246.195 184.797C243.529 180.184 237.957 178.316 232.673 177.629C228.069 177.045 223.764 175.03 220.365 171.869C216.967 168.708 214.646 164.56 213.729 160.01C212.813 155.46 213.348 150.737 215.258 146.507C217.168 142.277 220.357 138.753 224.376 136.431C228.395 134.11 233.041 133.108 237.66 133.567C242.279 134.026 246.637 135.923 250.12 138.991C253.604 142.058 256.037 146.141 257.077 150.664C258.117 155.188 257.711 159.923 255.917 164.204C253.857 169.137 252.724 174.9 255.342 179.513C257.96 184.127 263.595 186.01 268.879 186.681C273.484 187.267 277.789 189.283 281.186 192.446C284.584 195.608 286.904 199.757 287.819 204.308C288.733 208.859 288.197 213.582 286.285 217.811C284.372 222.041 281.181 225.564 277.16 227.884C273.14 230.203 268.492 231.203 263.874 230.741C259.255 230.279 254.897 228.379 251.416 225.31C247.934 222.24 245.503 218.155 244.466 213.63C243.429 209.106 243.838 204.37 245.636 200.09C247.695 195.173 248.861 189.411 246.195 184.797Z" fill="white"/>
|
||||
<path d="M241.18 110.07C236.024 108.697 230.756 111.315 226.542 114.588C222.87 117.435 218.398 119.058 213.755 119.228C209.112 119.398 204.533 118.106 200.664 115.535C196.794 112.964 193.829 109.243 192.187 104.897C190.544 100.551 190.307 95.7994 191.509 91.3117C192.712 86.824 195.292 82.8268 198.887 79.8837C202.481 76.9405 206.909 75.2 211.546 74.9073C216.183 74.6147 220.794 75.7849 224.731 78.2527C228.667 80.7206 231.729 84.3617 233.486 88.6627C235.513 93.5955 238.754 98.4964 243.91 99.8374C249.066 101.178 254.335 98.6082 258.549 95.3356C262.22 92.4959 266.69 90.8798 271.328 90.7151C275.967 90.5503 280.54 91.8452 284.403 94.4172C288.267 96.9892 291.226 100.709 292.863 105.052C294.501 109.394 294.734 114.142 293.531 118.624C292.327 123.107 289.748 127.099 286.155 130.037C282.563 132.976 278.139 134.714 273.507 135.005C268.875 135.296 264.268 134.126 260.336 131.661C256.403 129.195 253.344 125.557 251.589 121.261C249.577 116.36 246.321 111.459 241.18 110.07Z" fill="white"/>
|
||||
<path d="M153.491 191.533C174.501 191.533 191.533 174.501 191.533 153.491C191.533 132.482 174.501 115.45 153.491 115.45C132.481 115.45 115.449 132.482 115.449 153.491C115.449 174.501 132.481 191.533 153.491 191.533Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,19 @@
|
||||
<svg width="307" height="307" viewBox="0 0 307 307" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M162.496 25.3505C165.003 25.3505 167.453 24.6071 169.538 23.2144C171.622 21.8216 173.247 19.8419 174.206 17.5258C175.165 15.2097 175.416 12.6612 174.927 10.2024C174.438 7.74365 173.231 5.48516 171.458 3.71249C169.686 1.93983 167.427 0.73263 164.968 0.243552C162.51 -0.245525 159.961 0.00550576 157.645 0.964866C155.329 1.92423 153.349 3.54885 151.956 5.63328C150.564 7.71772 149.82 10.1683 149.82 12.6753C149.818 14.3404 150.145 15.9895 150.781 17.5283C151.417 19.0671 152.351 20.4653 153.528 21.6427C154.706 22.8201 156.104 23.7537 157.643 24.39C159.181 25.0262 160.83 25.3526 162.496 25.3505Z" fill="#9C58FA"/>
|
||||
<path d="M69.3342 56.559C71.1066 54.7862 72.3135 52.5277 72.8024 50.069C73.2913 47.6103 73.0401 45.0619 72.0807 42.7459C71.1213 40.43 69.4967 38.4505 67.4123 37.0579C65.3279 35.6652 62.8774 34.9219 60.3706 34.9219C57.8637 34.9219 55.4132 35.6652 53.3288 37.0579C51.2444 38.4505 49.6198 40.43 48.6604 42.7459C47.701 45.0619 47.4498 47.6103 47.9387 50.069C48.4276 52.5277 49.6345 54.7862 51.4069 56.559C52.5839 57.7363 53.9813 58.6701 55.5193 59.3073C57.0573 59.9444 58.7058 60.2724 60.3706 60.2724C62.0353 60.2724 63.6838 59.9444 65.2218 59.3073C66.7598 58.6701 68.1572 57.7363 69.3342 56.559Z" fill="#9C58FA"/>
|
||||
<path d="M25.3505 144.504C25.3505 141.997 24.6071 139.547 23.2143 137.462C21.8216 135.378 19.842 133.753 17.5259 132.794C15.2098 131.835 12.6612 131.584 10.2024 132.073C7.74368 132.562 5.48513 133.769 3.71247 135.542C1.9398 137.314 0.732655 139.573 0.243578 142.032C-0.2455 144.49 0.00543354 147.039 0.964793 149.355C1.92415 151.671 3.54877 153.651 5.63321 155.044C7.71764 156.436 10.1683 157.18 12.6752 157.18C16.0369 157.18 19.261 155.844 21.638 153.467C24.0151 151.09 25.3505 147.866 25.3505 144.504Z" fill="#9C58FA"/>
|
||||
<path d="M56.5589 237.749C54.7862 235.976 52.5277 234.769 50.069 234.28C47.6103 233.792 45.0619 234.043 42.7459 235.002C40.43 235.962 38.4505 237.586 37.0579 239.671C35.6652 241.755 34.9219 244.206 34.9219 246.712C34.9219 249.219 35.6652 251.67 37.0579 253.754C38.4505 255.838 40.43 257.463 42.7459 258.423C45.0619 259.382 47.6103 259.633 50.069 259.144C52.5277 258.655 54.7862 257.448 56.5589 255.676C57.7362 254.499 58.6701 253.102 59.3073 251.564C59.9444 250.026 60.2724 248.377 60.2724 246.712C60.2724 245.048 59.9444 243.399 59.3073 241.861C58.6701 240.323 57.7362 238.926 56.5589 237.749Z" fill="#9C58FA"/>
|
||||
<path d="M144.488 281.648C141.981 281.648 139.53 282.392 137.446 283.785C135.361 285.177 133.737 287.157 132.777 289.473C131.818 291.789 131.567 294.338 132.056 296.797C132.545 299.255 133.752 301.514 135.525 303.286C137.298 305.059 139.556 306.266 142.015 306.755C144.474 307.244 147.022 306.993 149.338 306.034C151.655 305.075 153.634 303.45 155.027 301.366C156.42 299.281 157.163 296.831 157.163 294.324C157.159 290.963 155.822 287.742 153.446 285.366C151.07 282.989 147.848 281.653 144.488 281.648Z" fill="#9C58FA"/>
|
||||
<path d="M237.751 250.487C235.978 252.26 234.771 254.518 234.282 256.977C233.794 259.435 234.045 261.984 235.004 264.3C235.964 266.616 237.588 268.595 239.673 269.988C241.757 271.381 244.207 272.124 246.714 272.124C249.221 272.124 251.672 271.381 253.756 269.988C255.84 268.595 257.465 266.616 258.424 264.3C259.384 261.984 259.635 259.435 259.146 256.977C258.657 254.518 257.45 252.26 255.678 250.487C254.501 249.31 253.104 248.376 251.566 247.739C250.028 247.101 248.379 246.773 246.714 246.773C245.05 246.773 243.401 247.101 241.863 247.739C240.325 248.376 238.928 249.31 237.751 250.487Z" fill="#9C58FA"/>
|
||||
<path d="M281.648 162.512C281.648 165.019 282.392 167.469 283.785 169.554C285.177 171.638 287.157 173.263 289.473 174.222C291.789 175.181 294.338 175.432 296.797 174.943C299.255 174.454 301.514 173.247 303.286 171.474C305.059 169.702 306.266 167.443 306.755 164.984C307.244 162.526 306.993 159.977 306.034 157.661C305.075 155.345 303.45 153.365 301.366 151.973C299.281 150.58 296.831 149.836 294.324 149.836C290.962 149.836 287.738 151.172 285.361 153.549C282.984 155.926 281.648 159.15 281.648 162.512Z" fill="#9C58FA"/>
|
||||
<path d="M250.471 69.3303C252.244 71.1027 254.503 72.3097 256.961 72.7985C259.42 73.2874 261.968 73.0363 264.284 72.0768C266.6 71.1174 268.58 69.4928 269.972 67.4084C271.365 65.324 272.108 62.8735 272.108 60.3667C272.108 57.8599 271.365 55.4093 269.972 53.3249C268.58 51.2406 266.6 49.616 264.284 48.6565C261.968 47.6971 259.42 47.4459 256.961 47.9348C254.503 48.4236 252.244 49.6306 250.471 51.403C249.294 52.58 248.36 53.9775 247.723 55.5155C247.086 57.0535 246.758 58.7019 246.758 60.3667C246.758 62.0314 247.086 63.6799 247.723 65.2179C248.36 66.7559 249.294 68.1533 250.471 69.3303Z" fill="#9C58FA"/>
|
||||
<path d="M184.782 60.8054C180.168 63.4713 178.3 69.0427 177.63 74.3267C177.047 78.9358 175.033 83.2457 171.87 86.6488C168.707 90.052 164.556 92.3766 160.002 93.2951C155.448 94.2136 150.721 93.6796 146.487 91.7683C142.252 89.857 138.724 86.6649 136.401 82.642C134.077 78.6192 133.075 73.9684 133.535 69.3455C133.995 64.7226 135.895 60.3607 138.966 56.8748C142.037 53.389 146.125 50.9549 150.653 49.9159C155.181 48.8768 159.921 49.2852 164.204 51.0834C169.121 53.1428 174.884 54.2762 179.514 51.6422C184.143 49.0082 185.995 43.4049 186.665 38.1208C187.245 33.5107 189.257 29.1987 192.418 25.7931C195.579 22.3876 199.73 20.0603 204.284 19.1394C208.838 18.2185 213.567 18.7505 217.803 20.6605C222.039 22.5704 225.568 25.7618 227.893 29.7846C230.218 33.8075 231.222 38.4587 230.763 43.0824C230.303 47.7062 228.404 52.0691 225.333 55.5559C222.262 59.0426 218.173 61.4773 213.645 62.5165C209.116 63.5557 204.375 63.147 200.091 61.3481C195.174 59.3048 189.411 58.1554 184.782 60.8054Z" fill="#9C58FA"/>
|
||||
<path d="M110.073 65.8178C108.7 70.9742 111.318 76.2422 114.575 80.4567C117.417 84.1261 119.036 88.595 119.204 93.2335C119.372 97.872 118.08 102.446 115.51 106.311C112.941 110.177 109.223 113.138 104.881 114.778C100.538 116.419 95.7912 116.655 91.3077 115.454C86.8242 114.253 82.8306 111.675 79.8898 108.084C76.9489 104.493 75.2091 100.07 74.9155 95.4379C74.6219 90.8057 75.7894 86.1981 78.2533 82.2645C80.7173 78.331 84.3534 75.2698 88.6494 73.5124C93.5822 71.485 98.4991 68.2444 99.8241 63.0881C101.149 57.9317 98.579 52.6637 95.3224 48.4493C92.4827 44.7781 90.8665 40.3083 90.7018 35.6699C90.537 31.0315 91.8319 26.4583 94.4039 22.5949C96.976 18.7314 100.695 15.7724 105.038 14.1349C109.381 12.4974 114.128 12.2639 118.611 13.4673C123.094 14.6708 127.085 17.2505 130.024 20.8429C132.963 24.4354 134.7 28.8594 134.991 33.4916C135.283 38.1237 134.113 42.7305 131.647 46.6627C129.182 50.5948 125.544 53.6541 121.248 55.4095C116.363 57.4209 111.462 60.6775 110.073 65.8178Z" fill="#9C58FA"/>
|
||||
<path d="M60.7892 122.218C63.4552 126.831 69.0425 128.699 74.3265 129.37C78.9361 129.955 83.2455 131.973 86.6471 135.138C90.0487 138.304 92.3707 142.457 93.2857 147.013C94.2006 151.569 93.6625 156.296 91.747 160.53C89.8314 164.763 86.6353 168.288 82.6093 170.608C78.5833 172.928 73.9305 173.926 69.3073 173.46C64.6841 172.995 60.3236 171.09 56.841 168.014C53.3583 164.938 50.9292 160.846 49.8962 156.316C48.8631 151.785 49.2783 147.045 51.0832 142.763C53.1426 137.846 54.2759 132.083 51.6419 127.454C49.0079 122.824 43.4046 120.973 38.1047 120.302C33.4951 119.717 29.1856 117.699 25.7841 114.533C22.3825 111.368 20.0604 107.214 19.1454 102.659C18.2304 98.1032 18.7687 93.3752 20.6842 89.1418C22.5997 84.9084 25.7959 81.3832 29.8219 79.0632C33.8479 76.7433 38.5006 75.7457 43.1238 76.2113C47.7471 76.6768 52.1075 78.582 55.5902 81.658C59.0728 84.7341 61.502 88.8258 62.535 93.3561C63.568 97.8865 63.1528 102.627 61.3479 106.908C59.2886 111.825 58.1552 117.588 60.7892 122.218Z" fill="#9C58FA"/>
|
||||
<path d="M65.8204 196.93C70.9767 198.303 76.2287 195.685 80.4592 192.428C84.1286 189.586 88.5975 187.967 93.236 187.799C97.8745 187.631 102.449 188.923 106.314 191.493C110.179 194.062 113.141 197.78 114.781 202.122C116.421 206.464 116.657 211.212 115.457 215.695C114.256 220.179 111.678 224.172 108.087 227.113C104.496 230.054 100.073 231.794 95.4404 232.087C90.8082 232.381 86.2006 231.214 82.2671 228.75C78.3335 226.286 75.2723 222.649 73.5149 218.353C71.4875 213.421 68.231 208.504 63.0906 207.179C57.9503 205.854 52.6662 208.424 48.4518 211.681C44.7804 214.528 40.308 216.151 35.6652 216.32C31.0224 216.49 26.4435 215.199 22.5738 212.628C18.7042 210.057 15.7391 206.336 14.0968 201.99C12.4544 197.644 12.2176 192.892 13.4197 188.404C14.6218 183.917 17.2021 179.919 20.7969 176.976C24.3917 174.033 28.8195 172.293 33.4562 172C38.0929 171.708 42.7045 172.878 46.6407 175.345C50.577 177.813 53.6394 181.454 55.3961 185.755C57.4235 190.656 60.6641 195.541 65.8204 196.93Z" fill="#9C58FA"/>
|
||||
<path d="M122.205 246.21C126.818 243.544 128.686 237.956 129.373 232.672C129.96 228.068 131.978 223.763 135.142 220.366C138.306 216.969 142.456 214.651 147.008 213.738C151.559 212.825 156.283 213.364 160.512 215.278C164.741 217.192 168.263 220.385 170.58 224.408C172.898 228.43 173.895 233.078 173.43 237.697C172.966 242.316 171.064 246.673 167.991 250.153C164.919 253.633 160.832 256.061 156.306 257.095C151.781 258.129 147.045 257.717 142.766 255.916C137.833 253.856 132.07 252.723 127.457 255.357C122.843 257.991 120.96 263.594 120.289 268.894C119.7 273.498 117.681 277.8 114.517 281.196C111.353 284.591 107.204 286.908 102.653 287.821C98.1027 288.733 93.3808 288.194 89.1525 286.281C84.9243 284.367 81.4031 281.175 79.085 277.154C76.767 273.134 75.7689 268.487 76.2316 263.869C76.6942 259.251 78.5942 254.895 81.6638 251.414C84.7334 247.933 88.8179 245.503 93.3417 244.466C97.8655 243.429 102.601 243.838 106.88 245.635C111.828 247.694 117.591 248.876 122.205 246.21Z" fill="#9C58FA"/>
|
||||
<path d="M196.915 241.18C198.304 236.024 195.686 230.756 192.414 226.542C189.567 222.87 187.944 218.398 187.774 213.755C187.604 209.112 188.896 204.533 191.467 200.664C194.038 196.794 197.759 193.829 202.104 192.187C206.45 190.544 211.202 190.307 215.69 191.509C220.178 192.712 224.175 195.292 227.118 198.887C230.061 202.481 231.802 206.909 232.094 211.546C232.387 216.183 231.217 220.794 228.749 224.731C226.281 228.667 222.64 231.729 218.339 233.486C213.406 235.513 208.505 238.77 207.164 243.91C205.823 249.051 208.393 254.335 211.666 258.549C214.513 262.22 216.136 266.693 216.306 271.335C216.476 275.978 215.184 280.557 212.613 284.427C210.042 288.297 206.321 291.262 201.975 292.904C197.629 294.546 192.877 294.783 188.39 293.581C183.902 292.379 179.905 289.799 176.962 286.204C174.019 282.609 172.278 278.181 171.985 273.545C171.693 268.908 172.863 264.296 175.331 260.36C177.799 256.424 181.44 253.361 185.741 251.605C190.658 249.577 195.543 246.337 196.915 241.18Z" fill="#9C58FA"/>
|
||||
<path d="M246.195 184.797C243.529 180.184 237.957 178.316 232.673 177.629C228.069 177.045 223.764 175.03 220.365 171.869C216.967 168.708 214.646 164.56 213.729 160.01C212.813 155.46 213.348 150.737 215.258 146.507C217.168 142.277 220.357 138.753 224.376 136.431C228.395 134.11 233.041 133.108 237.66 133.567C242.279 134.026 246.637 135.923 250.12 138.991C253.604 142.058 256.037 146.141 257.077 150.664C258.117 155.188 257.711 159.923 255.917 164.204C253.857 169.137 252.724 174.9 255.342 179.513C257.96 184.127 263.595 186.01 268.879 186.681C273.484 187.267 277.789 189.283 281.186 192.446C284.584 195.608 286.904 199.757 287.819 204.308C288.733 208.859 288.197 213.582 286.285 217.811C284.372 222.041 281.181 225.564 277.16 227.884C273.14 230.203 268.492 231.203 263.874 230.741C259.255 230.279 254.897 228.379 251.416 225.31C247.934 222.24 245.503 218.155 244.466 213.63C243.429 209.106 243.838 204.37 245.636 200.09C247.695 195.173 248.861 189.411 246.195 184.797Z" fill="#9C58FA"/>
|
||||
<path d="M241.18 110.07C236.024 108.697 230.756 111.315 226.542 114.588C222.87 117.435 218.398 119.058 213.755 119.228C209.112 119.398 204.533 118.106 200.664 115.535C196.794 112.964 193.829 109.243 192.187 104.897C190.544 100.551 190.307 95.7994 191.509 91.3117C192.712 86.824 195.292 82.8268 198.887 79.8837C202.481 76.9405 206.909 75.2 211.546 74.9073C216.183 74.6147 220.794 75.7849 224.731 78.2527C228.667 80.7206 231.729 84.3617 233.486 88.6627C235.513 93.5955 238.754 98.4964 243.91 99.8374C249.066 101.178 254.335 98.6082 258.549 95.3356C262.22 92.4959 266.69 90.8798 271.328 90.7151C275.967 90.5503 280.54 91.8452 284.403 94.4172C288.267 96.9892 291.226 100.709 292.863 105.052C294.501 109.394 294.734 114.142 293.531 118.624C292.327 123.107 289.748 127.099 286.155 130.037C282.563 132.976 278.139 134.714 273.507 135.005C268.875 135.296 264.268 134.126 260.336 131.661C256.403 129.195 253.344 125.557 251.589 121.261C249.577 116.36 246.321 111.459 241.18 110.07Z" fill="#9C58FA"/>
|
||||
<path d="M153.491 191.533C174.501 191.533 191.533 174.501 191.533 153.491C191.533 132.482 174.501 115.45 153.491 115.45C132.481 115.45 115.449 132.482 115.449 153.491C115.449 174.501 132.481 191.533 153.491 191.533Z" fill="#9C58FA"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,336 @@
|
||||
---
|
||||
title: "Configuration"
|
||||
description: "Configure Mem0 with custom LLMs, vector stores, embedders, and rerankers for production deployments"
|
||||
icon: "sliders"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 is highly configurable, allowing you to customize every component of your memory system. Choose from **51+ supported providers** across LLMs, vector databases, embedders, and rerankers.
|
||||
|
||||
## Quick Start
|
||||
|
||||
The simplest setup uses OpenAI defaults:
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
m = Memory()
|
||||
```
|
||||
|
||||
For production or custom setups, configure specific components:
|
||||
|
||||
```python
|
||||
from mem0 import Memory
|
||||
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "qdrant",
|
||||
"config": {
|
||||
"host": "localhost",
|
||||
"port": 6333
|
||||
}
|
||||
},
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"model": "gpt-4.1-nano-2025-04-14",
|
||||
"temperature": 0.1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
```
|
||||
|
||||
## Configuration Components
|
||||
|
||||
Mem0 has four configurable components. Click any to see all supported providers and detailed configuration options.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="LLMs" icon="message-bot" href="/components/llms/overview">
|
||||
**17 providers** including OpenAI, Anthropic, Ollama, Groq, and more
|
||||
|
||||
Configure the language model for memory extraction and processing
|
||||
|
||||
</Card>
|
||||
|
||||
<Card title="Vector Databases" icon="hard-drive" href="/components/vectordbs/overview">
|
||||
**25+ databases** including Qdrant, Chroma, Pinecone, Weaviate, and more
|
||||
|
||||
Choose where to store and retrieve memory embeddings
|
||||
|
||||
</Card>
|
||||
|
||||
<Card title="Embedding Models" icon="cube" href="/components/embedders/overview">
|
||||
**9 providers** including OpenAI, HuggingFace, Ollama, and more
|
||||
|
||||
Select the model to convert memories into vector embeddings
|
||||
|
||||
</Card>
|
||||
|
||||
<Card title="Rerankers" icon="ranking-star" href="/components/rerankers/overview">
|
||||
**4 models** including Cohere, Zero Entropy, and LLM-based
|
||||
|
||||
Improve search relevance by re-scoring retrieved memories
|
||||
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Configuration Recipes
|
||||
|
||||
### Production Setup with Qdrant
|
||||
|
||||
For production deployments, use a dedicated vector store:
|
||||
|
||||
<Steps>
|
||||
<Step title="Start Qdrant">
|
||||
```bash
|
||||
docker pull qdrant/qdrant
|
||||
|
||||
docker run -p 6333:6333 -p 6334:6334 \
|
||||
-v $(pwd)/qdrant_storage:/qdrant/storage:z \
|
||||
qdrant/qdrant
|
||||
|
||||
````
|
||||
</Step>
|
||||
|
||||
<Step title="Configure Mem0">
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "qdrant",
|
||||
"config": {
|
||||
"host": "localhost",
|
||||
"port": 6333,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
````
|
||||
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Fully Local Setup
|
||||
|
||||
Run Mem0 completely offline with Ollama (no external APIs):
|
||||
|
||||
<Card title="Local Setup with Ollama" icon="server" href="/examples/mem0-with-ollama">
|
||||
Step-by-step guide to run Mem0 with local LLM and embeddings
|
||||
</Card>
|
||||
|
||||
### Multi-Cloud Setup
|
||||
|
||||
Mix providers from different clouds:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"llm": {
|
||||
"provider": "azure_openai",
|
||||
"config": {
|
||||
"api_key": "azure-key",
|
||||
"deployment_name": "gpt-4.1-nano-2025-04-14"
|
||||
}
|
||||
},
|
||||
"vector_store": {
|
||||
"provider": "pinecone",
|
||||
"config": {
|
||||
"api_key": "pinecone-key",
|
||||
"index_name": "mem0"
|
||||
}
|
||||
},
|
||||
"embedder": {
|
||||
"provider": "vertexai",
|
||||
"config": {
|
||||
"model": "textembedding-gecko@003"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Graph Memory Setup
|
||||
|
||||
Enable relationship tracking with Neo4j:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"graph_store": {
|
||||
"provider": "neo4j",
|
||||
"config": {
|
||||
"url": "neo4j+s://your-instance.databases.neo4j.io",
|
||||
"username": "neo4j",
|
||||
"password": "your-password"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
```
|
||||
|
||||
<Card title="Graph Memory Guide" icon="diagram-project" href="/open-source/graph_memory/overview">
|
||||
Learn how to use graph memory for relationship-based retrieval
|
||||
</Card>
|
||||
|
||||
## Advanced Configuration
|
||||
|
||||
### Custom Prompts
|
||||
|
||||
Override default prompts for memory processing:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"custom_fact_extraction_prompt": """
|
||||
Extract key facts from the conversation.
|
||||
Focus on: preferences, decisions, and context.
|
||||
Output as a single sentence.
|
||||
""",
|
||||
"custom_update_memory_prompt": """
|
||||
Update the existing memory with new information.
|
||||
Preserve important context from the old memory.
|
||||
"""
|
||||
}
|
||||
```
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Custom Fact Extraction" icon="sparkles" href="/open-source/features/custom-fact-extraction-prompt">
|
||||
Customize how memories are extracted from conversations
|
||||
</Card>
|
||||
|
||||
<Card title="Custom Memory Updates" icon="pen" href="/open-source/features/custom-update-memory-prompt">
|
||||
Control how existing memories are modified
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Reranking for Better Search
|
||||
|
||||
Add reranking to improve search relevance:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"rerank": {
|
||||
"provider": "cohere",
|
||||
"config": {
|
||||
"model": "rerank-english-v3.0",
|
||||
"top_k": 5
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<Card title="Reranking Guide" icon="arrow-up-arrow-down" href="/open-source/features/reranking">
|
||||
Learn how reranking improves memory search accuracy
|
||||
</Card>
|
||||
|
||||
### History Database
|
||||
|
||||
Configure where operation history is stored:
|
||||
|
||||
```python
|
||||
config = {
|
||||
"history_db_path": "/custom/path/to/history.db"
|
||||
}
|
||||
```
|
||||
|
||||
## All Configuration Options
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="LLM Configuration">
|
||||
| Parameter | Description | Provider |
|
||||
|-----------------------|-----------------------------------------------|-------------------|
|
||||
| `provider` | LLM provider (e.g., "openai", "anthropic") | All |
|
||||
| `model` | Model to use | All |
|
||||
| `temperature` | Temperature of the model (0.0-2.0) | All |
|
||||
| `api_key` | API key to use | Most |
|
||||
| `max_tokens` | Maximum tokens to generate | All |
|
||||
| `top_p` | Nucleus sampling threshold | All |
|
||||
| `top_k` | Top-k sampling parameter | Some |
|
||||
| `ollama_base_url` | Base URL for Ollama API | Ollama |
|
||||
| `openai_base_url` | Base URL for OpenAI API | OpenAI |
|
||||
| `azure_kwargs` | Azure-specific initialization args | Azure OpenAI |
|
||||
|
||||
**See all 17 LLM providers:** [LLMs Overview](/components/llms/overview)
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Vector Store Configuration">
|
||||
Common parameters (provider-specific options vary):
|
||||
|
||||
| Parameter | Description | Example |
|
||||
| ----------------- | -------------------------- | ----------- |
|
||||
| `provider` | Vector store provider | "qdrant" |
|
||||
| `host` | Host address | "localhost" |
|
||||
| `port` | Port number | 6333 |
|
||||
| `collection_name` | Collection/index name | "memories" |
|
||||
| `api_key` | API key (for cloud stores) | "your-key" |
|
||||
|
||||
**See all 25+ vector stores:** [Vector Databases Overview](/components/vectordbs/overview)
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Embedder Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|-------------|---------------------------------|------------------------------|
|
||||
| `provider` | Embedding provider | "openai" |
|
||||
| `model` | Embedding model to use | "text-embedding-3-small" |
|
||||
| `api_key` | API key for embedding service | None |
|
||||
|
||||
**See all 9 embedder providers:** [Embedders Overview](/components/embedders/overview)
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Reranker Configuration">
|
||||
| Parameter | Description | Example |
|
||||
|-------------|---------------------------------|------------------------------|
|
||||
| `provider` | Reranker provider | "cohere" |
|
||||
| `model` | Reranker model to use | "rerank-english-v3.0" |
|
||||
| `top_k` | Number of results to return | 5 |
|
||||
| `api_key` | API key for reranker service | "your-key" |
|
||||
|
||||
**See all reranker options:** [Rerankers Overview](/components/rerankers/overview)
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Graph Store Configuration">
|
||||
| Parameter | Description | Example |
|
||||
|-------------|---------------------------------|------------------------------|
|
||||
| `provider` | Graph store provider | "neo4j" |
|
||||
| `url` | Connection URL | "neo4j+s://..." |
|
||||
| `username` | Authentication username | "neo4j" |
|
||||
| `password` | Authentication password | "your-password" |
|
||||
|
||||
**Learn more:** [Graph Memory Overview](/open-source/graph_memory/overview)
|
||||
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="General Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|------------------|--------------------------------------|----------------------------|
|
||||
| `history_db_path` | Path to the history database | "{mem0_dir}/history.db" |
|
||||
| `custom_fact_extraction_prompt` | Custom prompt for memory extraction | None |
|
||||
| `custom_update_memory_prompt` | Custom prompt for memory updates | None |
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Next Steps
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Python Quickstart" icon="python" href="/open-source/python-quickstart">
|
||||
Get started with the Python SDK
|
||||
</Card>
|
||||
|
||||
<Card title="Self-Hosting Features" icon="server" href="/open-source/features/overview">
|
||||
Explore OSS-specific capabilities
|
||||
</Card>
|
||||
|
||||
<Card title="Examples" icon="book" href="/examples">
|
||||
See configuration examples in action
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Async Memory
|
||||
description: 'Asynchronous memory for Mem0'
|
||||
icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## AsyncMemory
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Custom Fact Extraction Prompt
|
||||
description: 'Enhance your product experience by adding custom fact extraction prompt tailored to your needs'
|
||||
icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Introduction to Custom Fact Extraction Prompt
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: Custom Update Memory Prompt
|
||||
icon: "pencil"
|
||||
iconType: "solid"
|
||||
description: 'Control memory update actions with a custom prompt'
|
||||
---
|
||||
|
||||
|
||||
@@ -234,4 +233,4 @@ The prompt needs to guide the output to follow the structure as shown below:
|
||||
|---------|-------------------------------|-----------------|
|
||||
| Use case | Determine the action to be performed on the memory | Extract facts from messages |
|
||||
| Reference | Retrieved facts from messages and old memory | Messages |
|
||||
| Output | Action to be performed on the memory | Extracted facts |
|
||||
| Output | Action to be performed on the memory | Extracted facts |
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Enhanced Metadata Filtering
|
||||
description: 'Advanced filtering capabilities for precise memory retrieval in Mem0 1.0.0 '
|
||||
icon: "filter"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Info>
|
||||
@@ -386,4 +384,4 @@ results = m.search(
|
||||
|
||||
<Info>
|
||||
Enhanced metadata filtering provides powerful capabilities for precise memory retrieval. Start with simple filters and gradually adopt more complex patterns as needed.
|
||||
</Info>
|
||||
</Info>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Multimodal Support
|
||||
description: Integrate images into your interactions with Mem0
|
||||
icon: "image"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data. With this feature, you can seamlessly integrate images into your interactions—allowing Mem0 to extract relevant information and context from visual content.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: OpenAI Compatibility
|
||||
icon: "code"
|
||||
iconType: "solid"
|
||||
description: 'Integrate Mem0 using OpenAI-compatible client APIs'
|
||||
---
|
||||
|
||||
Mem0 can be easily integrated into chat applications to enhance conversational agents with structured memory. Mem0's APIs are designed to be compatible with OpenAI's, with the goal of making it easy to leverage Mem0 in applications you may have already built.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Overview
|
||||
description: 'Build powerful AI applications with self-improving memory using Mem0 open-source'
|
||||
icon: "eye"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Welcome to Mem0 Open Source
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Reranker-Enhanced Search
|
||||
description: 'Improve search relevance with reranking models in Mem0 1.0.0 '
|
||||
icon: "sort"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Info>
|
||||
@@ -415,4 +413,4 @@ results = m.search("query", user_id="alice") # Automatically reranked
|
||||
|
||||
<Info>
|
||||
Reranker-enhanced search significantly improves result relevance. Start with a local model and upgrade to API-based solutions as your needs grow.
|
||||
</Info>
|
||||
</Info>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Reranking
|
||||
description: 'Improve memory search relevance with advanced reranking capabilities'
|
||||
icon: "arrow-up-arrow-down"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
@@ -127,4 +125,4 @@ results = memory.search("query", user_id="alice", rerank=False)
|
||||
- Explore specific [reranker providers](../../components/rerankers/overview) and their capabilities
|
||||
- Learn about [configuration options](../../components/rerankers/config) for fine-tuning
|
||||
- Check out [Vector Stores](../../components/vectordbs/overview) for different storage backends
|
||||
- See [Async Memory](./async-memory) for non-blocking reranking operations
|
||||
- See [Async Memory](./async-memory) for non-blocking reranking operations
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
title: REST API Server
|
||||
icon: "server"
|
||||
iconType: "solid"
|
||||
description: 'Reach every Mem0 capability through a FastAPI-powered REST server'
|
||||
---
|
||||
|
||||
Mem0 provides a REST API server (written using FastAPI). Users can perform all operations through REST endpoints. The API also includes OpenAPI documentation, accessible at `/docs` when the server is running.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Features
|
||||
description: 'Graph Memory features'
|
||||
icon: "list-check"
|
||||
icon: "sparkles"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Overview
|
||||
description: 'Enhance your memory system with graph-based knowledge representation and retrieval'
|
||||
icon: "info"
|
||||
icon: "network-wired"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,28 +1,86 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "eye"
|
||||
title: "Overview"
|
||||
icon: "code-branch"
|
||||
iconType: "solid"
|
||||
description: "Self-host Mem0 with full control over your infrastructure and data"
|
||||
---
|
||||
|
||||
Welcome to Mem0 Open Source, a powerful, self-hosted memory management solution for AI agents and assistants. With Mem0 OSS, you get full control over your infrastructure while maintaining complete customization flexibility.
|
||||
<Tip>
|
||||
**Mem0 v1.0.0 is now available** — Introducing rerankers, async by default, Azure support, and more. [View changelog →](/changelog)
|
||||
</Tip>
|
||||
|
||||
We offer two SDKs: Python and Node.js.
|
||||
## Self-Host Mem0 with Full Control
|
||||
|
||||
Check out our [GitHub repository](https://mem0.dev/gd) to explore the source code.
|
||||
Mem0 Open Source gives you a powerful, self-hosted memory layer for AI agents. Deploy on your infrastructure, customize every component, and maintain complete data ownership.
|
||||
|
||||
## Get Started
|
||||
|
||||
Choose your preferred SDK and get Mem0 running locally in minutes:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Python SDK Guide" icon="python" href="/open-source/python-quickstart">
|
||||
Learn more about Mem0 OSS Python SDK
|
||||
</Card>
|
||||
<Card title="Node.js SDK Guide" icon="node" href="/open-source/node-quickstart">
|
||||
Learn more about Mem0 OSS Node.js SDK
|
||||
</Card>
|
||||
<Card title="Python Quickstart" icon="python" href="/open-source/python-quickstart">
|
||||
Install and configure Mem0 OSS with Python in 10 minutes
|
||||
</Card>
|
||||
|
||||
<Card title="Node.js Quickstart" icon="node" href="/open-source/node-quickstart">
|
||||
Set up Mem0 OSS with Node.js and TypeScript support
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## Key Features
|
||||
## Explore OSS Capabilities
|
||||
|
||||
- **Full Infrastructure Control**: Host Mem0 on your own servers.
|
||||
- **Customizable Implementation**: Modify and extend functionality as needed.
|
||||
- **Local Development**: Perfect for development and testing.
|
||||
- **No Vendor Lock-in**: Own your data and infrastructure.
|
||||
- **Community Driven**: Benefit from and contribute to community improvements.
|
||||
Mem0 Open Source offers powerful features for building production-grade AI applications with memory. From graph-based knowledge structures to flexible component configuration, you have full control over how memory works in your system.
|
||||
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Graph Memory" icon="network-wired" href="/open-source/graph_memory/overview">
|
||||
Build relationship-aware memory with knowledge graph capabilities
|
||||
</Card>
|
||||
|
||||
<Card title="Component Configuration" icon="sliders" href="/open-source/configuration">
|
||||
Choose your LLM, vector database, embedding model, and rerankers
|
||||
</Card>
|
||||
|
||||
<Card title="REST API" icon="bolt" href="/open-source/features/rest-api">
|
||||
Build high-throughput pipelines with async clients and REST endpoints
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
<Note>
|
||||
**Platform vs OSS?** See our [comparison guide](/platform/platform-vs-oss) to understand which deployment option fits your use case.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Why Choose Open Source?
|
||||
|
||||
| Benefit | What You Get |
|
||||
|---------|--------------|
|
||||
| **Full Infrastructure Control** | Host on your own servers with complete access to configuration and deployment |
|
||||
| **Complete Customization** | Modify implementation, extend functionality, and adapt to your specific needs |
|
||||
| **Local Development** | Perfect for development, testing, and air-gapped environments |
|
||||
| **No Vendor Lock-in** | Own your data, choose your stack, and maintain full independence |
|
||||
| **Community Driven** | Contribute to and benefit from active community improvements and integrations |
|
||||
|
||||
<Info>
|
||||
**Looking for production scale?** [Mem0 Platform](/platform/overview) offers managed infrastructure with advanced features like webhooks, multimodal support, and enterprise support.
|
||||
</Info>
|
||||
|
||||
<Note>
|
||||
**Need help?** Check out our [GitHub repository](https://mem0.dev/gd) for source code, issues, and community discussions.
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
## Default Components
|
||||
|
||||
<Note>
|
||||
**No configuration needed to get started.** Mem0 works out of the box with sensible defaults:
|
||||
|
||||
- **LLM**: OpenAI `gpt-4.1-nano-2025-04-14` via your `OPENAI_API_KEY`
|
||||
- **Embeddings**: OpenAI `text-embedding-3-small` (1536 dimensions)
|
||||
- **Vector store**: Local Qdrant instance storing data at `/tmp/qdrant`
|
||||
- **History storage**: SQLite database at `~/.mem0/history.db`
|
||||
- **Reranker**: Disabled unless you configure one
|
||||
|
||||
Override any component with [`Memory.from_config`](/open-source/configuration).
|
||||
</Note>
|
||||
|
||||
@@ -1,546 +1,95 @@
|
||||
---
|
||||
title: Python SDK Quickstart
|
||||
description: 'Get started with Mem0 quickly!'
|
||||
description: "Get started with Mem0 quickly!"
|
||||
icon: "python"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
> Welcome to the Mem0 quickstart guide. This guide will help you get up and running with Mem0 in no time.
|
||||
Get started with Mem0's Python SDK in under 5 minutes. This guide shows you how to install Mem0 and store your first memory.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Python 3.10 or higher
|
||||
- OpenAI API key ([Get one here](https://platform.openai.com/api-keys))
|
||||
|
||||
## Installation
|
||||
|
||||
To install Mem0, you can use pip. Run the following command in your terminal:
|
||||
|
||||
<Steps>
|
||||
<Step title="Install via pip">
|
||||
```bash
|
||||
pip install mem0ai
|
||||
```
|
||||
</Step>
|
||||
|
||||
## Basic Usage
|
||||
|
||||
### Initialize Mem0
|
||||
|
||||
<Tabs>
|
||||
<Tab title="Basic">
|
||||
<Step title="Initialize Memory">
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
m = Memory()
|
||||
m = Memory(api_key="your-openai-api-key")
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Async">
|
||||
</Step>
|
||||
|
||||
<Step title="Add a memory">
|
||||
```python
|
||||
import os
|
||||
from mem0 import AsyncMemory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
m = AsyncMemory()
|
||||
```
|
||||
</Tab>
|
||||
<Tab title="Advanced">
|
||||
If you want to run Mem0 in production, initialize using the following method:
|
||||
|
||||
Run Qdrant first:
|
||||
|
||||
```bash
|
||||
docker pull qdrant/qdrant
|
||||
|
||||
docker run -p 6333:6333 -p 6334:6334 \
|
||||
-v $(pwd)/qdrant_storage:/qdrant/storage:z \
|
||||
qdrant/qdrant
|
||||
```
|
||||
|
||||
Then, instantiate memory with qdrant server:
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "qdrant",
|
||||
"config": {
|
||||
"host": "localhost",
|
||||
"port": 6333,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
m = Memory.from_config(config)
|
||||
```
|
||||
</Tab>
|
||||
|
||||
<Tab title="Advanced (Graph Memory)">
|
||||
|
||||
```python
|
||||
import os
|
||||
from mem0 import Memory
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "your-api-key"
|
||||
|
||||
config = {
|
||||
"graph_store": {
|
||||
"provider": "neo4j",
|
||||
"config": {
|
||||
"url": "neo4j+s://---",
|
||||
"username": "neo4j",
|
||||
"password": "---"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m = Memory.from_config(config_dict=config)
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
|
||||
### Store a Memory
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
messages = [
|
||||
{"role": "user", "content": "I'm planning to watch a movie tonight. Any recommendations?"},
|
||||
{"role": "assistant", "content": "How about thriller movies? They can be quite engaging."},
|
||||
{"role": "user", "content": "I'm not a big fan of 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."}
|
||||
{"role": "user", "content": "Hi, I'm Alex. I love basketball and gaming."},
|
||||
{"role": "assistant", "content": "Hey Alex! I'll remember your interests."}
|
||||
]
|
||||
m.add(messages, user_id="alex")
|
||||
```
|
||||
</Step>
|
||||
|
||||
# Store inferred memories (default behavior)
|
||||
result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"})
|
||||
|
||||
# Store memories with agent and run context
|
||||
result = m.add(messages, user_id="alice", agent_id="movie-assistant", run_id="session-001", metadata={"category": "movie_recommendations"})
|
||||
|
||||
# Store raw messages without inference
|
||||
# result = m.add(messages, user_id="alice", metadata={"category": "movie_recommendations"}, infer=False)
|
||||
<Step title="Search memories">
|
||||
```python
|
||||
results = m.search("What do you know about me?", filters={"user_id": "alex"})
|
||||
print(results)
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"memory": "User is planning to watch a movie tonight.",
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"event": "ADD"
|
||||
},
|
||||
{
|
||||
"id": "cbb1fe73-0bf1-4067-8c1f-63aa53e7b1a4",
|
||||
"memory": "User is not a big fan of thriller movies.",
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"event": "ADD"
|
||||
},
|
||||
{
|
||||
"id": "475bde34-21e6-42ab-8bef-0ab84474f156",
|
||||
"memory": "User loves sci-fi movies.",
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"event": "ADD"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Retrieve Memories
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
# Get all memories
|
||||
all_memories = m.get_all(user_id="alice")
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"memory": "User is planning to watch a movie tonight.",
|
||||
"hash": "1a271c007316c94377175ee80e746a19",
|
||||
"created_at": "2025-02-27T16:33:20.557Z",
|
||||
"updated_at": "2025-02-27T16:33:27.051Z",
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"id": "475bde34-21e6-42ab-8bef-0ab84474f156",
|
||||
"memory": "User loves sci-fi movies.",
|
||||
"hash": "285d07801ae42054732314853e9eadd7",
|
||||
"created_at": "2025-02-27T16:33:20.560Z",
|
||||
"updated_at": None,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"id": "cbb1fe73-0bf1-4067-8c1f-63aa53e7b1a4",
|
||||
"memory": "User is not a big fan of thriller movies.",
|
||||
"hash": "285d07801ae42054732314853e9eadd7",
|
||||
"created_at": "2025-02-27T16:33:20.560Z",
|
||||
"updated_at": None,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
|
||||
<br />
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
# Get a single memory by ID
|
||||
specific_memory = m.get("892db2ae-06d9-49e5-8b3e-585ef9b85b8e")
|
||||
```
|
||||
|
||||
```json Output
|
||||
{
|
||||
"id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"memory": "User is planning to watch a movie tonight.",
|
||||
"hash": "1a271c007316c94377175ee80e746a19",
|
||||
"created_at": "2025-02-27T16:33:20.557Z",
|
||||
"updated_at": None,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Search Memories
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
related_memories = m.search(query="What do you know about me?", user_id="alice")
|
||||
```
|
||||
|
||||
```json Output
|
||||
**Output:**
|
||||
```json
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"memory": "User is planning to watch a movie tonight.",
|
||||
"hash": "1a271c007316c94377175ee80e746a19",
|
||||
"created_at": "2025-02-27T16:33:20.557Z",
|
||||
"updated_at": None,
|
||||
"score": 0.38920719231944799,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"id": "475bde34-21e6-42ab-8bef-0ab84474f156",
|
||||
"memory": "User loves sci-fi movies.",
|
||||
"hash": "285d07801ae42054732314853e9eadd7",
|
||||
"created_at": "2025-02-27T16:33:20.560Z",
|
||||
"updated_at": None,
|
||||
"score": 0.36869761478135689,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
},
|
||||
{
|
||||
"id": "cbb1fe73-0bf1-4067-8c1f-63aa53e7b1a4",
|
||||
"memory": "User is not a big fan of thriller movies.",
|
||||
"hash": "285d07801ae42054732314853e9eadd7",
|
||||
"created_at": "2025-02-27T16:33:20.560Z",
|
||||
"updated_at": None,
|
||||
"score": 0.33855272141248272,
|
||||
"metadata": {
|
||||
"category": "movie_recommendations"
|
||||
},
|
||||
"user_id": "alice"
|
||||
"id": "mem_123abc",
|
||||
"memory": "Name is Alex. Enjoys basketball and gaming.",
|
||||
"user_id": "alex",
|
||||
"categories": ["personal_info"],
|
||||
"created_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"score": 0.89
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
### Update a Memory
|
||||
<Note>
|
||||
By default `Memory()` wires up:
|
||||
- OpenAI `gpt-4.1-nano-2025-04-14` for fact extraction and updates
|
||||
- OpenAI `text-embedding-3-small` embeddings (1536 dimensions)
|
||||
- Qdrant vector store with on-disk data at `/tmp/qdrant`
|
||||
- SQLite history at `~/.mem0/history.db`
|
||||
- No reranker (add one in the config when you need it)
|
||||
</Note>
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
result = m.update(memory_id="892db2ae-06d9-49e5-8b3e-585ef9b85b8e", data="I love India, it is my favorite country.")
|
||||
```
|
||||
## What's Next?
|
||||
|
||||
```json Output
|
||||
{'message': 'Memory updated successfully!'}
|
||||
```
|
||||
</CodeGroup>
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Memory Operations" icon="database" href="/open-source/overview">
|
||||
Learn how to search, update, and manage memories with full CRUD operations
|
||||
</Card>
|
||||
|
||||
### Memory History
|
||||
<Card title="Configuration" icon="sliders" href="/open-source/configuration">
|
||||
Customize Mem0 with different LLMs, vector stores, and embedders for production use
|
||||
</Card>
|
||||
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
history = m.history(memory_id="892db2ae-06d9-49e5-8b3e-585ef9b85b8e")
|
||||
```
|
||||
<Card title="Advanced Features" icon="sparkles" href="/open-source/features/async-memory">
|
||||
Explore async support, graph memory, and multi-agent memory organization
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": 39,
|
||||
"memory_id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"previous_value": "User is planning to watch a movie tonight.",
|
||||
"new_value": "I love India, it is my favorite country.",
|
||||
"action": "UPDATE",
|
||||
"created_at": "2025-02-27T16:33:20.557Z",
|
||||
"updated_at": "2025-02-27T16:33:27.051Z",
|
||||
"is_deleted": 0
|
||||
},
|
||||
{
|
||||
"id": 37,
|
||||
"memory_id": "892db2ae-06d9-49e5-8b3e-585ef9b85b8e",
|
||||
"previous_value": null,
|
||||
"new_value": "User is planning to watch a movie tonight.",
|
||||
"action": "ADD",
|
||||
"created_at": "2025-02-27T16:33:20.557Z",
|
||||
"updated_at": null,
|
||||
"is_deleted": 0
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
## Additional Resources
|
||||
|
||||
### Delete Memory
|
||||
|
||||
```python
|
||||
# Delete a memory by id
|
||||
m.delete(memory_id="892db2ae-06d9-49e5-8b3e-585ef9b85b8e")
|
||||
# Delete all memories for a user
|
||||
m.delete_all(user_id="alice")
|
||||
```
|
||||
|
||||
### Reset Memory
|
||||
|
||||
```python
|
||||
m.reset() # Reset all memories
|
||||
```
|
||||
|
||||
## Advanced Memory Organization
|
||||
|
||||
Mem0 supports three key parameters for organizing memories:
|
||||
|
||||
- **`user_id`**: Organize memories by user identity.
|
||||
- **`agent_id`**: Organize memories by AI agent or assistant.
|
||||
- **`run_id`**: Organize memories by session, workflow, or execution context.
|
||||
|
||||
### Using All Three Parameters
|
||||
|
||||
```python
|
||||
# Store memories with full context
|
||||
m.add("User prefers vegetarian food",
|
||||
user_id="alice",
|
||||
agent_id="diet-assistant",
|
||||
run_id="consultation-001")
|
||||
|
||||
# Retrieve memories with different scopes
|
||||
all_user_memories = m.get_all(user_id="alice")
|
||||
agent_memories = m.get_all(user_id="alice", agent_id="diet-assistant")
|
||||
session_memories = m.get_all(user_id="alice", run_id="consultation-001")
|
||||
specific_memories = m.get_all(user_id="alice", agent_id="diet-assistant", run_id="consultation-001")
|
||||
|
||||
# Search with context
|
||||
general_search = m.search("What do you know about me?", user_id="alice")
|
||||
agent_search = m.search("What do you know about me?", user_id="alice", agent_id="diet-assistant")
|
||||
session_search = m.search("What do you know about me?", user_id="alice", run_id="consultation-001")
|
||||
```
|
||||
|
||||
## Configuration Parameters
|
||||
|
||||
Mem0 offers extensive configuration options to customize its behavior according to your needs. These configurations span different components like vector stores, language models, embedders, and graph stores.
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Vector Store Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|-------------|---------------------------------|-------------|
|
||||
| `provider` | Vector store provider (e.g., "qdrant") | "qdrant" |
|
||||
| `host` | Host address | "localhost" |
|
||||
| `port` | Port number | 6333 |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="LLM Configuration">
|
||||
| Parameter | Description | Provider |
|
||||
|-----------------------|-----------------------------------------------|-------------------|
|
||||
| `provider` | LLM provider (e.g., "openai", "anthropic") | All |
|
||||
| `model` | Model to use | All |
|
||||
| `temperature` | Temperature of the model | All |
|
||||
| `api_key` | API key to use | All |
|
||||
| `max_tokens` | Tokens to generate | All |
|
||||
| `top_p` | Probability threshold for nucleus sampling | All |
|
||||
| `top_k` | Number of highest probability tokens to keep | All |
|
||||
| `http_client_proxies` | Allow proxy server settings | AzureOpenAI |
|
||||
| `models` | List of models | Openrouter |
|
||||
| `route` | Routing strategy | Openrouter |
|
||||
| `openrouter_base_url` | Base URL for Openrouter API | Openrouter |
|
||||
| `site_url` | Site URL | Openrouter |
|
||||
| `app_name` | Application name | Openrouter |
|
||||
| `ollama_base_url` | Base URL for Ollama API | Ollama |
|
||||
| `openai_base_url` | Base URL for OpenAI API | OpenAI |
|
||||
| `azure_kwargs` | Azure LLM args for initialization | AzureOpenAI |
|
||||
| `deepseek_base_url` | Base URL for DeepSeek API | DeepSeek |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Embedder Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|-------------|---------------------------------|------------------------------|
|
||||
| `provider` | Embedding provider | "openai" |
|
||||
| `model` | Embedding model to use | "text-embedding-3-small" |
|
||||
| `api_key` | API key for embedding service | None |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Graph Store Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|-------------|---------------------------------|-------------|
|
||||
| `provider` | Graph store provider (e.g., "neo4j") | "neo4j" |
|
||||
| `url` | Connection URL | None |
|
||||
| `username` | Authentication username | None |
|
||||
| `password` | Authentication password | None |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="General Configuration">
|
||||
| Parameter | Description | Default |
|
||||
|------------------|--------------------------------------|----------------------------|
|
||||
| `history_db_path` | Path to the history database | "{mem0_dir}/history.db" |
|
||||
| `version` | API version | "v1.1" |
|
||||
| `custom_fact_extraction_prompt` | Custom prompt for memory processing | None |
|
||||
| `custom_update_memory_prompt` | Custom prompt for memory updates | None |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Complete Configuration Example">
|
||||
```python
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "qdrant",
|
||||
"config": {
|
||||
"host": "localhost",
|
||||
"port": 6333
|
||||
}
|
||||
},
|
||||
"llm": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"api_key": "your-api-key",
|
||||
"model": "gpt-4"
|
||||
}
|
||||
},
|
||||
"embedder": {
|
||||
"provider": "openai",
|
||||
"config": {
|
||||
"api_key": "your-api-key",
|
||||
"model": "text-embedding-3-small"
|
||||
}
|
||||
},
|
||||
"graph_store": {
|
||||
"provider": "neo4j",
|
||||
"config": {
|
||||
"url": "neo4j+s://your-instance",
|
||||
"username": "neo4j",
|
||||
"password": "password"
|
||||
}
|
||||
},
|
||||
"history_db_path": "/path/to/history.db",
|
||||
"version": "v1.1",
|
||||
"custom_fact_extraction_prompt": "Optional custom prompt for fact extraction for memory",
|
||||
"custom_update_memory_prompt": "Optional custom prompt for update memory"
|
||||
}
|
||||
```
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
## Run Mem0 Locally
|
||||
|
||||
Please refer to the example [Mem0 with Ollama](../examples/mem0-with-ollama) to run Mem0 locally.
|
||||
|
||||
|
||||
## Chat Completion
|
||||
|
||||
Mem0 can be easily integrated into chat applications to enhance conversational agents with structured memory. Mem0's APIs are designed to be compatible with OpenAI's, with the goal of making it easy to leverage Mem0 in applications you may have already built.
|
||||
|
||||
If you have a `Mem0 API key`, you can use it to initialize the client. Alternatively, you can initialize Mem0 without an API key if you're using it locally.
|
||||
|
||||
Mem0 supports several language models (LLMs) through integration with various [providers](https://litellm.vercel.app/docs/providers).
|
||||
|
||||
## Use Mem0 OSS
|
||||
|
||||
```python
|
||||
config = {
|
||||
"vector_store": {
|
||||
"provider": "qdrant",
|
||||
"config": {
|
||||
"host": "localhost",
|
||||
"port": 6333,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
client = Mem0(config=config)
|
||||
|
||||
chat_completion = client.chat.completions.create(
|
||||
messages=[
|
||||
{
|
||||
"role": "user",
|
||||
"content": "What's the capital of France?",
|
||||
}
|
||||
],
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
)
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions to Mem0. Here's how you can contribute:
|
||||
|
||||
1. Fork the repository and create your branch from `main`.
|
||||
2. Clone the forked repository to your local machine.
|
||||
3. Install the project dependencies:
|
||||
|
||||
```bash
|
||||
poetry install
|
||||
```
|
||||
|
||||
4. Install pre-commit hooks:
|
||||
|
||||
```bash
|
||||
pip install pre-commit # If pre-commit is not already installed
|
||||
pre-commit install
|
||||
```
|
||||
|
||||
5. Make your changes and ensure they adhere to the project's coding standards.
|
||||
|
||||
6. Run the tests locally:
|
||||
|
||||
```bash
|
||||
poetry run pytest
|
||||
```
|
||||
|
||||
7. If all tests pass, commit your changes and push to your fork.
|
||||
8. Open a pull request with a clear title and description.
|
||||
|
||||
Please ensure your code follows our coding conventions and is well-documented.
|
||||
|
||||
|
||||
If you have any questions, please feel free to reach out to us using one of the following methods:
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
- **[OpenAI Compatibility](/open-source/features/openai_compatibility)** - Use Mem0 with OpenAI-compatible chat completions
|
||||
- **[Contributing Guide](/contributing/development)** - Learn how to contribute to Mem0
|
||||
- **[Examples](/examples/mem0-with-ollama)** - See Mem0 in action with Ollama and other integrations
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Advanced Retrieval
|
||||
icon: "magnifying-glass"
|
||||
iconType: "solid"
|
||||
description: "Advanced memory search with keyword expansion, intelligent reranking, and precision filtering"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Async Client
|
||||
description: 'Asynchronous client for Mem0'
|
||||
icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
The `AsyncMemoryClient` is an asynchronous client for interacting with the Mem0 API. It provides similar functionality to the synchronous `MemoryClient` but allows for non-blocking operations, which can be beneficial in applications that require high concurrency.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Async Mode Default Change
|
||||
description: 'Important update to Memory Addition API behavior'
|
||||
icon: "clock-rotate-left"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Note type="warning">
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Contextual Memory Creation
|
||||
icon: "square-plus"
|
||||
iconType: "solid"
|
||||
description: "Add messages with automatic context management - no manual history tracking required"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Criteria Retrieval
|
||||
icon: "magnifying-glass-plus"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0's Criteria Retrieval feature allows you to retrieve memories based on your defined criteria. It goes beyond generic semantic relevance and ranks memories based on what matters to your application: emotional tone, intent, behavioral signals, or other custom traits.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Custom Categories
|
||||
description: 'Enhance your product experience by adding custom categories tailored to your needs'
|
||||
icon: "tags"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## How to Set Custom Categories
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Custom Instructions
|
||||
description: 'Control how Mem0 extracts and stores memories using natural language guidelines'
|
||||
icon: "pencil"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## What are Custom Instructions?
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Direct Import
|
||||
description: 'Bypass the memory deduction phase and directly store pre-defined memories for efficient retrieval'
|
||||
icon: "arrow-right"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## How to Use Direct Import
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Expiration Date
|
||||
description: 'Set time-bound memories in Mem0 with automatic expiration dates to manage temporal information effectively.'
|
||||
icon: "clock"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Benefits of Memory Expiration
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Feedback Mechanism
|
||||
icon: "thumbs-up"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0's Feedback Mechanism allows you to provide feedback on the memories generated by your application. This feedback is used to improve the accuracy of the memories and search results.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Graph Memory
|
||||
icon: "circle-nodes"
|
||||
iconType: "solid"
|
||||
description: "Enable graph-based memory retrieval for more contextually relevant results"
|
||||
---
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Group Chat
|
||||
description: 'Enable multi-participant conversations with automatic memory attribution to individual speakers'
|
||||
icon: "users"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
<Snippet file="paper-release.mdx" />
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Memory Export
|
||||
description: 'Export memories in a structured format using customizable Pydantic schemas'
|
||||
icon: "file-export"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Multimodal Support
|
||||
description: Integrate images and documents into your interactions with Mem0
|
||||
icon: "image"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 extends its capabilities beyond text by supporting multimodal data, including images and documents. With this feature, users can seamlessly integrate visual and document content into their interactions, allowing Mem0 to extract relevant information from various media types and enrich the memory system.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Overview
|
||||
icon: "info"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Learn about the key features and capabilities that make Mem0 a powerful platform for memory management and retrieval.
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Memory Timestamps
|
||||
description: 'Add timestamps to your memories to maintain chronological accuracy and historical context'
|
||||
icon: "clock"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
---
|
||||
title: Memory Filters v2
|
||||
icon: "filter"
|
||||
iconType: "solid"
|
||||
description: This guide covers the filtering system for retrieving and searching memories. You can filter by user sessions, agents, applications, content categories, and time ranges.
|
||||
---
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
---
|
||||
title: Webhooks
|
||||
description: 'Configure and manage webhooks to receive real-time notifications about memory events'
|
||||
icon: "webhook"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
+117
-20
@@ -1,32 +1,129 @@
|
||||
---
|
||||
title: Overview
|
||||
description: 'Empower your AI applications with long-term memory and personalization'
|
||||
icon: "eye"
|
||||
iconType: "solid"
|
||||
title: "Overview"
|
||||
description: "Managed memory layer for AI agents - production-ready in minutes"
|
||||
icon: "cloud"
|
||||
---
|
||||
|
||||
<Tip>
|
||||
**Mem0 v1.0.0 is now available** — Introducing rerankers, async by default, Azure support, and more. [View changelog →](/changelog)
|
||||
</Tip>
|
||||
|
||||
## Welcome to Mem0 Platform
|
||||
|
||||
The Mem0 Platform is a managed service and the easiest way to add our powerful memory layer to your applications.
|
||||
**Mem0 Platform is a fully managed memory layer for AI agents.** Add persistent, personalized memory to your AI applications in minutes - no infrastructure setup required.
|
||||
|
||||
## What is Mem0?
|
||||
|
||||
Mem0 is a memory layer that enables your AI applications to remember user preferences, conversation history, and contextual information across sessions. Instead of treating every interaction as isolated, Mem0 allows your AI to build on previous conversations and adapt to individual users over time.
|
||||
|
||||
## What Problem Does It Solve?
|
||||
|
||||
Without Mem0, every AI conversation starts from scratch:
|
||||
- User preferences disappear between sessions
|
||||
- Previous context is lost and must be re-explained
|
||||
- Personalization becomes impossible
|
||||
- AI can't learn or adapt to individual users
|
||||
|
||||
With Mem0, your AI remembers:
|
||||
- Context persists across sessions with sub-50ms latency
|
||||
- Preferences are automatically recalled
|
||||
- Responses adapt to each user's history
|
||||
- No infrastructure setup or vector DB management required
|
||||
|
||||
## Where Can I Use Mem0?
|
||||
|
||||
Mem0 powers memory for diverse AI applications. Explore real-world implementations:
|
||||
|
||||
- **[Customer Support Agents](/examples/customer-support-agent)** - Remember customer history and preferences
|
||||
- **[AI Tutors](/examples/personal-ai-tutor)** - Track learning progress and adapt lessons
|
||||
- **[Travel Assistants](/examples/personal-travel-assistant)** - Recall travel preferences and past trips
|
||||
- **[Content Writing](/examples/memory-guided-content-writing)** - Maintain consistent voice and context
|
||||
|
||||
[View all cookbooks →](/examples)
|
||||
|
||||
---
|
||||
|
||||
## Explore Platform Capabilities
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="Platform Quickstart"
|
||||
icon="rocket"
|
||||
href="/platform/quickstart"
|
||||
>
|
||||
Get your first memory stored in 5 minutes. Step-by-step guide with code examples.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Platform vs Open Source"
|
||||
icon="scale"
|
||||
href="/platform/platform-vs-oss"
|
||||
>
|
||||
Compare managed and self-hosted options. See which fits your needs best.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Memory Types"
|
||||
icon="brain"
|
||||
href="/core-concepts/memory-types"
|
||||
>
|
||||
Understand user memories, agent memories, and session-specific context.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Platform Features"
|
||||
icon="sparkles"
|
||||
href="/platform/features/platform-overview"
|
||||
>
|
||||
Explore graph memory, multimodal support, webhooks, and advanced retrieval.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Framework Integrations"
|
||||
icon="plug"
|
||||
href="/integrations"
|
||||
>
|
||||
Use Mem0 with LangChain, CrewAI, LlamaIndex, and 15+ other frameworks.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Dashboard"
|
||||
icon="chart-line"
|
||||
href="https://app.mem0.ai"
|
||||
>
|
||||
Monitor memory operations, track usage, and manage your AI agents.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
---
|
||||
|
||||
## Why Choose Mem0 Platform?
|
||||
|
||||
Mem0 Platform offers a powerful, user-centric solution for AI memory management with a few key features:
|
||||
| Feature | What You Get |
|
||||
|---------|--------------|
|
||||
| **Fast Setup** | Add 4 lines of code and you're production-ready. No vector DB setup, no LLM configuration, no DevOps. |
|
||||
| **Production Scale** | Automatic scaling, high availability, and fully managed infrastructure. Focus on your app, not operations. |
|
||||
| **Advanced Features** | Graph memory, webhooks, multimodal support, and custom categories - exclusive to Platform. |
|
||||
| **Enterprise Ready** | SOC 2 Type II certified, GDPR compliant, with dedicated support for production workloads. |
|
||||
|
||||
1. **Simplified Development**: Integrate comprehensive memory capabilities with just 4 lines of code. Our API-first approach allows you to focus on building great features while we handle the complexities of memory management.
|
||||
|
||||
2. **Scalable Solution**: Whether you're working on a prototype or a production-ready system, Mem0 is designed to grow with your application. Our platform effortlessly scales to meet your evolving needs.
|
||||
|
||||
3. **Enhanced Performance**: Experience lightning-fast response times with sub-50ms latency, ensuring smooth and responsive user interactions in your AI applications.
|
||||
|
||||
4. **Insightful Dashboard**: Gain valuable insights and maintain full control over your AI's memory through our intuitive dashboard. Easily manage memories and access key user insights.
|
||||
|
||||
|
||||
## Getting Started
|
||||
|
||||
Check out our [Platform Guide](/platform/quickstart) to start using Mem0 platform quickly.
|
||||
---
|
||||
|
||||
## Next Steps
|
||||
|
||||
- Sign up to the [Mem0 Platform](https://mem0.dev/pd)
|
||||
- Join our [Discord](https://mem0.dev/Did) with other developers and get support.
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="Start Building"
|
||||
icon="rocket"
|
||||
href="/platform/quickstart"
|
||||
>
|
||||
Follow the quickstart guide to create your first memory in 5 minutes
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Compare Options"
|
||||
icon="code-compare"
|
||||
href="/platform/platform-vs-oss"
|
||||
>
|
||||
See the full comparison between Platform and Open Source
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
@@ -0,0 +1,165 @@
|
||||
---
|
||||
title: "Platform vs Open Source"
|
||||
description: "Choose the right Mem0 solution for your needs"
|
||||
icon: "code-compare"
|
||||
---
|
||||
|
||||
## Which Mem0 is right for you?
|
||||
|
||||
Mem0 offers two powerful ways to add memory to your AI applications. Choose based on your priorities:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="Mem0 Platform"
|
||||
icon="cloud"
|
||||
href="/platform/quickstart"
|
||||
>
|
||||
**Managed, hassle-free**
|
||||
|
||||
Get started in 5 minutes with our hosted solution. Perfect for fast iteration and production apps.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Open Source"
|
||||
icon="code-branch"
|
||||
href="/open-source/python-quickstart"
|
||||
>
|
||||
**Self-hosted, full control**
|
||||
|
||||
Deploy on your infrastructure. Choose your vector DB, LLM, and configure everything.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
---
|
||||
|
||||
## Feature Comparison
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Setup & Getting Started" icon="rocket">
|
||||
| Feature | Platform | Open Source |
|
||||
|---------|----------|-------------|
|
||||
| **Time to first memory** | 5 minutes | 15-30 minutes |
|
||||
| **Infrastructure needed** | None | Vector DB + Python/Node env |
|
||||
| **API key setup** | One environment variable | Configure LLM + embedder + vector DB |
|
||||
| **Maintenance** | Fully managed by Mem0 | Self-managed |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Core Memory Features" icon="brain">
|
||||
| Feature | Platform | Open Source |
|
||||
|---------|----------|-------------|
|
||||
| **User & agent memories** | ✅ | ✅ |
|
||||
| **Smart deduplication** | ✅ | ✅ |
|
||||
| **Semantic search** | ✅ | ✅ |
|
||||
| **Memory updates** | ✅ | ✅ |
|
||||
| **Multi-language SDKs** | Python, JavaScript | Python, JavaScript |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Advanced Capabilities" icon="sparkles">
|
||||
| Feature | Platform | Open Source |
|
||||
|---------|----------|-------------|
|
||||
| **Graph Memory** | ✅ (Managed) | ✅ (Self-configured) |
|
||||
| **Multimodal support** | ✅ | ✅ |
|
||||
| **Custom categories** | ✅ | Limited |
|
||||
| **Advanced retrieval** | ✅ | ✅ |
|
||||
| **Memory filters v2** | ✅ | ⚠️ (via metadata) |
|
||||
| **Webhooks** | ✅ | ❌ |
|
||||
| **Memory export** | ✅ | ❌ |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Infrastructure & Scaling" icon="server">
|
||||
| Feature | Platform | Open Source |
|
||||
|---------|----------|-------------|
|
||||
| **Hosting** | Managed by Mem0 | Self-hosted |
|
||||
| **Auto-scaling** | ✅ | Manual |
|
||||
| **High availability** | ✅ Built-in | DIY setup |
|
||||
| **Vector DB choice** | Managed | Qdrant, Chroma, Pinecone, Milvus, +20 more |
|
||||
| **LLM choice** | Managed (optimized) | OpenAI, Anthropic, Ollama, Together, +10 more |
|
||||
| **Data residency** | US (expandable) | Your choice |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Pricing & Cost" icon="dollar-sign">
|
||||
| Aspect | Platform | Open Source |
|
||||
|--------|----------|-------------|
|
||||
| **License** | Usage-based pricing | Apache 2.0 (free) |
|
||||
| **Infrastructure costs** | Included in pricing | You pay for VectorDB + LLM + hosting |
|
||||
| **Support** | Included | Community + GitHub |
|
||||
| **Best for** | Fast iteration, production apps | Cost-sensitive, custom requirements |
|
||||
</Accordion>
|
||||
|
||||
<Accordion title="Development & Integration" icon="code">
|
||||
| Feature | Platform | Open Source |
|
||||
|---------|----------|-------------|
|
||||
| **REST API** | ✅ | ✅ (via feature flag) |
|
||||
| **Python SDK** | ✅ | ✅ |
|
||||
| **JavaScript SDK** | ✅ | ✅ |
|
||||
| **Framework integrations** | LangChain, CrewAI, LlamaIndex, +15 | Same |
|
||||
| **Dashboard** | ✅ Web-based | ❌ |
|
||||
| **Analytics** | ✅ Built-in | DIY |
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
---
|
||||
|
||||
## Decision Guide
|
||||
|
||||
### Choose **Platform** if you want:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card icon="bolt" title="Fast Time to Market">
|
||||
Get your AI app with memory live in hours, not weeks. No infrastructure setup needed.
|
||||
</Card>
|
||||
|
||||
<Card icon="shield" title="Production-Ready">
|
||||
Auto-scaling, high availability, and managed infrastructure out of the box.
|
||||
</Card>
|
||||
|
||||
<Card icon="chart-line" title="Built-in Analytics">
|
||||
Track memory usage, query patterns, and user engagement through our dashboard.
|
||||
</Card>
|
||||
|
||||
<Card icon="webhook" title="Advanced Features">
|
||||
Access to webhooks, memory export, custom categories, and priority support.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Choose **Open Source** if you need:
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card icon="lock" title="Full Data Control">
|
||||
Host everything on your infrastructure. Complete data residency and privacy control.
|
||||
</Card>
|
||||
|
||||
<Card icon="wrench" title="Custom Configuration">
|
||||
Choose your own vector DB, LLM provider, embedder, and deployment strategy.
|
||||
</Card>
|
||||
|
||||
<Card icon="code" title="Extensibility">
|
||||
Modify the codebase, add custom features, and contribute back to the community.
|
||||
</Card>
|
||||
|
||||
<Card icon="dollar-sign" title="Cost Optimization">
|
||||
Use local LLMs (Ollama), self-hosted vector DBs, and optimize for your specific use case.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
---
|
||||
|
||||
## Still not sure?
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card
|
||||
title="Try Platform Free"
|
||||
icon="rocket"
|
||||
href="https://app.mem0.ai"
|
||||
>
|
||||
Sign up and test the Platform with our free tier. No credit card required.
|
||||
</Card>
|
||||
|
||||
<Card
|
||||
title="Explore Open Source"
|
||||
icon="github"
|
||||
href="https://github.com/mem0ai/mem0"
|
||||
>
|
||||
Clone the repo and run locally to see how it works. Star us while you're there!
|
||||
</Card>
|
||||
</CardGroup>
|
||||
+92
-163
@@ -1,14 +1,22 @@
|
||||
---
|
||||
title: Quickstart
|
||||
description: 'Get started with Mem0 Platform in minutes'
|
||||
description: "Get started with Mem0 Platform in minutes"
|
||||
icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Get up and running with Mem0 Platform quickly. This guide covers the essential steps to start storing and retrieving memories.
|
||||
Get started with Mem0 Platform's hosted API in under 5 minutes. This guide shows you how to authenticate and store your first memory.
|
||||
|
||||
## 1. Installation
|
||||
## Prerequisites
|
||||
|
||||
- Mem0 Platform account ([Sign up here](https://app.mem0.ai))
|
||||
- API key ([Get one from dashboard](https://app.mem0.ai/settings/api-keys))
|
||||
- Python 3.10+, Node.js 14+, or cURL
|
||||
|
||||
## Installation
|
||||
|
||||
<Steps>
|
||||
<Step title="Install SDK">
|
||||
<CodeGroup>
|
||||
```bash pip
|
||||
pip install mem0ai
|
||||
@@ -17,205 +25,126 @@ pip install mem0ai
|
||||
```bash npm
|
||||
npm install mem0ai
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
|
||||
## 2. API Key Setup
|
||||
|
||||
1. Sign in to [Mem0 Platform](https://mem0.dev/pd-api)
|
||||
2. Copy your API Key from the dashboard
|
||||
|
||||

|
||||
|
||||
## 3. Initialize Client
|
||||
|
||||
<Step title="Set your API key">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import MemoryClient
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
client = MemoryClient()
|
||||
```
|
||||
client = MemoryClient(api_key="your-api-key")
|
||||
````
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
const client = new MemoryClient({ apiKey: 'your-api-key' });
|
||||
````
|
||||
|
||||
```bash cURL
|
||||
export MEM0_API_KEY="your-api-key"
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
|
||||
## 4. Basic Operations
|
||||
|
||||
### Add Memories
|
||||
|
||||
Store user preferences and context:
|
||||
|
||||
<Step title="Add a memory">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
messages = [
|
||||
{"role": "user", "content": "Hi, I'm Alex. I'm a vegetarian and allergic to nuts."},
|
||||
{"role": "assistant", "content": "Hello Alex! I'll remember your dietary preferences."}
|
||||
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
|
||||
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
||||
]
|
||||
|
||||
result = client.add(messages, user_id="alex")
|
||||
print(result)
|
||||
```
|
||||
client.add(messages, user_id="user123")
|
||||
````
|
||||
|
||||
```javascript JavaScript
|
||||
const messages = [
|
||||
{"role": "user", "content": "Hi, I'm Alex. I'm a vegetarian and allergic to nuts."},
|
||||
{"role": "assistant", "content": "Hello Alex! I'll remember your dietary preferences."}
|
||||
{"role": "user", "content": "I'm a vegetarian and allergic to nuts."},
|
||||
{"role": "assistant", "content": "Got it! I'll remember your dietary preferences."}
|
||||
];
|
||||
await client.add(messages, { user_id: "user123" });
|
||||
````
|
||||
|
||||
client.add(messages, { user_id: "alex" })
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.error(error));
|
||||
```bash cURL
|
||||
curl -X POST https://api.mem0.ai/v1/memories/add \
|
||||
-H "Authorization: Bearer $MEM0_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"messages": [
|
||||
{"role": "user", "content": "Im a vegetarian and allergic to nuts."},
|
||||
{"role": "assistant", "content": "Got it! Ill remember your dietary preferences."}
|
||||
],
|
||||
"user_id": "user123"
|
||||
}'
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
|
||||
### Search Memories
|
||||
|
||||
Retrieve relevant memories based on queries:
|
||||
|
||||
<Step title="Search memories">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
query = "What should I cook for dinner?"
|
||||
results = client.search(query, user_id="alex")
|
||||
results = client.search("What are my dietary restrictions?", filters={"user_id": "user123"})
|
||||
print(results)
|
||||
```
|
||||
````
|
||||
|
||||
```javascript JavaScript
|
||||
const query = "What should I cook for dinner?";
|
||||
client.search(query, { user_id: "alex" })
|
||||
.then(results => console.log(results))
|
||||
.catch(error => console.error(error));
|
||||
const results = await client.search("What are my dietary restrictions?", { filters: { user_id: "user123" } });
|
||||
console.log(results);
|
||||
````
|
||||
|
||||
```bash cURL
|
||||
curl -X POST https://api.mem0.ai/v1/memories/search \
|
||||
-H "Authorization: Bearer $MEM0_API_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"query": "What are my dietary restrictions?",
|
||||
"filters": {"user_id": "user123"}
|
||||
}'
|
||||
```
|
||||
|
||||
</CodeGroup>
|
||||
|
||||
### Get All Memories
|
||||
**Output:**
|
||||
|
||||
Fetch all memories for a user:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
memories = client.get_all(user_id="alex")
|
||||
print(memories)
|
||||
```json
|
||||
{
|
||||
"results": [
|
||||
{
|
||||
"id": "14e1b28a-2014-40ad-ac42-69c9ef42193d",
|
||||
"memory": "Allergic to nuts",
|
||||
"user_id": "user123",
|
||||
"categories": ["health"],
|
||||
"created_at": "2025-10-22T04:40:22.864647-07:00",
|
||||
"score": 0.30
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
client.getAll({ user_id: "alex" })
|
||||
.then(memories => console.log(memories))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
</Step>
|
||||
</Steps>
|
||||
|
||||
## 5. Memory Types
|
||||
## What's Next?
|
||||
|
||||
### User Memories
|
||||
Long-term memories that persist across sessions:
|
||||
<CardGroup cols={3}>
|
||||
<Card title="Memory Operations" icon="database" href="/core-concepts/memory-operations/add">
|
||||
Learn how to search, update, and delete memories with complete CRUD operations
|
||||
</Card>
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
client.add(messages, user_id="alex", metadata={"category": "preferences"})
|
||||
```
|
||||
<Card title="Platform Features" icon="star" href="/platform/features/platform-overview">
|
||||
Explore advanced features like metadata filtering, graph memory, and webhooks
|
||||
</Card>
|
||||
|
||||
```javascript JavaScript
|
||||
client.add(messages, { user_id: "alex", metadata: { category: "preferences" } });
|
||||
```
|
||||
</CodeGroup>
|
||||
<Card title="API Reference" icon="code" href="/api-reference/memory/add-memories">
|
||||
See complete API documentation and integration examples
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
### Session Memories
|
||||
Short-term memories for specific conversations:
|
||||
## Additional Resources
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
client.add(messages, user_id="alex", run_id="session-123")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
client.add(messages, { user_id: "alex", run_id: "session-123" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Agent Memories
|
||||
Memories for AI assistants and agents:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
client.add(messages, agent_id="support-bot")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
client.add(messages, { agent_id: "support-bot" });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## 6. Advanced Features
|
||||
|
||||
### Async Processing
|
||||
Process memories in the background for faster responses:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
client.add(messages, user_id="alex", async_mode=True)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
client.add(messages, { user_id: "alex", async_mode: true });
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
### Search with Filters
|
||||
Filter results by categories and metadata:
|
||||
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
results = client.search(
|
||||
"food preferences",
|
||||
user_id="alex",
|
||||
categories=["preferences"],
|
||||
metadata={"category": "food"}
|
||||
)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
client.search("food preferences", {
|
||||
user_id: "alex",
|
||||
categories: ["preferences"],
|
||||
metadata: { category: "food" }
|
||||
});
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## TypeScript Example
|
||||
|
||||
<CodeGroup>
|
||||
```typescript TypeScript
|
||||
import MemoryClient, { Message, MemoryOptions } from 'mem0ai';
|
||||
|
||||
const client = new MemoryClient('your-api-key');
|
||||
|
||||
const messages: Message[] = [
|
||||
{ role: "user", content: "I love Italian food" },
|
||||
{ role: "assistant", content: "Noted! I'll remember your preference for Italian cuisine." }
|
||||
];
|
||||
|
||||
const options: MemoryOptions = {
|
||||
user_id: "alex",
|
||||
metadata: { category: "food_preferences" }
|
||||
};
|
||||
|
||||
client.add(messages, options)
|
||||
.then(result => console.log(result))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
## Next Steps
|
||||
|
||||
Now that you're up and running, explore more advanced features:
|
||||
|
||||
- **[Advanced Memory Operations](/core-concepts/memory-operations)** - Learn about filtering, updating, and managing memories
|
||||
- **[Platform Features](/platform/features/platform-overview)** - Discover advanced platform capabilities
|
||||
- **[API Reference](/api-reference)** - Complete API documentation
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
- **[Platform vs OSS](/platform/platform-vs-oss)** - Understand the differences between Platform and Open Source
|
||||
- **[Troubleshooting](/platform/faqs)** - Common issues and solutions
|
||||
- **[Integration Examples](/examples/mem0-demo)** - See Mem0 in action
|
||||
|
||||
@@ -1,418 +0,0 @@
|
||||
---
|
||||
title: Quickstart
|
||||
icon: "bolt"
|
||||
iconType: "solid"
|
||||
---
|
||||
|
||||
Mem0 offers two powerful ways to leverage our technology: [our managed platform](#mem0-platform-managed-solution) and [our open source solution](#mem0-open-source).
|
||||
|
||||
Check out our [Playground](https://mem0.dev/pd-pg) to see Mem0 in action.
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Mem0 Platform (Managed Solution)" icon="chart-simple" href="#mem0-platform-managed-solution">
|
||||
Better, faster, fully managed, and hassle-free solution.
|
||||
</Card>
|
||||
<Card title="Mem0 Open Source" icon="code-branch" href="#mem0-open-source">
|
||||
Self-hosted, fully customizable, and open source.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
|
||||
## Mem0 Platform (Managed Solution)
|
||||
|
||||
Our fully managed platform provides a hassle-free way to integrate Mem0's capabilities into your AI agents and assistants. Sign up for Mem0 platform [here](https://mem0.dev/pd).
|
||||
|
||||
The Mem0 SDK supports both Python and JavaScript, with full [TypeScript](/platform/quickstart/#4-11-working-with-mem0-in-typescript) support as well.
|
||||
|
||||
Follow the steps below to get started with Mem0 Platform:
|
||||
|
||||
1. [Install Mem0](#1-install-mem0)
|
||||
2. [Add Memories](#2-add-memories)
|
||||
3. [Retrieve Memories](#3-retrieve-memories)
|
||||
|
||||
### 1. Install Mem0
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Install package">
|
||||
<CodeGroup>
|
||||
```bash pip
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
```bash npm
|
||||
npm install mem0ai
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
<Accordion title="Get API Key">
|
||||
|
||||
1. Sign in to [Mem0 Platform](https://mem0.dev/pd-api)
|
||||
2. Copy your API Key from the dashboard
|
||||
|
||||

|
||||
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### 2. Add Memories
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Instantiate client">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
import os
|
||||
from mem0 import MemoryClient
|
||||
|
||||
os.environ["MEM0_API_KEY"] = "your-api-key"
|
||||
|
||||
client = MemoryClient()
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
import MemoryClient from 'mem0ai';
|
||||
const client = new MemoryClient({ apiKey: 'your-api-key' });
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
<Accordion title="Add memories">
|
||||
<CodeGroup>
|
||||
|
||||
```python Python
|
||||
messages = [
|
||||
{"role": "user", "content": "Thinking of making a sandwich. What do you recommend?"},
|
||||
{"role": "assistant", "content": "How about adding some cheese for extra flavor?"},
|
||||
{"role": "user", "content": "Actually, I don't like cheese."},
|
||||
{"role": "assistant", "content": "I'll remember that you don't like cheese for future recommendations."}
|
||||
]
|
||||
client.add(messages, user_id="alex")
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const messages = [
|
||||
{"role": "user", "content": "Thinking of making a sandwich. What do you recommend?"},
|
||||
{"role": "assistant", "content": "How about adding some cheese for extra flavor?"},
|
||||
{"role": "user", "content": "Actually, I don't like cheese."},
|
||||
{"role": "assistant", "content": "I'll remember that you don't like cheese for future recommendations."}
|
||||
];
|
||||
client.add(messages, { user_id: "alex" })
|
||||
.then(response => console.log(response))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "https://api.mem0.ai/v1/memories/" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"messages": [
|
||||
{"role": "user", "content": "I live in San Francisco. Thinking of making a sandwich. What do you recommend?"},
|
||||
{"role": "assistant", "content": "How about adding some cheese for extra flavor?"},
|
||||
{"role": "user", "content": "Actually, I don't like cheese."},
|
||||
{"role": "assistant", "content": "I'll remember that you don't like cheese for future recommendations."}
|
||||
],
|
||||
"user_id": "alex"
|
||||
}'
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": "24e466b5-e1c6-4bde-8a92-f09a327ffa60",
|
||||
"memory": "Does not like cheese",
|
||||
"event": "ADD"
|
||||
},
|
||||
{
|
||||
"id": "e8d78459-fadd-4c5a-bece-abb8c3dc7ed7",
|
||||
"memory": "Lives in San Francisco",
|
||||
"event": "ADD"
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### 3. Retrieve Memories
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Search for relevant memories">
|
||||
<CodeGroup>
|
||||
|
||||
```python Python
|
||||
# Example showing location and preference-aware recommendations
|
||||
query = "I'm craving some pizza. Any recommendations?"
|
||||
filters = {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
}
|
||||
]
|
||||
}
|
||||
client.search(query, filters=filters)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const query = "I'm craving some pizza. Any recommendations?";
|
||||
const filters = {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
}
|
||||
]
|
||||
};
|
||||
client.search(query, { filters })
|
||||
.then(results => console.log(results))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X POST "https://api.mem0.ai/v2/memories/search/" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"query": "I'm craving some pizza. Any recommendations?",
|
||||
"filters": {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
}
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": "7f165f7e-b411-4afe-b7e5-35789b72c4a5",
|
||||
"memory": "Does not like cheese",
|
||||
"user_id": "alex",
|
||||
"metadata": null,
|
||||
"created_at": "2024-07-20T01:30:36.275141-07:00",
|
||||
"updated_at": "2024-07-20T01:30:36.275172-07:00",
|
||||
"score": 0.92
|
||||
},
|
||||
{
|
||||
"id": "8f165f7e-b411-4afe-b7e5-35789b72c4b6",
|
||||
"memory": "Lives in San Francisco",
|
||||
"user_id": "alex",
|
||||
"metadata": null,
|
||||
"created_at": "2024-07-20T01:30:36.275141-07:00",
|
||||
"updated_at": "2024-07-20T01:30:36.275172-07:00",
|
||||
"score": 0.85
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
</Accordion>
|
||||
<Accordion title="Get all memories of a user">
|
||||
|
||||
<CodeGroup>
|
||||
|
||||
```python Python
|
||||
filters = {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
all_memories = client.get_all(filters=filters, page=1, page_size=50)
|
||||
```
|
||||
|
||||
```javascript JavaScript
|
||||
const filters = {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alex"
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
client.getAll({ filters, page: 1, page_size: 50 })
|
||||
.then(memories => console.log(memories))
|
||||
.catch(error => console.error(error));
|
||||
```
|
||||
|
||||
```bash cURL
|
||||
curl -X GET "https://api.mem0.ai/v2/memories/?page=1&page_size=50" \
|
||||
-H "Authorization: Token your-api-key" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"filters": {
|
||||
"AND": [
|
||||
{
|
||||
"user_id": "alice"
|
||||
}
|
||||
]
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": "7f165f7e-b411-4afe-b7e5-35789b72c4a5",
|
||||
"memory": "Does not like cheese",
|
||||
"user_id": "alex",
|
||||
"metadata": null,
|
||||
"created_at": "2024-07-20T01:30:36.275141-07:00",
|
||||
"updated_at": "2024-07-20T01:30:36.275172-07:00",
|
||||
"score": 0.92
|
||||
},
|
||||
{
|
||||
"id": "8f165f7e-b411-4afe-b7e5-35789b72c4b6",
|
||||
"memory": "Lives in San Francisco",
|
||||
"user_id": "alex",
|
||||
"metadata": null,
|
||||
"created_at": "2024-07-20T01:30:36.275141-07:00",
|
||||
"updated_at": "2024-07-20T01:30:36.275172-07:00",
|
||||
"score": 0.85
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
<Card title="Mem0 Platform" icon="chart-simple" href="/platform/overview">
|
||||
Learn more about Mem0 platform
|
||||
</Card>
|
||||
|
||||
## Mem0 Open Source
|
||||
|
||||
Our open-source version is available for those who prefer full control and customization. You can self-host Mem0 on your infrastructure and integrate it with your AI agents and assistants. Check out our [GitHub repository](https://mem0.dev/gd).
|
||||
|
||||
Follow the steps below to get started with Mem0 Open Source:
|
||||
|
||||
1. [Install Mem0 Open Source](#1-install-mem0-open-source)
|
||||
2. [Add Memories](#2-add-memories-open-source)
|
||||
3. [Retrieve Memories](#3-retrieve-memories-open-source)
|
||||
|
||||
### 1. Install Mem0 Open Source
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Install package">
|
||||
<CodeGroup>
|
||||
```bash pip
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
```bash npm
|
||||
npm install mem0ai
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### 2. Add Memories <a name="2-add-memories-open-source"></a>
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Instantiate client">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
from mem0 import Memory
|
||||
m = Memory()
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
import { Memory } from 'mem0ai/oss';
|
||||
const memory = new Memory();
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
<Accordion title="Add memories">
|
||||
<CodeGroup>
|
||||
```python Code
|
||||
# For a user
|
||||
messages = [
|
||||
{
|
||||
"role": "user",
|
||||
"content": "I like to drink coffee in the morning and go for a walk"
|
||||
}
|
||||
]
|
||||
result = m.add(messages, user_id="alice", metadata={"category": "preferences"})
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
const messages = [
|
||||
{
|
||||
role: "user",
|
||||
content: "I like to drink coffee in the morning and go for a walk"
|
||||
}
|
||||
];
|
||||
const result = memory.add(messages, { userId: "alice", metadata: { category: "preferences" } });
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": "3dc6f65f-fb3f-4e91-89a8-ed1a22f8898a",
|
||||
"data": {"memory": "Likes to drink coffee in the morning"},
|
||||
"event": "ADD"
|
||||
},
|
||||
{
|
||||
"id": "f1673706-e3d6-4f12-a767-0384c7697d53",
|
||||
"data": {"memory": "Likes to go for a walk"},
|
||||
"event": "ADD"
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
### 3. Retrieve Memories <a name="3-retrieve-memories-open-source"></a>
|
||||
|
||||
<AccordionGroup>
|
||||
<Accordion title="Search for relevant memories">
|
||||
<CodeGroup>
|
||||
```python Python
|
||||
related_memories = m.search("Should I drink coffee or tea?", user_id="alice")
|
||||
```
|
||||
|
||||
```typescript TypeScript
|
||||
const relatedMemories = memory.search("Should I drink coffee or tea?", { userId: "alice" });
|
||||
```
|
||||
|
||||
```json Output
|
||||
[
|
||||
{
|
||||
"id": "3dc6f65f-fb3f-4e91-89a8-ed1a22f8898a",
|
||||
"memory": "Likes to drink coffee in the morning",
|
||||
"user_id": "alice",
|
||||
"metadata": {"category": "preferences"},
|
||||
"categories": ["user_preferences", "food"],
|
||||
"immutable": false,
|
||||
"created_at": "2025-02-24T20:11:39.010261-08:00",
|
||||
"updated_at": "2025-02-24T20:11:39.010274-08:00",
|
||||
"score": 0.5915589089130715
|
||||
},
|
||||
{
|
||||
"id": "e8d78459-fadd-4c5a-bece-abb8c3dc7ed7",
|
||||
"memory": "Likes to go for a walk",
|
||||
"user_id": "alice",
|
||||
"metadata": {"category": "preferences"},
|
||||
"categories": ["hobby", "food"],
|
||||
"immutable": false,
|
||||
"created_at": "2025-02-24T11:47:52.893038-08:00",
|
||||
"updated_at": "2025-02-24T11:47:52.893048-08:00",
|
||||
"score": 0.43263634637810866
|
||||
}
|
||||
]
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
</Accordion>
|
||||
</AccordionGroup>
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="Mem0 OSS Python SDK" icon="python" href="/open-source/python-quickstart">
|
||||
Learn more about Mem0 OSS Python SDK
|
||||
</Card>
|
||||
<Card title="Mem0 OSS Node.js SDK" icon="node" href="/open-source/node-quickstart">
|
||||
Learn more about Mem0 OSS Node.js SDK
|
||||
</Card>
|
||||
</CardGroup>
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 'Mem0 with OpenAI Agents SDK for Voice'
|
||||
description: 'Integrate memory capabilities into your voice agents using Mem0 and OpenAI Agents SDK'
|
||||
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
|
||||
@@ -12,16 +12,19 @@ This guide demonstrates how to combine OpenAI's Agents SDK for voice application
|
||||
Before you begin, make sure you have:
|
||||
|
||||
1. Installed OpenAI Agents SDK with voice dependencies:
|
||||
|
||||
```bash
|
||||
pip install 'openai-agents[voice]'
|
||||
```
|
||||
|
||||
2. Installed Mem0 SDK:
|
||||
|
||||
```bash
|
||||
pip install mem0ai
|
||||
```
|
||||
|
||||
3. Installed other required dependencies:
|
||||
|
||||
```bash
|
||||
pip install numpy sounddevice pydantic
|
||||
```
|
||||
@@ -64,6 +67,7 @@ mem0_client = AsyncMemoryClient()
|
||||
```
|
||||
|
||||
This section handles:
|
||||
|
||||
- Importing required modules from OpenAI Agents SDK and Mem0
|
||||
- Setting up environment variables for API keys
|
||||
- Defining a simple user identification system (using a global variable)
|
||||
@@ -94,7 +98,7 @@ async def save_memories(
|
||||
"""Store a user memory in memory."""
|
||||
# This will be visible in your console
|
||||
logger.debug(f"Saving memory: {memory} for user {USER_ID}")
|
||||
|
||||
|
||||
# Store the preference in Mem0
|
||||
memory_content = f"User memory - {memory}"
|
||||
await mem0_client.add(
|
||||
@@ -106,6 +110,7 @@ async def save_memories(
|
||||
```
|
||||
|
||||
This function:
|
||||
|
||||
- Takes a memory string
|
||||
- Creates a formatted memory string
|
||||
- Stores it in Mem0 using the `add()` method
|
||||
@@ -132,16 +137,17 @@ async def search_memories(
|
||||
threshold=0.7, # Higher threshold for more relevant results
|
||||
output_format="v1.1"
|
||||
)
|
||||
|
||||
|
||||
# Format and return the results
|
||||
if not results.get('results', []):
|
||||
return "I don't have any relevant memories about this topic."
|
||||
|
||||
|
||||
memories = [f"• {result['memory']}" for result in results.get('results', [])]
|
||||
return "Here's what I remember that might be relevant:\n" + "\n".join(memories)
|
||||
```
|
||||
|
||||
This tool:
|
||||
|
||||
- Takes a search query string
|
||||
- Passes it to Mem0's semantic search to find related memories
|
||||
- Sets a threshold for relevance to ensure quality results
|
||||
@@ -165,11 +171,12 @@ def create_memory_voice_agent():
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
tools=[save_memories, search_memories],
|
||||
)
|
||||
|
||||
|
||||
return agent
|
||||
```
|
||||
|
||||
This function:
|
||||
|
||||
- Creates an OpenAI Agent with specific instructions
|
||||
- Configures it to use gpt-4.1-nano (you can use other models)
|
||||
- Registers the memory-related tools with the agent
|
||||
@@ -181,24 +188,25 @@ This function:
|
||||
async def record_from_microphone(duration=5, samplerate=24000):
|
||||
"""Record audio from the microphone for a specified duration."""
|
||||
print(f"Recording for {duration} seconds...")
|
||||
|
||||
|
||||
# Create a buffer to store the recorded audio
|
||||
frames = []
|
||||
|
||||
|
||||
# Callback function to store audio data
|
||||
def callback(indata, frames_count, time_info, status):
|
||||
frames.append(indata.copy())
|
||||
|
||||
|
||||
# Start recording
|
||||
with sd.InputStream(samplerate=samplerate, channels=1, callback=callback, dtype=np.int16):
|
||||
await asyncio.sleep(duration)
|
||||
|
||||
|
||||
# Combine all frames into a single numpy array
|
||||
audio_data = np.concatenate(frames)
|
||||
return audio_data
|
||||
```
|
||||
|
||||
This function:
|
||||
|
||||
- Creates a simple asynchronous microphone recording function
|
||||
- Uses the sounddevice library to capture audio input
|
||||
- Stores frames in a buffer during recording
|
||||
@@ -211,16 +219,16 @@ This function:
|
||||
async def main():
|
||||
# Create the agent
|
||||
agent = create_memory_voice_agent()
|
||||
|
||||
|
||||
# Set up the voice pipeline
|
||||
pipeline = VoicePipeline(
|
||||
workflow=SingleAgentVoiceWorkflow(agent)
|
||||
)
|
||||
|
||||
|
||||
# Configure TTS settings
|
||||
pipeline.config.tts_settings.voice = "alloy"
|
||||
pipeline.config.tts_settings.speed = 1.0
|
||||
|
||||
|
||||
try:
|
||||
while True:
|
||||
# Get user input
|
||||
@@ -228,19 +236,19 @@ async def main():
|
||||
user_input = input()
|
||||
if user_input.lower() == 'q':
|
||||
break
|
||||
|
||||
|
||||
# Record and process audio
|
||||
audio_data = await record_from_microphone(duration=5)
|
||||
audio_input = AudioInput(buffer=audio_data)
|
||||
result = await pipeline.run(audio_input)
|
||||
|
||||
|
||||
# Play response and handle events
|
||||
player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16)
|
||||
player.start()
|
||||
|
||||
|
||||
agent_response = ""
|
||||
print("\nAgent response:")
|
||||
|
||||
|
||||
async for event in result.stream():
|
||||
if event.type == "voice_stream_event_audio":
|
||||
player.write(event.data)
|
||||
@@ -248,23 +256,24 @@ async def main():
|
||||
content = event.data
|
||||
agent_response += content
|
||||
print(content, end="", flush=True)
|
||||
|
||||
|
||||
# Save the agent's response to memory
|
||||
if agent_response:
|
||||
try:
|
||||
await mem0_client.add(
|
||||
f"Agent response: {agent_response}",
|
||||
f"Agent response: {agent_response}",
|
||||
user_id=USER_ID,
|
||||
metadata={"type": "agent_response"}
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Failed to store memory: {e}")
|
||||
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\nExiting...")
|
||||
```
|
||||
|
||||
This main function orchestrates the entire process:
|
||||
|
||||
1. Creates the memory-enabled voice agent
|
||||
2. Sets up the voice pipeline with TTS settings
|
||||
3. Implements an interactive loop for recording and processing voice input
|
||||
@@ -348,11 +357,11 @@ async def search_memories(
|
||||
threshold=0.7, # Higher threshold for more relevant results
|
||||
output_format="v1.1"
|
||||
)
|
||||
|
||||
|
||||
# Format and return the results
|
||||
if not results.get('results', []):
|
||||
return "I don't have any relevant memories about this topic."
|
||||
|
||||
|
||||
memories = [f"• {result['memory']}" for result in results.get('results', [])]
|
||||
return "Here's what I remember that might be relevant:\n" + "\n".join(memories)
|
||||
|
||||
@@ -372,43 +381,43 @@ def create_memory_voice_agent():
|
||||
model="gpt-4.1-nano-2025-04-14",
|
||||
tools=[save_memories, search_memories],
|
||||
)
|
||||
|
||||
|
||||
return agent
|
||||
|
||||
async def record_from_microphone(duration=5, samplerate=24000):
|
||||
"""Record audio from the microphone for a specified duration."""
|
||||
print(f"Recording for {duration} seconds...")
|
||||
|
||||
|
||||
# Create a buffer to store the recorded audio
|
||||
frames = []
|
||||
|
||||
|
||||
# Callback function to store audio data
|
||||
def callback(indata, frames_count, time_info, status):
|
||||
frames.append(indata.copy())
|
||||
|
||||
|
||||
# Start recording
|
||||
with sd.InputStream(samplerate=samplerate, channels=1, callback=callback, dtype=np.int16):
|
||||
await asyncio.sleep(duration)
|
||||
|
||||
|
||||
# Combine all frames into a single numpy array
|
||||
audio_data = np.concatenate(frames)
|
||||
return audio_data
|
||||
|
||||
async def main():
|
||||
print("Starting Memory Voice Agent")
|
||||
|
||||
|
||||
# Create the agent and context
|
||||
agent = create_memory_voice_agent()
|
||||
|
||||
|
||||
# Set up the voice pipeline
|
||||
pipeline = VoicePipeline(
|
||||
workflow=SingleAgentVoiceWorkflow(agent)
|
||||
)
|
||||
|
||||
|
||||
# Configure TTS settings
|
||||
pipeline.config.tts_settings.voice = "alloy"
|
||||
pipeline.config.tts_settings.speed = 1.0
|
||||
|
||||
|
||||
try:
|
||||
while True:
|
||||
# Get user input
|
||||
@@ -416,23 +425,23 @@ async def main():
|
||||
user_input = input()
|
||||
if user_input.lower() == 'q':
|
||||
break
|
||||
|
||||
|
||||
# Record and process audio
|
||||
audio_data = await record_from_microphone(duration=5)
|
||||
audio_input = AudioInput(buffer=audio_data)
|
||||
|
||||
|
||||
print("Processing your request...")
|
||||
|
||||
|
||||
# Process the audio input
|
||||
result = await pipeline.run(audio_input)
|
||||
|
||||
|
||||
# Create an audio player
|
||||
player = sd.OutputStream(samplerate=24000, channels=1, dtype=np.int16)
|
||||
player.start()
|
||||
|
||||
|
||||
# Store the agent's response for adding to memory
|
||||
agent_response = ""
|
||||
|
||||
|
||||
print("\nAgent response:")
|
||||
# Play the audio stream as it comes in
|
||||
async for event in result.stream():
|
||||
@@ -443,20 +452,20 @@ async def main():
|
||||
content = event.data
|
||||
agent_response += content
|
||||
print(content, end="", flush=True)
|
||||
|
||||
|
||||
print("\n")
|
||||
|
||||
|
||||
# Example of saving the conversation to Mem0 after completion
|
||||
if agent_response:
|
||||
try:
|
||||
await mem0_client.add(
|
||||
f"Agent response: {agent_response}",
|
||||
f"Agent response: {agent_response}",
|
||||
user_id=USER_ID,
|
||||
metadata={"type": "agent_response"}
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"Failed to store memory: {e}")
|
||||
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\nExiting...")
|
||||
|
||||
@@ -486,7 +495,7 @@ To run this example:
|
||||
|
||||
1. Replace the placeholder API keys with your actual keys
|
||||
2. Make sure your microphone is properly connected
|
||||
3. Run the script with Python 3.8 or newer
|
||||
3. Run the script with Python 3.10 or newer
|
||||
4. Press Enter to start recording, then speak your request
|
||||
5. Press 'q' to quit the application
|
||||
|
||||
@@ -533,6 +542,6 @@ async def save_memories(
|
||||
"""Store a user memory in memory."""
|
||||
# This will be visible in your console
|
||||
logger.debug(f"Saving memory: {memory} for user {USER_ID}")
|
||||
|
||||
|
||||
# Rest of your function...
|
||||
```
|
||||
```
|
||||
|
||||
@@ -18,7 +18,7 @@ In this guide, you'll:
|
||||
- AWS account with access to:
|
||||
- Bedrock foundation models (e.g., Titan, Claude)
|
||||
- OpenSearch Service with a configured domain
|
||||
- Python 3.8+
|
||||
- Python 3.10+
|
||||
- Valid AWS credentials (via environment or IAM role)
|
||||
|
||||
## Setup and Installation
|
||||
@@ -127,4 +127,3 @@ all_memories = m.get_all(user_id="alice")
|
||||
- [Mem0 Platform](https://app.mem0.ai)
|
||||
|
||||
<Snippet file="get-help.mdx" />
|
||||
|
||||
|
||||
Reference in New Issue
Block a user