/** * Entry in a vector index — a chunk with its embedding and storage reference. */ export interface VectorEntry { id: string; vector: Float32Array; storageId: string; metadata: Record; } /** * Search result with relevance score. */ export interface ScoredEntry { entry: VectorEntry; score: number; } /** * Pluggable vector index. Built-in: in-memory brute-force cosine similarity. * Users can swap to Qdrant, Pinecone, Weaviate, etc. * * `add()` uses upsert semantics: if an entry with the same ID exists, it is replaced. */ export interface VectorIndex { add(entries: VectorEntry[]): Promise; search(query: Float32Array, topK: number): Promise; delete(ids: string[]): Promise; readonly size: number; } /** * Optional mixin for vector indices that support local snapshot persistence. * Only applicable to local/in-memory backends — remote backends (Qdrant, etc.) * manage their own persistence. */ export interface SerializableVectorIndex extends VectorIndex { serialize(): Promise; deserialize(data: Uint8Array): Promise; } //# sourceMappingURL=vector-index.d.ts.map