Skip to main content

Fastest Hyperbolic Vector DB Client

Project description

HyperspaceDB Python SDK

Official Python client for HyperspaceDB gRPC API.

The SDK is designed for production services and benchmark tooling:

  • collection management
  • single and batch insert
  • single and batch vector search
  • optional embedder integrations
  • multi-tenant metadata headers

Requirements

  • Python 3.8+
  • Running HyperspaceDB server (default gRPC endpoint: localhost:50051)

Installation

pip install hyperspacedb

Optional embedder extras:

pip install "hyperspacedb[openai]"
pip install "hyperspacedb[all]"

Quick Start

from hyperspace import HyperspaceClient

client = HyperspaceClient("localhost:50051", api_key="I_LOVE_HYPERSPACEDB")
collection = "docs_py"

client.delete_collection(collection)
client.create_collection(collection, dimension=3, metric="cosine")

client.insert(
    id=1,
    vector=[0.1, 0.2, 0.3],
    metadata={"source": "demo"},
    collection=collection,
)

results = client.search(
    vector=[0.1, 0.2, 0.3],
    top_k=5,
    collection=collection,
)
print(results)

client.close()

Batch Search (Recommended for Throughput)

queries = [
    [0.1, 0.2, 0.3],
    [0.3, 0.1, 0.4],
]

batch_results = client.search_batch(
    vectors=queries,
    top_k=10,
    collection="docs_py",
)

search_batch reduces per-request RPC overhead and should be preferred for high concurrency.

API Summary

Collection Operations

  • create_collection(name, dimension, metric) -> bool
  • delete_collection(name) -> bool
  • list_collections() -> list[str]
  • get_collection_stats(name) -> dict

Data Operations

  • insert(id, vector=None, document=None, metadata=None, collection="", durability=Durability.DEFAULT) -> bool
  • batch_insert(vectors, ids, metadatas=None, collection="", durability=Durability.DEFAULT) -> bool
  • search(vector=None, query_text=None, top_k=10, filter=None, filters=None, hybrid_query=None, hybrid_alpha=None, collection="") -> list[dict]
  • search_batch(vectors, top_k=10, collection="") -> list[list[dict]]

Maintenance Operations

  • rebuild_index(collection) -> bool
  • trigger_vacuum() -> bool
  • trigger_snapshot() -> bool
  • configure(ef_search=None, ef_construction=None, collection="") -> bool

Durability Levels

Use Durability enum values:

  • Durability.DEFAULT
  • Durability.ASYNC
  • Durability.BATCH
  • Durability.STRICT

Multi-Tenancy

Pass user_id to include x-hyperspace-user-id on all requests:

client = HyperspaceClient(
    "localhost:50051",
    api_key="I_LOVE_HYPERSPACEDB",
    user_id="tenant_a",
)

Best Practices

  • Reuse one client instance per worker/process.
  • Prefer search_batch for benchmark and high-QPS paths.
  • Chunk large inserts instead of one huge request.
  • Keep vector dimensionality aligned with collection configuration.

Error Handling

The SDK catches gRPC errors and returns False / [] in many methods. For strict production observability, log return values and attach metrics around failed operations.

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

hyperspacedb-2.2.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

hyperspacedb-2.2.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file hyperspacedb-2.2.0.tar.gz.

File metadata

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

File hashes

Hashes for hyperspacedb-2.2.0.tar.gz
Algorithm Hash digest
SHA256 bcad604e4c163ee229615fa8bd49792cab3661ac37206d2b98029d2d1f079940
MD5 fbf53d0cd4cad1c09f29ae2a0fefa1ad
BLAKE2b-256 e686f31b940e64ec2c01518f22161ab61e012e06c143d93864c7c942992340e3

See more details on using hashes here.

File details

Details for the file hyperspacedb-2.2.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for hyperspacedb-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4db5dd1edc7d899d5ec47ca46a864b6d5b16065f81b804fff4893f18faf4a799
MD5 ef14765aeb5efc6775d68b48438568f1
BLAKE2b-256 dcafaf8c180219c2c59beeb844d572204d33bbd86247b394c0d75494f0008673

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