Installation
OpenSearch support requires additional dependencies. Install them with:Prerequisites
Before using OpenSearch with Mem0, you need to set up a collection in AWS OpenSearch Service.AWS OpenSearch Service
You can create a collection through the AWS Console:- Navigate to OpenSearch Service Console
- Click “Create collection”
- Select “Serverless collection” and then enable “Vector search” capabilities
- Once created, note the endpoint URL (host) for your configuration
Usage
Configuration Options
| Parameter | Type | Default | Description |
|---|---|---|---|
collection_name | string | required | Name of the OpenSearch index |
host | string | required | OpenSearch endpoint URL |
port | int | 9200 | Port number |
http_auth | object | None | Authentication credentials (e.g., AWSV4SignerAuth) |
embedding_model_dims | int | 1536 | Dimension of embedding vectors |
use_ssl | bool | False | Enable SSL/TLS connection |
verify_certs | bool | False | Verify SSL certificates |
auto_refresh | bool | False | Automatically refresh index after insert. OpenSearch refreshes every ~1 second by default, so this is rarely needed. |
The defaults above match a local OpenSearch instance. The AWS OpenSearch Serverless
example earlier on this page intentionally overrides them with
port=443, use_ssl=True,
and verify_certs=True, which are required when connecting to a Serverless collection.For AWS OpenSearch Serverless, keep
auto_refresh=False (the default).
The indices.refresh() API is not supported on Serverless collections.Add Memories
Search Memories
Features
- Fast and Efficient Vector Search
- Can be deployed on-premises, in containers, or on cloud platforms like AWS OpenSearch Service
- Multiple authentication and security methods (Basic Authentication, API Keys, LDAP, SAML, and OpenID Connect)
- Automatic index creation with optimized mappings for vector search
- Memory optimization through disk-based vector search and quantization
- Real-time analytics and observability