Skip to content

Async

The library's calls for asyncio. See Async.

vectrixdb.aio

An async face for Vectrix.

Embedding and search are CPU-bound calls into ONNX Runtime and usearch, so there is nothing to await inside them; what an async application needs is for those calls not to block the event loop. Each method here runs its synchronous twin in the default thread executor and awaits it. The underlying Vectrix is safe to share across threads (see docs/explanation/concurrency.md), so nothing is copied.

async with AsyncVectrix("notes", path="./data") as db:
    await db.add(["first note"])
    hits = await db.search("note")

AsyncVectrix

Vectrix with every blocking call moved off the event loop.

sync property

The underlying synchronous object, for anything not wrapped here.

wrap(db) classmethod

Wrap an already-open Vectrix.

open() async

Open the collection. Loading models can take seconds, so it is awaited too.