/** * @module @nhtio/adk/batteries/vector/redis * * One adapter for the whole Redis/Valkey family. The vector engine is RediSearch * (`FT.CREATE` / `FT.SEARCH` with a `VECTOR` field over a HASH keyspace); records are * stored as Redis hashes keyed `${collection}:${id}`, with the vector packed as a * little-endian Float32 buffer. Metadata scalars are stored as TAG/NUMERIC fields so the * neutral filter tree compiles to RediSearch query syntax. * * Works against `redis/redis-stack-server` (bundles RediSearch) and any Redis/Valkey with * the RediSearch module loaded. */ import { BaseVectorStore } from "../contract"; import type { VectorFilter } from "../filters"; import type { SearchPlan, UpsertPlan, DeletePlan, CollectionSpec } from "../plan"; import type { VectorMatch, VectorStoreCapabilities, BaseVectorStoreOptions } from "../types"; export interface RedisVectorStoreOptions extends BaseVectorStoreOptions { /** Connection and authentication parameters for the backend. */ connection?: { url?: string; username?: string; password?: string; }; } /** * Compile the neutral filter tree to a RediSearch query fragment. TAG fields hold string / * boolean metadata; NUMERIC fields hold numbers. Returns a fragment to AND with the KNN * clause (or to use alone for a filter-scan). Throws on operators RediSearch can't express. */ export declare const translateRedisFilter: (filter?: VectorFilter) => string; export declare class RedisVectorStore extends BaseVectorStore { #private; readonly capabilities: VectorStoreCapabilities; /** Static availability probe: whether this adapter's runtime driver can load in the current environment. */ static isAvailable(): boolean; isAvailable(): boolean; connect(): Promise; close(): Promise; createCollection(spec: CollectionSpec, ifNotExists: boolean): Promise; dropCollection(collection: string, ifExists: boolean): Promise; hasCollection(collection: string): Promise; renameCollection(_from: string, _to: string): Promise; executeUpsert(plan: UpsertPlan): Promise; executeSearch(plan: SearchPlan): Promise; executeDelete(plan: DeletePlan): Promise; }