Skip to content

Python API Reference

The entry point for interacting with vector databases.

from embex import EmbexClient
client = await EmbexClient.new_async("qdrant", "http://localhost:6333")

new_async(provider: str, url: str) -> EmbexClient

Section titled “new_async(provider: str, url: str) -> EmbexClient”

Creates a new async client.

  • provider: qdrant, chroma, weaviate, lancedb, pgvector, milvus
  • url: Connection string or URL.

Get a reference to a collection.

Represents a vector collection (or table/class).

async create(dim: int, distance: str = "cosine")

Section titled “async create(dim: int, distance: str = "cosine")”

Create the collection if it doesn’t exist.

Insert vectors.

from embex import Point
await col.insert([Point(id="1", vector=[0.1, ...], metadata={"foo": "bar"})])

search(vector: List[float], top_k: int = 10) -> List[SearchResult]

Section titled “search(vector: List[float], top_k: int = 10) -> List[SearchResult]”

Search for similar vectors.

Delete the collection.

async scroll(offset: Optional[str] = None, limit: int = 100) -> ScrollResponse

Section titled “async scroll(offset: Optional[str] = None, limit: int = 100) -> ScrollResponse”

Paginated export of points.

Utility for migrating data between providers.

from embex import DataMigrator
migrator = DataMigrator(source_client, dest_client)
# Migrate with auto-inferred schema
await migrator.migrate_simple("source_col", "dest_col")