Skip to main content

Interface: IVectorIndexAdapter

Defined in: internal/vector-store/types.ts:150

The index backend seam: what a host implements over its vector database; the VectorStore checks, the adapter stores.

Methods​

deleteByDoc()​

deleteByDoc(args): Promise<number>

Defined in: internal/vector-store/types.ts:181

deleteByDoc -- removes every chunk of a document

About​

By docId within the tenant; returns the count.

A re-ingest deletes first, so a shorter document leaves no stale chunks behind.

Who needs it​

VectorStore.deleteByDoc.

Parameters​

args​
docId​

string

tenantId​

string

Returns​

Promise<number>


describe()​

describe(): Promise<IVectorIndexInfo>

Defined in: internal/vector-store/types.ts:236

describe -- model and dimensions of the index

About​

What the index was created with.

Compared with the Embedder's model before every ingest, so a vector of another model is never written.

Who needs it​

VectorStore.describeIndex.

Returns​

Promise<IVectorIndexInfo>


moveBook()​

moveBook(args): Promise<number>

Defined in: internal/vector-store/types.ts:218

moveBook -- sets another library on every chunk of a book

About​

Metadata only, the vectors stay.

Returns the number of chunks changed.

Who needs it​

VectorStore.moveBook.

Parameters​

args​
bookId​

string

libraryId​

string

tenantId​

string

Returns​

Promise<number>


search(args): Promise<IChunkHit[]>

Defined in: internal/vector-store/types.ts:199

search -- the k nearest chunks of a tenant

About​

Best first, filtered by library, book, tags and language.

Only the tenant's records are searched; the filters are AND-ed as IChunkFilters says; the score is IChunkHit.score: 0..1, best 1.

Who needs it​

VectorStore.search, for the KB retrieval.

Parameters​

args​
filters​

IChunkFilters

k​

number

tenantId​

string

vector​

number[]

Returns​

Promise<IChunkHit[]>


upsert()​

upsert(args): Promise<void>

Defined in: internal/vector-store/types.ts:164

upsert -- inserts or replaces chunk records

About​

By chunk id within the tenant.

The store has checked tenant, model and dimensions already; the adapter writes.

Who needs it​

VectorStore.upsertChunks, for the KB ingestion.

Parameters​

args​
records​

IChunkRecord[]

tenantId​

string

Returns​

Promise<void>