import type { QueryResult } from 'pg'; import type { VectorStoreCore, VectorStoreIndexAdmin, VectorEntry, VectorQueryParams, VectorQueryResult, CreateIndexParams, IndexStats, VectorFilter } from '@kuralle-agents/rag'; type PostgresClient = { query: (text: string, params?: unknown[]) => Promise; }; export type PgVectorStoreOptions = { /** PostgreSQL client (pg.Pool or pg.Client). Must have pgvector extension installed. */ client: PostgresClient; /** Table name prefix. Each index creates a table named {prefix}_{indexName}. Default: 'kuralle_vectors'. */ tablePrefix?: string; }; /** * VectorStore implementation backed by PostgreSQL with pgvector extension. * * Each index is a separate table with schema: * id TEXT PRIMARY KEY * vector vector(N) * metadata JSONB * document TEXT * created_at TIMESTAMPTZ DEFAULT NOW() * * Requires: PostgreSQL 15+ with pgvector extension. * CREATE EXTENSION IF NOT EXISTS vector; */ export declare class PgVectorStore implements VectorStoreCore, VectorStoreIndexAdmin { private readonly client; private readonly prefix; private initialized; constructor(options: PgVectorStoreOptions); private tableName; private ensureExtension; createIndex(params: CreateIndexParams): Promise; upsert(indexName: string, entries: VectorEntry[]): Promise; query(indexName: string, params: VectorQueryParams): Promise; listIndexes(): Promise; deleteIndex(indexName: string): Promise; deleteVectors(indexName: string, params: { ids?: string[]; filter?: VectorFilter; }): Promise; describeIndex(indexName: string): Promise; } export {};