Skip to main content

Python SDK for the VectorDB REST API

Project description

vectordb-client

Python SDK for the VectorDB REST API — sync and async clients, CLI tool included.

Installation

pip install vdb-python

Quick Start

from vectordb_client import VectorDBClient

client = VectorDBClient(base_url="http://localhost:8000", api_key="your-key")

# Create a collection
client.collections.create("articles", dim=384, distance_metric="cosine")

# Upsert a vector
client.vectors.upsert("articles", external_id="doc-1", vector=[0.1, 0.2, ...], metadata={"title": "Hello"})

# Search
results = client.search.search("articles", vector=[0.1, 0.2, ...], k=5)
for r in results:
    print(r.external_id, r.score)

Async Client

from vectordb_client import AsyncVectorDBClient

async with AsyncVectorDBClient(base_url="http://localhost:8000", api_key="your-key") as client:
    await client.collections.create("articles", dim=384)
    results = await client.search.search("articles", vector=query, k=5)

CLI

export VECTORDB_API_KEY=your-key
vdb collections list
vdb search articles '[0.1, 0.2, 0.3]' --k 5
vdb -o json collections get articles

Documentation

Full docs at lachu97.github.io/vector-db

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

vdb_python-0.1.0.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

vdb_python-0.1.0-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file vdb_python-0.1.0.tar.gz.

File metadata

  • Download URL: vdb_python-0.1.0.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vdb_python-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4bfaa58c1ccebaade1af743c74d07889847d15a1f8ad13f6519f553e0a47575d
MD5 a5794a9344446120e8feb5396b733b3d
BLAKE2b-256 958dd1f35b73b214eb2b1c066390db90c5914a98a3063f832544c57a2a589857

See more details on using hashes here.

File details

Details for the file vdb_python-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vdb_python-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for vdb_python-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28a1c5e3ac06ea43e9f83bba529f484cb99bfcdb5d8ee7f3e4bc4ff76ca4ea86
MD5 66b3c9b01d6fddd1de4077a6ef8c1785
BLAKE2b-256 eb1d02c83bec53432d190b4c8f41fa2b0cc3e716c6d594fa3db47d48c0172468

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