Each fix verified against mem0/vector_stores/ source and configs:
- baidu: table_name default mem0_table → mem0 (BaiduDBConfig)
- langchain: TS import mem0ai → mem0ai/oss; fix undefined LangchainVectorStore
variable to use MemoryVectorStore directly
- mongodb: collection_name default mem0_collection → mem0; mongo_uri default
corrected to mongodb://localhost:27017 (MongoDBConfig)
- neon: hnsw default False → True (PGVectorConfig.hnsw = True)
- neptune_analytics: extra name vector_stores → vector-stores (pyproject.toml)
- pgvector: diskann default True → False; hnsw default False → True
(PGVectorConfig)
- upstash-vector: move enable_embeddings inside config: {} block
(UpstashVectorConfig field, not top-level VectorStoreConfig)
- valkey: remove non-existent distance_metric row (not in ValkeyConfig);
fix extra name vector_stores → vector-stores
- vertex_ai: region is required (no default in GoogleMatchingEngineConfig)
- weaviate: install pip install weaviate weaviate-client → weaviate-client
(weaviate is not a separate package)
- overview: update TS supported vector DBs list to reflect actual
mem0-ts/src/oss/src/vector_stores/ files
50 lines
2.0 KiB
Plaintext
50 lines
2.0 KiB
Plaintext
---
|
|
title: Vertex AI Vector Search
|
|
description: "Use Google Cloud Vertex AI Vector Search as a managed vector store in Mem0 with endpoint and index configuration."
|
|
---
|
|
|
|
|
|
### Usage
|
|
|
|
To use Google Cloud Vertex AI Vector Search with `mem0`, you need to configure the `vector_store` in your `mem0` config:
|
|
|
|
|
|
```python
|
|
import os
|
|
from mem0 import Memory
|
|
|
|
os.environ["GOOGLE_API_KEY"] = "sk-xx"
|
|
|
|
config = {
|
|
"vector_store": {
|
|
"provider": "vertex_ai_vector_search",
|
|
"config": {
|
|
"endpoint_id": "YOUR_ENDPOINT_ID", # Required: Vector Search endpoint ID
|
|
"index_id": "YOUR_INDEX_ID", # Required: Vector Search index ID
|
|
"deployment_index_id": "YOUR_DEPLOYMENT_INDEX_ID", # Required: Deployment-specific ID
|
|
"project_id": "YOUR_PROJECT_ID", # Required: Google Cloud project ID
|
|
"project_number": "YOUR_PROJECT_NUMBER", # Required: Google Cloud project number
|
|
"region": "YOUR_REGION", # Required: Google Cloud region
|
|
"credentials_path": "path/to/credentials.json", # Optional: Defaults to GOOGLE_APPLICATION_CREDENTIALS
|
|
"vector_search_api_endpoint": "YOUR_API_ENDPOINT" # Required for get operations
|
|
}
|
|
}
|
|
}
|
|
m = Memory.from_config(config)
|
|
m.add("Your text here", user_id="user", metadata={"category": "example"})
|
|
```
|
|
|
|
|
|
### Required Parameters
|
|
|
|
| Parameter | Description | Required |
|
|
|-----------|-------------|----------|
|
|
| `endpoint_id` | Vector Search endpoint ID | Yes |
|
|
| `index_id` | Vector Search index ID | Yes |
|
|
| `deployment_index_id` | Deployment-specific index ID | Yes |
|
|
| `project_id` | Google Cloud project ID | Yes |
|
|
| `project_number` | Google Cloud project number | Yes |
|
|
| `vector_search_api_endpoint` | Vector search API endpoint | Yes (for get operations) |
|
|
| `region` | Google Cloud region | Yes |
|
|
| `credentials_path` | Path to service account credentials | No (defaults to GOOGLE_APPLICATION_CREDENTIALS) |
|