Registry / vector-search / tcvectordb

tcvectordb

JSON →
library2.1.1pypypi✓ verified 83d ago

Tencent Cloud VectorDB Python SDK for managing vector databases, including collection creation, data insertion, and similarity search. Current version 2.1.1, requires Python >=3. Monthly releases.

pip install tcvectordb
INSTALL
IMPORT
SIG · TCVECTORDB
T
tcvectordb
vector-searchpythonv2.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

VectorDBClient
from tcvectordb import VectorDBClient
enums
from tcvectordb.model.enum import FieldType, IndexType, MetricType
from tcvectordb.enums import ...
enums moved to model.enum in v2.x

Creates a database and collection with HNSW index.

import os from tcvectordb import VectorDBClient from tcvectordb.model.enum import FieldType, IndexType, MetricType from tcvectordb.model.index import Index, IndexField client = VectorDBClient( url=os.environ.get('VECTORDB_URL', ''), username=os.environ.get('VECTORDB_USERNAME', 'root'), key=os.environ.get('VECTORDB_KEY', ''), ) db = client.create_database('test_db') index = Index( IndexField(name='id', field_type=FieldType.String, primary_key=True), IndexField(name='vector', field_type=FieldType.Vector, dimension=3, index_type=IndexType.HNSW, metric_type=MetricType.COSINE) ) collection = db.create_collection('test_col', shard=1, replicas=0, index=index) print('Collection created successfully')
Debug
Known issues
breakingIn v2.0, the SDK was rewritten; old v1.x code using `import tcvectordb` directly will not work. Enums moved from root to `tcvectordb.model.enum`.
fix
Update imports to use `tcvectordb.model.enum` and follow v2.x API patterns.
affects: 1.x -> 2.x
deprecated`database.create_collection` with `index` parameter as a list of IndexField objects is deprecated; use `tcvectordb.model.index.Index` object.
fix
Use `Index` class with `IndexField` entries.
affects: < 2.1.0
gotchaThe SDK uses `key` parameter for authentication, not `password`. Using `password` will result in silent auth failure.
fix
Use `key=os.environ.get('VECTORDB_KEY')` when creating VectorDBClient.
affects: all
gotchaThe `url` must include the protocol (https://) and port if non-default. Missing protocol causes connection errors.
fix
Set `url='https://your-endpoint:port'`.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tcvectordb'
SDK not installed or installation failed.
fix
Run `pip install tcvectordb`.
ImportError: cannot import name 'IndexType' from 'tcvectordb'
Enums were relocated in v2.0.
fix
Import from `tcvectordb.model.enum` instead: `from tcvectordb.model.enum import IndexType`.
tcvectordb.exception.VectorDBException: Authentication failed
Incorrect username or key, or using password parameter.
fix
Ensure `username` and `key` are correct. Do not use `password`; use `key`.
Upgrade
Version history
2.1.1latest on PyPI · released Mar 30, 2026
Audit
Dependencies
requestsrequiredHTTP client for API calls
Agent activity
68 hits · last 30 days
node
56
OpenAI (training)
1
Resources
tcvectordb — pip install tcvectordb · libregistry