API Reference
Client Initialization
Section titled “Client Initialization”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")EmbexClient.newAsync(provider: string, url: string, apiKey?: string) -> Promise<EmbexClient>
Creates a new asynchronous client.
Arguments:
provider(string): The database provider.url(string): The connection URL or path.apiKey(string, optional): API key for cloud providers.
Example:
const client = await EmbexClient.newAsync("lancedb", "./data");Collections
Section titled “Collections”Create Collection
Section titled “Create Collection”create_collection(name: str, dimension: int) Creates a new vector
collection.
createCollection(name: string, dimension: number) Creates a new vector
collection.
Delete Collection
Section titled “Delete Collection”delete_collection(name: str) Permanently deletes a collection and all
its data.
deleteCollection(name: string) Permanently deletes a collection.
Data Operations
Section titled “Data Operations”Insert
Section titled “Insert”insert(collection_name: str, vectors: List[Vector]) Inserts a list of
vectors into the collection.
insert(collection_name: string, vectors: Vector[]) Inserts an array of
vectors into the collection.
Search
Section titled “Search”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}})search(options: SearchOptions) -> Promise<SearchResult[]>
Finds the nearest neighbors.
await client.search({ collection_name: "users", vector: [0.1, ...], limit: 5, filter: { key: "age", range: { gt: 25 } }});