Skip to content

API Reference

EmbexClient.new_async(provider: str, url: str, api_key: Optional[str] = None) -> EmbexClient

Creates a new asynchronous client.

Arguments:

  • provider (str): The database provider (e.g., "lancedb", "qdrant", "pinecone").
  • url (str): The connection URL or path (e.g., "./data" for LanceDB, "http://localhost:6333" for Qdrant).
  • api_key (str, optional): API key for cloud providers.

Example:

client = await EmbexClient.new_async(provider="lancedb", url="./data")

create_collection(name: str, dimension: int) Creates a new vector collection.

delete_collection(name: str) Permanently deletes a collection and all its data.

insert(collection_name: str, vectors: List[Vector]) Inserts a list of vectors into the collection.

search(collection_name: str, vector: List[float], limit: int = 10, filter: Optional[Dict] = None) -> List[SearchResult]

Finds the nearest neighbors for the given vector, optionally filtered by metadata.

await client.search("users", [0.1, ...], limit=5, filter={"key": "age", "range": {"gt": 25}})