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.5.0.tar.gz (13.8 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.5.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vdb_python-0.5.0.tar.gz
  • Upload date:
  • Size: 13.8 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.5.0.tar.gz
Algorithm Hash digest
SHA256 b286b1b043bd16be7fa632235efcb8276f355aca3e16317f59b07aaceb691b9a
MD5 68e3406488674cbc43327aa0dc837be7
BLAKE2b-256 b345d21cd8936052826c8a9ca29af8bd22d64c5a68492e9ce6c1d66a78da807b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vdb_python-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 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.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 069c9fe05db81e3f96473201f640b37cf1919470dd966baffa23cbe5ee977507
MD5 6c1cd484c73a13de5aaa4f78f5741545
BLAKE2b-256 9b0c9d1c580f8e0d920bf65621240f16d328bf70aff08db9bdf407e35cfc405b

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