/** * In-memory vector store with cosine similarity search. * * Stores pre-computed attack embeddings and finds nearest neighbors * for incoming text. Sub-millisecond for ~2000 vectors at 384 dimensions. * * @module agent-threat-rules/embedding/vector-store */ import type { ATRSeverity } from '../types.js'; export interface VectorEntry { readonly id: string; readonly vector: Float32Array; readonly label: string; readonly category: string; readonly severity: ATRSeverity; } export interface SearchResult { readonly entry: VectorEntry; readonly similarity: number; } export declare class VectorStore { private readonly entries; constructor(entries?: readonly VectorEntry[]); /** Create new store with additional entries (immutable) */ withEntries(newEntries: readonly VectorEntry[]): VectorStore; /** * Find top-K nearest neighbors by cosine similarity. * Only returns results above the threshold. */ search(query: Float32Array, topK?: number, threshold?: number): readonly SearchResult[]; size(): number; } /** Load pre-computed embeddings from JSON */ export declare function loadVectorEntries(data: readonly { id: string; vector: number[]; label: string; category: string; severity: string; }[]): VectorEntry[]; //# sourceMappingURL=vector-store.d.ts.map