Skip to main content

Official Python SDK for VectorDBCloud

Project description

VectorDBCloud Python SDK

The official Python SDK for VectorDBCloud, providing easy access to the VectorDBCloud platform for vector database management, embeddings, and context management with ECP (Ephemeral Context Protocol).

Installation

pip install vectordbcloud

Quick Start

from vectordbcloud import VectorDBCloud

# Initialize the client with your API key
client = VectorDBCloud(api_key="your_api_key")

# Create a context
context = client.create_context(
    metadata={"user_id": "user123", "session_id": "session456"}
)

# Store vectors with context
vectors = [
    [0.1, 0.2, 0.3],
    [0.4, 0.5, 0.6],
]
metadata = [
    {"text": "Document 1", "source": "source1"},
    {"text": "Document 2", "source": "source2"},
]
client.store_vectors(vectors=vectors, metadata=metadata, context_id=context.id)

# Query vectors
results = client.query_vectors(
    query_vector=[0.2, 0.3, 0.4],
    context_id=context.id,
    top_k=5
)

# Print results
for result in results:
    print(f"Score: {result.score}, Metadata: {result.metadata}")

# Use ECP for context management
with client.context(metadata={"task": "recommendation"}) as ctx:
    # All operations within this block will use this context
    client.store_vectors(vectors=vectors, metadata=metadata)
    results = client.query_vectors(query_vector=[0.2, 0.3, 0.4], top_k=5)

Features

  • Simple, intuitive API for vector database operations
  • Built-in support for ECP (Ephemeral Context Protocol)
  • Automatic handling of authentication and API key management
  • Comprehensive error handling and retries
  • Support for all VectorDBCloud features:
    • Vector storage and retrieval
    • Context management
    • Subscription and plan management
    • Cloud deployment

Documentation

For complete documentation, visit https://docs.vectordbcloud.com/python-sdk.

Examples

Managing Subscriptions

# Get current subscription
subscription = client.get_subscription()
print(f"Current plan: {subscription.plan_id}")
print(f"Status: {subscription.status}")

# Check usage limits
limits = client.check_limits()
if limits.approaching_limit:
    print(f"Warning: Approaching limit for {limits.approaching_limit_type}")

Cloud Deployment

# Deploy to AWS
result = client.deploy_to_aws(
    account_id="123456789012",
    region="us-east-1",
    resources=[
        {
            "type": "s3_bucket",
            "name": "my-vector-storage"
        },
        {
            "type": "dynamodb_table",
            "name": "my-metadata-table"
        }
    ]
)
print(f"Deployment ID: {result.deployment_id}")

License

This SDK is distributed under the MIT license. See the LICENSE file for more information.

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

vectordbcloud-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

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

vectordbcloud-0.1.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vectordbcloud-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for vectordbcloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4702a8169bbfb42fdccc2319e74fd2a873dfd00224efb0b1f91464c2102ae9bb
MD5 02ab5766e487c82a0ef455ffde72cc02
BLAKE2b-256 ec3b143d057f3c2f9a7965f99eeccb937944c1b7783af4cb5a8e80d64198a9d9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vectordbcloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for vectordbcloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f79ed0877b2e7b5b0ac5635926576eaa0b75e72f0d6e6768674a2321375c982
MD5 379fde1480f66b64d8f1c19bd50b4f1b
BLAKE2b-256 ebaba7ac104a4c04d2af56d3af92560d51478ea4ba7a6efa1517c2fdacde7c67

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