{"id":27440,"library":"tcvectordb","title":"Tencent Cloud VectorDB Python SDK","description":"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.","status":"active","version":"2.1.1","language":"python","source_language":"en","source_url":"https://github.com/Tencent/tcvectordb","tags":["tencent","vectordb","sdk","vector-database"],"install":[{"cmd":"pip install tcvectordb","lang":"bash","label":"Install SDK"}],"dependencies":[{"reason":"HTTP client for API calls","package":"requests","optional":false}],"imports":[{"note":"","symbol":"VectorDBClient","correct":"from tcvectordb import VectorDBClient"},{"note":"enums moved to model.enum in v2.x","wrong":"from tcvectordb.enums import ...","symbol":"enums","correct":"from tcvectordb.model.enum import FieldType, IndexType, MetricType"}],"quickstart":{"code":"import os\nfrom tcvectordb import VectorDBClient\nfrom tcvectordb.model.enum import FieldType, IndexType, MetricType\nfrom tcvectordb.model.index import Index, IndexField\n\nclient = VectorDBClient(\n    url=os.environ.get('VECTORDB_URL', ''),\n    username=os.environ.get('VECTORDB_USERNAME', 'root'),\n    key=os.environ.get('VECTORDB_KEY', ''),\n)\ndb = client.create_database('test_db')\nindex = Index(\n    IndexField(name='id', field_type=FieldType.String, primary_key=True),\n    IndexField(name='vector', field_type=FieldType.Vector, dimension=3, index_type=IndexType.HNSW, metric_type=MetricType.COSINE)\n)\ncollection = db.create_collection('test_col', shard=1, replicas=0, index=index)\nprint('Collection created successfully')","lang":"python","description":"Creates a database and collection with HNSW index."},"warnings":[{"fix":"Update imports to use `tcvectordb.model.enum` and follow v2.x API patterns.","message":"In 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`.","severity":"breaking","affected_versions":"1.x -> 2.x"},{"fix":"Use `Index` class with `IndexField` entries.","message":"`database.create_collection` with `index` parameter as a list of IndexField objects is deprecated; use `tcvectordb.model.index.Index` object.","severity":"deprecated","affected_versions":"< 2.1.0"},{"fix":"Use `key=os.environ.get('VECTORDB_KEY')` when creating VectorDBClient.","message":"The SDK uses `key` parameter for authentication, not `password`. Using `password` will result in silent auth failure.","severity":"gotcha","affected_versions":"all"},{"fix":"Set `url='https://your-endpoint:port'`.","message":"The `url` must include the protocol (https://) and port if non-default. Missing protocol causes connection errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'2.1.1':25 '3':28 'cloud':2,7 'collect':16 'creation':17 'current':23 'data':18 'databas':14,36 'includ':15 'insert':19 'manag':12 'month':29 'python':4,9,27 'releas':30 'requir':26 'sdk':5,10,33 'search':22 'similar':21 'tencent':1,6,31 'vector':13,35 'vector-databas':34 'vectordb':3,8,32 'version':24","created_at":"2026-05-01T17:46:16.582530+00:00","updated_at":"2026-05-01T17:46:16.582530+00:00","problems":[{"fix":"Run `pip install tcvectordb`.","cause":"SDK not installed or installation failed.","error":"ModuleNotFoundError: No module named 'tcvectordb'"},{"fix":"Import from `tcvectordb.model.enum` instead: `from tcvectordb.model.enum import IndexType`.","cause":"Enums were relocated in v2.0.","error":"ImportError: cannot import name 'IndexType' from 'tcvectordb'"},{"fix":"Ensure `username` and `key` are correct. Do not use `password`; use `key`.","cause":"Incorrect username or key, or using password parameter.","error":"tcvectordb.exception.VectorDBException: Authentication failed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://www.tencentcloud.com/products/vector-database","github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/tcvectordb/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["vector-search","database","aws","gcp","azure"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}