Skip to main content

TCVectorDB backend for the mem0 memory framework.

Project description

mem0-tcvectordb

mem0-tcvectordb adds Tencent Cloud’s TCVectorDB as a first-class vector store provider for mem0. Install it next to mem0ai to unlock Tencent Cloud hosting without patching the upstream library.

Highlights

  • Registers a tcvectordb provider that works with Memory/AsyncMemory.
  • Re-exports the configuration schema so you get validation and editor hints.
  • Keeps close parity with the implementation that ships in the upstream mem0 repo.

Installation

pip install mem0ai mem0-tcvectordb

mem0ai must already be available in your environment because this package only ships the TCVectorDB-specific modules.

Local Configuration

Copy .env.example to .env and fill in your Tencent Cloud + Neo4j credentials. The integration tests and helper scripts load this file automatically via python-dotenv so secrets never need to be committed to source control.

Usage

import mem0_tcvectordb  # noqa: F401 - registers the provider with mem0
from mem0 import Memory

config = {
    "vector_store": {
        "provider": "tcvectordb",
        "config": {
            "collection_name": "memories",
            "database_name": "mem0",
            "embedding_model_dims": 1536,
            "url": "https://<instance-id>.ap-singapore.tcvdb.tencentcs.com",
            "username": "root",
            "api_key": "tcvdb_api_key",
        }
    }
}

memory = Memory.from_config(config)
memory.add("Alice loves sci-fi movies", user_id="alice")

Configuration Reference

Parameter Description Default
collection_name Collection where memories are stored mem0
database_name Database that owns the collection mem0
embedding_model_dims Embedding dimension produced by mem0 1536
url TCVectorDB HTTP endpoint required
username Account username required
api_key API key required
password Optional password; defaults to api_key None
read_consistency EVENTUAL_CONSISTENCY or STRONG_CONSISTENCY EVENTUAL_CONSISTENCY
shards Number of shards 1
replicas Number of replicas 1
metric_type Distance metric (COSINE, IP, L2, HAMMING) COSINE
index_type Index type (e.g., HNSW, FLAT) HNSW
pool_size HTTP connection pool size 10
proxies Optional proxy configuration None
client Pre-built VectorDBClient instance None

mem0 ships embeddings, so TCVectorDB never runs an embedding model. Ensure embedding_model_dims matches the mem0 embedding size configured for your deployment.

Troubleshooting

  • ValueError: TCVectorDB requires url, username, and api_key: supply credentials in the vector_store.config block or pass an authenticated VectorDBClient.
  • VectorStoreError: ... failed: verify the Tencent Cloud endpoint is reachable from your runtime and that read_consistency, metric_type, and filters use values supported by TCVectorDB.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mem0_tcvectordb-0.1.0b0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mem0_tcvectordb-0.1.0b0-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file mem0_tcvectordb-0.1.0b0.tar.gz.

File metadata

  • Download URL: mem0_tcvectordb-0.1.0b0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.5

File hashes

Hashes for mem0_tcvectordb-0.1.0b0.tar.gz
Algorithm Hash digest
SHA256 0ac328c6977fb1ae13911a62f1d3ec90283cd25a5009d7e15f8fb586fc1514aa
MD5 9526e1713501a145b3b41d0c6b335b5b
BLAKE2b-256 77b3950477000f9cddeb19c0a340dbcf2e25f5ca31863f9a1a873fe4737b6db6

See more details on using hashes here.

File details

Details for the file mem0_tcvectordb-0.1.0b0-py3-none-any.whl.

File metadata

File hashes

Hashes for mem0_tcvectordb-0.1.0b0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d6dca1cd0ee6403376611c2a828472befd47f785aa8147781921154373719b1
MD5 32983d45c764dbfac8dae4a1e5ade782
BLAKE2b-256 a39e1ee0deff750fe93c02ccc754731bd4dcc397a6d6a386cab3de3addf82816

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page