ReadonlycountReadonlydimEmbedding dimension.
ReadonlymodelModel identifier passed to the embedder.
ReadonlynamespaceCorpus namespace this instance was opened with.
ReadonlystoreActive backing-store mode ("memory" | "opfs" | "indexeddb").
Release all resources held by this instance. Resolves on success; rejects with TRAGarError("InstanceClosed") if already closed.
Export the corpus as a Blob.
{ meta, chunks, vectors_b64 } — vectors packed as a contiguous float32 matrix, base64-encoded{ id, text, source, vector: number[] } (float32 values as JSON)Return all stored vectors as a snapshot array. Fires a DequantizationRequested warning once per instance lifetime via onWarn.
Return the stored float32 vector for the given chunk id. Rejects with TRAGarError("NotFound") if the id is unknown. Fires a DequantizationRequested warning once per instance lifetime via onWarn.
Ingest one document: chunk → embed → store. Resolves when all chunks are stored; rejects with TRAGarError("InstanceClosed") if closed.
Query the corpus for the top-k most relevant chunks. Returns an empty array when no chunks have been ingested. Rejects with TRAGarError("InstanceClosed") if closed.
Optionalopts: QueryOptionsStream the top-k hits as an async iterator, yielding in descending score order. Safe to abandon with break or an exception — resources are released when the iterator protocol's return() method is called. Throws TRAGarError("InstanceClosed") on first iteration if closed.
Optionalopts: QueryOptionsReturn a summary of the current corpus state. Rejects with TRAGarError("InstanceClosed") if closed.
Number of chunks currently stored. Updated after each ingest() call.