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")