Skip to main content

Python SDK Reference

Complete API documentation for the VortexDB Python client.

Installation


VortexDB

The main client class for interacting with VortexDB.

Constructor

str
default:"localhost:50051"
The gRPC server address. Can also be set via VORTEXDB_GRPC_URL environment variable.
str
default:"None"
Authentication key for the gRPC API. Can also be set via VORTEXDB_API_KEY environment variable.
float
default:"30.0"
Request timeout in seconds. Can also be set via VORTEXDB_TIMEOUT environment variable.
Example:

Methods

insert

Insert a vector with its payload into the database.
str
UUID of the created point.
Example:

batch_insert

Insert multiple vectors in a single request.
list[str]
List of UUIDs for the created points, in input order.
Example:

get

Retrieve a point by its ID.
Point | None
The point if found, None otherwise.
Example:

Search for the k nearest neighbors to a query vector.
SearchQuery
default:"None"
A SearchQuery object bundling vector, similarity, and limit. Use this or pass individual args.
int
default:"None"
Search breadth for HNSW. Uses server default if not set.
List[str]
List of point IDs ordered by similarity (closest first).
Example:

Search against multiple query vectors in a single request.
Accepts List[SearchQuery], List[(DenseVector, Similarity, int)], or bare List[DenseVector] with global similarity and limit.
List[List[str]]
One result list per input query.
Example:

delete

Delete a point by its ID.
Example:

close

Close the gRPC connection.
Example:

Context Manager

The client supports the context manager protocol for automatic cleanup:

DenseVector

An immutable dense vector of floating-point values.

Constructor

List[float] | Tuple[float, ...]
required
The vector components. Must be non-empty and contain numeric values.
Raises:
  • TypeError: If values is not a list or tuple
  • ValueError: If values is empty
  • TypeError: If any value is not numeric
Example:

Methods

to_list

Convert the vector to a Python list.
Example:

Properties

values

Access the vector values (read-only).

Payload

Metadata associated with a vector.

Factory Methods

text

Create a text payload.
Example:

image

Create an image payload.
Example:

Constructor

ContentType
required
The type of content (ContentType.TEXT or ContentType.IMAGE).
str
required
The content string.

Properties


Point

A point returned from the database (vector + payload + ID).

Properties

Methods

pretty

Return a formatted string representation.
Example:

Similarity

Enum for distance/similarity metrics.

Values

Example:

ContentType

Enum for payload content types.

Values


SearchQuery

Bundles a search’s parameters into a single object.

Exceptions

All exceptions inherit from VortexDBError.

Exception Hierarchy

Example:

Configuration

VortexDBConfig

Internal configuration class (usually not used directly).

Environment Variables


Type Hints

The SDK is fully typed. Import types for type hints:

Next Steps

SDK Examples

Working code examples

API Reference

gRPC and HTTP API docs