import { z } from 'zod'; import { MochowClient } from '@mochow/mochow-sdk-node'; import { QdrantClient } from '@qdrant/js-client-rest'; import { VectorStore as VectorStore$1 } from '@langchain/core/vectorstores'; import { ClientConfig } from 'pg'; import { Connection, Pool } from 'oracledb'; interface ValkeyConfig extends VectorStoreConfig { valkeyUrl: string; collectionName: string; embeddingModelDims: number; timezone?: string; indexType?: "hnsw" | "flat"; hnswM?: number; hnswEfConstruction?: number; hnswEfRuntime?: number; clusterMode?: boolean; } interface MultiModalMessages { type: "image_url"; image_url: { url: string; }; } interface Message { role: string; content: string | MultiModalMessages; } interface EmbeddingConfig { apiKey?: string; model?: string | any; baseURL?: string; url?: string; embeddingDims?: number; modelProperties?: Record; huggingfaceBaseUrl?: string; awsRegion?: string; awsAccessKeyId?: string; awsSecretAccessKey?: string; awsSessionToken?: string; } interface VertexAIConfig extends EmbeddingConfig { vertexCredentialsJson?: string; googleServiceAccountJson?: string | Record; googleProjectId?: string; location?: string; memoryAddEmbeddingType?: string; memoryUpdateEmbeddingType?: string; memorySearchEmbeddingType?: string; } interface VectorStoreConfig { collectionName?: string; dimension?: number; dbPath?: string; client?: any; instance?: any; [key: string]: any; } interface HistoryStoreConfig { provider: string; config: { historyDbPath?: string; supabaseUrl?: string; supabaseKey?: string; tableName?: string; }; } interface LLMConfig { provider?: string; baseURL?: string; vllmBaseURL?: string; vllm_base_url?: string; url?: string; config?: Record; apiKey?: string; model?: string | any; modelProperties?: Record; timeout?: number; temperature?: number; topP?: number; maxTokens?: number; awsRegion?: string; awsAccessKeyId?: string; awsSecretAccessKey?: string; awsSessionToken?: string; providerOverride?: string; client?: any; } interface RerankerConfig { apiKey?: string; /** The reranker model to use. Default varies by provider. */ model?: string; /** Maximum number of documents to return after reranking. Default: unset (return all). */ topK?: number; /** `cohere` only. Return document texts in the response. Default: `false`. */ returnDocuments?: boolean; /** `cohere` only. Maximum number of chunks per document. Default: unset. */ maxChunksPerDoc?: number; /** * `sentence_transformer` / `huggingface` only. Transformers.js device, e.g. * `"cpu"`, `"wasm"`, `"webgpu"`. Default: unset (auto-detect). */ device?: string; /** `huggingface` only. Max token length per query-document pair. Default: `512`. */ maxLength?: number; /** * `sentence_transformer` / `huggingface` only. Sigmoid-normalize raw logits * to `[0, 1]`. Default: `true`; set `false` to surface raw logits. */ normalize?: boolean; /** No-op: a search reranks a small candidate set in one forward pass. */ batchSize?: number; /** No-op in this runtime. */ showProgressBar?: boolean; /** * `llm_reranker` only. LLM provider used to build the scoring LLM when * `llm` is not set. Default: `"openai"`. */ provider?: string; /** `llm_reranker` only. Temperature for LLM generation. Default: `0.0`. */ temperature?: number; /** `llm_reranker` only. Maximum tokens for the LLM response. Default: `100`. */ maxTokens?: number; /** * `llm_reranker` only. Nested LLM configuration. When set, it overrides the * top-level `provider`/`model`/`temperature`/`maxTokens`/`apiKey`, which * then only act as defaults for fields missing from `llm.config`. */ llm?: { provider: string; config: LLMConfig; }; [key: string]: any; } interface MemoryConfig { version?: string; embedder: { provider: string; config: EmbeddingConfig; }; vectorStore: { provider: string; config: VectorStoreConfig; }; llm: { provider: string; config: LLMConfig; }; reranker?: { provider: string; config: RerankerConfig; }; historyStore?: HistoryStoreConfig; disableHistory?: boolean; historyDbPath?: string; customInstructions?: string; } interface MemoryItem { id: string; memory: string; hash?: string; createdAt?: string; updatedAt?: string; score?: number; /** Relevance score added by the reranker, alongside (not replacing) `score`. */ rerankScore?: number; metadata?: Record; attributedTo?: string; } interface SearchFilters { user_id?: string; agent_id?: string; run_id?: string; [key: string]: any; } interface SearchResult { results: MemoryItem[]; } interface VectorStoreResult { id: string; payload: Record; score?: number; } declare const MemoryConfigSchema: z.ZodObject<{ version: z.ZodOptional; embedder: z.ZodObject<{ provider: z.ZodString; config: z.ZodObject<{ modelProperties: z.ZodOptional>; apiKey: z.ZodOptional; model: z.ZodOptional>; baseURL: z.ZodOptional; embeddingDims: z.ZodOptional; url: z.ZodOptional; vertexCredentialsJson: z.ZodOptional; googleServiceAccountJson: z.ZodOptional]>>; googleProjectId: z.ZodOptional; location: z.ZodOptional; memoryAddEmbeddingType: z.ZodOptional; memoryUpdateEmbeddingType: z.ZodOptional; memorySearchEmbeddingType: z.ZodOptional; awsRegion: z.ZodOptional; awsAccessKeyId: z.ZodOptional; awsSecretAccessKey: z.ZodOptional; awsSessionToken: z.ZodOptional; }, "strip", z.ZodTypeAny, { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }, { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }>; }, "strip", z.ZodTypeAny, { provider: string; config: { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }; }, { provider: string; config: { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }; }>; vectorStore: z.ZodObject<{ provider: z.ZodString; config: z.ZodObject<{ collectionName: z.ZodOptional; dimension: z.ZodOptional; dbPath: z.ZodOptional; client: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ collectionName: z.ZodOptional; dimension: z.ZodOptional; dbPath: z.ZodOptional; client: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ collectionName: z.ZodOptional; dimension: z.ZodOptional; dbPath: z.ZodOptional; client: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { provider: string; config: { collectionName?: string | undefined; dimension?: number | undefined; dbPath?: string | undefined; client?: any; } & { [k: string]: unknown; }; }, { provider: string; config: { collectionName?: string | undefined; dimension?: number | undefined; dbPath?: string | undefined; client?: any; } & { [k: string]: unknown; }; }>; llm: z.ZodObject<{ provider: z.ZodString; config: z.ZodObject<{ apiKey: z.ZodOptional; model: z.ZodOptional>; modelProperties: z.ZodOptional>; baseURL: z.ZodOptional; vllmBaseURL: z.ZodOptional; vllm_base_url: z.ZodOptional; url: z.ZodOptional; timeout: z.ZodOptional; temperature: z.ZodOptional; topP: z.ZodOptional; maxTokens: z.ZodOptional; awsRegion: z.ZodOptional; awsAccessKeyId: z.ZodOptional; awsSecretAccessKey: z.ZodOptional; awsSessionToken: z.ZodOptional; client: z.ZodOptional; }, "passthrough", z.ZodTypeAny, z.objectOutputType<{ apiKey: z.ZodOptional; model: z.ZodOptional>; modelProperties: z.ZodOptional>; baseURL: z.ZodOptional; vllmBaseURL: z.ZodOptional; vllm_base_url: z.ZodOptional; url: z.ZodOptional; timeout: z.ZodOptional; temperature: z.ZodOptional; topP: z.ZodOptional; maxTokens: z.ZodOptional; awsRegion: z.ZodOptional; awsAccessKeyId: z.ZodOptional; awsSecretAccessKey: z.ZodOptional; awsSessionToken: z.ZodOptional; client: z.ZodOptional; }, z.ZodTypeAny, "passthrough">, z.objectInputType<{ apiKey: z.ZodOptional; model: z.ZodOptional>; modelProperties: z.ZodOptional>; baseURL: z.ZodOptional; vllmBaseURL: z.ZodOptional; vllm_base_url: z.ZodOptional; url: z.ZodOptional; timeout: z.ZodOptional; temperature: z.ZodOptional; topP: z.ZodOptional; maxTokens: z.ZodOptional; awsRegion: z.ZodOptional; awsAccessKeyId: z.ZodOptional; awsSecretAccessKey: z.ZodOptional; awsSessionToken: z.ZodOptional; client: z.ZodOptional; }, z.ZodTypeAny, "passthrough">>; }, "strip", z.ZodTypeAny, { provider: string; config: { client?: any; apiKey?: string | undefined; model?: any; temperature?: number | undefined; maxTokens?: number | undefined; modelProperties?: Record | undefined; baseURL?: string | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; vllmBaseURL?: string | undefined; vllm_base_url?: string | undefined; timeout?: number | undefined; topP?: number | undefined; } & { [k: string]: unknown; }; }, { provider: string; config: { client?: any; apiKey?: string | undefined; model?: any; temperature?: number | undefined; maxTokens?: number | undefined; modelProperties?: Record | undefined; baseURL?: string | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; vllmBaseURL?: string | undefined; vllm_base_url?: string | undefined; timeout?: number | undefined; topP?: number | undefined; } & { [k: string]: unknown; }; }>; historyDbPath: z.ZodOptional; customInstructions: z.ZodOptional; historyStore: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: string; config: Record; }, { provider: string; config: Record; }>>; reranker: z.ZodOptional; }, "strip", z.ZodTypeAny, { provider: string; config: Record; }, { provider: string; config: Record; }>>; disableHistory: z.ZodOptional; }, "strip", z.ZodTypeAny, { llm: { provider: string; config: { client?: any; apiKey?: string | undefined; model?: any; temperature?: number | undefined; maxTokens?: number | undefined; modelProperties?: Record | undefined; baseURL?: string | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; vllmBaseURL?: string | undefined; vllm_base_url?: string | undefined; timeout?: number | undefined; topP?: number | undefined; } & { [k: string]: unknown; }; }; embedder: { provider: string; config: { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }; }; vectorStore: { provider: string; config: { collectionName?: string | undefined; dimension?: number | undefined; dbPath?: string | undefined; client?: any; } & { [k: string]: unknown; }; }; version?: string | undefined; historyDbPath?: string | undefined; customInstructions?: string | undefined; historyStore?: { provider: string; config: Record; } | undefined; reranker?: { provider: string; config: Record; } | undefined; disableHistory?: boolean | undefined; }, { llm: { provider: string; config: { client?: any; apiKey?: string | undefined; model?: any; temperature?: number | undefined; maxTokens?: number | undefined; modelProperties?: Record | undefined; baseURL?: string | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; vllmBaseURL?: string | undefined; vllm_base_url?: string | undefined; timeout?: number | undefined; topP?: number | undefined; } & { [k: string]: unknown; }; }; embedder: { provider: string; config: { vertexCredentialsJson?: string | undefined; googleServiceAccountJson?: string | Record | undefined; googleProjectId?: string | undefined; location?: string | undefined; memoryAddEmbeddingType?: string | undefined; memoryUpdateEmbeddingType?: string | undefined; memorySearchEmbeddingType?: string | undefined; apiKey?: string | undefined; model?: any; modelProperties?: Record | undefined; baseURL?: string | undefined; embeddingDims?: number | undefined; url?: string | undefined; awsRegion?: string | undefined; awsAccessKeyId?: string | undefined; awsSecretAccessKey?: string | undefined; awsSessionToken?: string | undefined; }; }; vectorStore: { provider: string; config: { collectionName?: string | undefined; dimension?: number | undefined; dbPath?: string | undefined; client?: any; } & { [k: string]: unknown; }; }; version?: string | undefined; historyDbPath?: string | undefined; customInstructions?: string | undefined; historyStore?: { provider: string; config: Record; } | undefined; reranker?: { provider: string; config: Record; } | undefined; disableHistory?: boolean | undefined; }>; interface Entity { userId?: string; agentId?: string; runId?: string; } interface AddMemoryOptions extends Entity { metadata?: Record; filters?: SearchFilters; infer?: boolean; timestamp?: number | string | Date | null; /** Date (YYYY-MM-DD) after which the memory is considered expired. */ expirationDate?: string | null; } interface UpdateMemoryOptions { /** New content to update the memory with. */ text?: string; /** * New content to update the memory with. * @deprecated Use `text` instead. Will be removed in the next major release. */ data?: string; /** Metadata merged into the memory's existing metadata. */ metadata?: Record; /** Date (YYYY-MM-DD) after which the memory expires, or `null` to clear it. */ expirationDate?: string | null; } interface SearchMemoryOptions { topK?: number; filters?: SearchFilters; threshold?: number; explain?: boolean; referenceDate?: number | string | Date | null; /** * Re-rank the results with the configured reranker before returning. No-op * when no `reranker` is configured on the Memory. */ rerank?: boolean; /** Include expired memories in the results. Defaults to false. */ showExpired?: boolean; } interface GetAllMemoryOptions { topK?: number; filters?: SearchFilters; /** Include expired memories in the results. Defaults to false. */ showExpired?: boolean; } interface DeleteAllMemoryOptions extends Entity { } interface UpdateProjectOptions { decay?: boolean; [key: string]: any; } declare class LLMError extends Error { readonly cause?: unknown; constructor(message: string, options?: { cause?: unknown; }); } declare class Memory { private config; private customInstructions; private embedder; private vectorStore; private llm; private reranker; private db; private collectionName; private apiVersion; telemetryId: string; private _initPromise; private _initError?; private _entityStore?; constructor(config?: Partial); /** * If no explicit dimension was provided, runs a probe embedding to * detect it. Then creates and initializes the vector store. */ private _autoInitialize; /** * Ensures that auto-initialization (dimension detection + vector store * creation) has completed before any public method proceeds. * If a previous init attempt failed, retries automatically. */ private _ensureInitialized; private getEntityStore; /** * Normalize a filters object for entity-store scoping: keeps only * user_id/agent_id/run_id keys whose values are defined. */ private _sessionFiltersFromPayload; private _normalizeEntityText; private _existingEntitiesByText; /** * Remove `memoryId` from every entity record scoped to `filters`. * If an entity's `linkedMemoryIds` becomes empty after removal, the * entity record itself is deleted. Errors on individual entities are * swallowed so one bad record does not break the whole operation. * * No-op if the entity store has not been initialized yet. */ private _removeMemoryFromEntityStore; /** * Extract entities from `text` and link them to `memoryId` in the * entity store, scoped to `filters` (user_id / agent_id / run_id). * * Simpler single-memory variant of Phase 7 in add(): no cross-memory * dedup, but still does per-entity "search for existing, update if * match >= 0.95 else insert new". Non-fatal errors are swallowed. */ private _linkEntitiesForMemory; private escapeScopeValue; private buildSessionScope; private _initializeTelemetry; private _getTelemetryId; private _captureEvent; private _displayFirstRunNotice; private _displayDecayUsageNotice; private _displayTemporalUsageNotice; private _displayScaleThresholdNotice; private _displayPerformanceSlowQueryNotice; private _getNoticeTelemetryId; static fromConfig(configDict: Record): Memory; updateProject(options?: UpdateProjectOptions): Promise; add(messages: string | Message[], config: AddMemoryOptions): Promise; private addToVectorStore; get(memoryId: string): Promise; search(query: string, config: SearchMemoryOptions): Promise; update(memoryId: string, config: string | UpdateMemoryOptions): Promise<{ message: string; }>; delete(memoryId: string): Promise<{ message: string; }>; deleteAll(config: DeleteAllMemoryOptions): Promise<{ message: string; }>; history(memoryId: string): Promise; reset(): Promise; getAll(config: GetAllMemoryOptions): Promise; private createMemory; private updateMemory; private deleteMemory; /** * Check if filters contain advanced operators that need special processing. */ private _hasAdvancedOperators; /** * Process enhanced metadata filters and convert them to vector store compatible format. * Converts AND/OR/NOT to $or/$not format that vector stores can interpret. */ private _processMetadataFilters; } interface Embedder { embed(text: string, memoryAction?: "add" | "update" | "search"): Promise; embedBatch(texts: string[], memoryAction?: "add" | "update" | "search"): Promise; } /** * AWS Bedrock embedder, mirroring `mem0/embeddings/aws_bedrock.py`. * * Supports the Amazon Titan and Cohere embedding model families. The * `@aws-sdk/client-bedrock-runtime` dependency is lazily imported so the * package stays optional: importing this module never forces the SDK to be * installed until a Bedrock embedder actually embeds something. */ declare class AWSBedrockEmbedder implements Embedder { private readonly model; private readonly region; private readonly embeddingDims?; private readonly credentials?; private clientPromise?; constructor(config: EmbeddingConfig); private loadSdk; private createClient; private getClient; private isCohereModel; private isCohereV4Model; private buildRequestBody; private invoke; embed(text: string, memoryAction?: "add" | "update" | "search"): Promise; embedBatch(texts: string[], memoryAction?: "add" | "update" | "search"): Promise; } /** * HuggingFace embedding provider (hosted inference mode). * * Mirrors the `huggingface_base_url` branch of the Python provider * (`mem0/embeddings/huggingface.py`): a HuggingFace Text Embeddings Inference * (TEI) server, or any HuggingFace OpenAI-compatible inference endpoint, * exposes a `/v1/embeddings` route, so this embedder reuses the existing * `openai` client pointed at that base URL. No new dependency is required. * * A base URL is required. The Python provider's alternative local * `sentence-transformers` path has no lightweight TypeScript equivalent, so * hosted inference is the supported TS mode. */ declare class HuggingFaceEmbedder implements Embedder { private openai; private model; constructor(config: EmbeddingConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class OpenAIEmbedder implements Embedder { private openai; private model; private embeddingDims; constructor(config: EmbeddingConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class OllamaEmbedder implements Embedder { private ollama; private model; private embeddingDims?; private readonly host; private initialized; constructor(config: EmbeddingConfig); private ensureClient; embed(text: string): Promise; embedBatch(texts: string[]): Promise; private static normalizeModelName; private ensureModelExists; } declare class LMStudioEmbedder implements Embedder { private openai; private model; constructor(config: EmbeddingConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class TogetherEmbedder extends OpenAIEmbedder { constructor(config: EmbeddingConfig); } declare class GoogleEmbedder implements Embedder { private google; private model; private embeddingDims; private readonly apiKey; constructor(config: EmbeddingConfig); private ensureClient; embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class AzureOpenAIEmbedder implements Embedder { private client; private model; private embeddingDims; constructor(config: EmbeddingConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class LangchainEmbedder implements Embedder { private embedderInstance; private batchSize?; constructor(config: EmbeddingConfig); embed(text: string): Promise; embedBatch(texts: string[]): Promise; } declare class VertexAIEmbedder implements Embedder { private client; private helpers; private initPromise; private clientOptions; private model; private embeddingDims; private location; private projectId; private embeddingTypes; constructor(config: VertexAIConfig); private initClient; private createClient; private endpoint; private formatInstance; embed(text: string, memoryAction?: "add" | "update" | "search"): Promise; embedBatch(texts: string[], memoryAction?: "add" | "update" | "search"): Promise; } declare class FastEmbedEmbedder implements Embedder { private readonly modelName; private embeddingModel?; constructor(config: EmbeddingConfig); private getEmbeddingModel; /** * Lazily import the optional `fastembed` peer and initialize the model, so * consumers that never touch FastEmbed don't need it installed. */ private initEmbeddingModel; private normalizeInput; embed(text: string): Promise; embedBatch(texts: string[]): Promise; } interface LLMResponse { content: string; role: string; toolCalls?: Array<{ name: string; arguments: string; }>; } interface LLM { generateResponse(messages: Array<{ role: string; content: string; }>, response_format?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class OpenAILLM implements LLM { private openai; private model; constructor(config: LLMConfig); generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class GoogleLLM implements LLM { private google; private model; private readonly apiKey; constructor(config: LLMConfig); private ensureClient; private formatContents; generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class OpenAIStructuredLLM implements LLM { private openai; private model; constructor(config: LLMConfig); generateResponse(messages: Message[], responseFormat?: { type: string; } | null, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class AnthropicLLM implements LLM { private client; private readonly clientArgs; private model; private maxTokens; private temperature?; private topP?; constructor(config: LLMConfig); private ensureClient; generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class GroqLLM implements LLM { private client; private model; private readonly apiKey; constructor(config: LLMConfig); private ensureClient; generateResponse(messages: Message[], responseFormat?: { type: string; }): Promise; generateChat(messages: Message[]): Promise; } declare class OllamaLLM implements LLM { private ollama; private model; private readonly host; private initialized; constructor(config: LLMConfig); private ensureClient; generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; private ensureModelExists; } declare class LMStudioLLM extends OpenAILLM { constructor(config: LLMConfig); generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class MistralLLM implements LLM { private client; private model; private readonly apiKey; constructor(config: LLMConfig); private ensureClient; private contentToString; generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class LangchainLLM implements LLM { private llmInstance; private modelName; constructor(config: LLMConfig); generateResponse(messages: Message[], response_format?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class LiteLLM extends OpenAILLM { constructor(config: LLMConfig); generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } declare class VllmLLM extends OpenAILLM { constructor(config: LLMConfig); generateResponse(messages: Message[], responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } /** * Extract the model-family provider from a Bedrock model id * (e.g. `anthropic.claude-3-sonnet-...` -> `anthropic`). */ declare function extractProvider(model: string, providerOverride?: string): string; /** * AWS Bedrock fields (awsRegion / awsAccessKeyId / awsSecretAccessKey / * awsSessionToken / client) now live on the shared `LLMConfig`, so the * provider is configurable through the standard typed `Memory` config path. */ type AWSBedrockConfig = LLMConfig; declare class AWSBedrockLLM implements LLM { private model; private provider; private temperature; private maxTokens; private topP?; private clientConfig; private clientOverride?; private sdkPromise?; private clientPromise?; constructor(config?: AWSBedrockConfig); /** * Load the optional AWS SDK on first use. * * This MUST be a dynamic `import()`, never `require()`: tsup/esbuild rewrite * `require()` in the published ESM bundle (`dist/oss/index.mjs`) into a * `__require` shim that throws `Dynamic require of "..." is not supported`, * so every ESM consumer would hit a dead provider even with the SDK installed. */ private getSDK; /** Memoized Bedrock client; an injected `config.client` short-circuits the SDK. */ private getClient; /** * Split messages into a top-level `system` block (Converse passes system * prompts separately) and role-tagged content blocks for everything else. */ private formatMessages; /** * Build the Converse `inferenceConfig`. Anthropic and MiniMax reasoning * models reject requests carrying both `temperature` and `topP`, so `topP` * is omitted for those families (mirrors the Python `_build_inference_config`). */ private buildInferenceConfig; /** Convert OpenAI-style tools to the Converse `toolConfig` shape. */ private convertToolsToConverse; private converse; /** Pull the first text block out of a Converse response. */ private parseText; /** Collect any toolUse blocks out of a Converse response. */ private parseToolCalls; generateResponse(messages: Message[], _responseFormat?: { type: string; }, tools?: any[]): Promise; generateChat(messages: Message[]): Promise; } interface VectorStore { insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch?(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; initialize(): Promise; } declare class MemoryVectorStore implements VectorStore { private db; private dimension; private dbPath; private static readonly CAMEL_TO_SNAKE; private normalizePayload; constructor(config: VectorStoreConfig); private init; private cosineSimilarity; /** * Check if a single field condition matches the payload. * Supports comparison operators: eq, ne, gt, gte, lt, lte, in, nin, contains, icontains */ private matchFieldCondition; /** * Filter a vector by the given filters. * Supports logical operators (AND, OR, NOT) and comparison operators. */ private filterVector; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; private tokenize; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; initialize(): Promise; } interface BaiduConfig extends VectorStoreConfig { endpoint: string; account: string; apiKey: string; databaseName: string; tableName: string; embeddingModelDims: number; metricType?: "L2" | "IP" | "COSINE"; client?: MochowClient; } declare class BaiduDB implements VectorStore { private client; private sdk; private readonly endpoint; private readonly account; private readonly apiKey; private readonly databaseName; private readonly tableName; private readonly embeddingModelDims; private readonly metricType; private supportsKeywordSearch; private storeUserId; private _initPromise?; constructor(config: BaiduConfig); private get ns(); private loadSdk; private ensureClient; private ready; private buildSchema; private buildFilter; private filterOf; private pollTable; private ensureTable; private applySchema; initialize(): Promise; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; reset(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; } interface QdrantConfig extends VectorStoreConfig { /** * Pre-configured QdrantClient instance. If using Qdrant Cloud, you must pass * `port` explicitly when constructing the client to avoid "Illegal host" errors * caused by a known upstream bug (qdrant/qdrant-js#59). * * @example * ```typescript * const client = new QdrantClient({ * url: "https://xxx.cloud.qdrant.io:6333", * port: 6333, * apiKey: "xxx", * }); * ``` */ client?: QdrantClient; host?: string; port?: number; path?: string; url?: string; apiKey?: string; onDisk?: boolean; collectionName: string; embeddingModelDims: number; dimension?: number; } declare class Qdrant implements VectorStore { private client; private readonly config; private readonly collectionName; private dimension; private _initPromise?; private _hasBm25Slot; private _isRemote; constructor(config: QdrantConfig); private ensureClient; /** * Build a single field condition from a key-value filter pair. * Supports enhanced filter syntax with comparison operators. */ private buildFieldCondition; /** * Create a Filter object from the provided filters. * Supports logical operators (AND, OR, NOT) and comparison operators. */ private createFilter; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; private upsertPoints; private buildPointVector; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; private generateUUID; getUserId(): Promise; setUserId(userId: string): Promise; private ensureCollection; private createFilterIndexes; initialize(): Promise; private _doInitialize; } interface RedisConfig extends VectorStoreConfig { redisUrl: string; collectionName: string; embeddingModelDims: number; username?: string; password?: string; } declare function buildRedisFilterExpr(filters?: SearchFilters): string; declare class RedisDB implements VectorStore { private client; private readonly redisUrl; private readonly username?; private readonly password?; private readonly indexName; private readonly indexPrefix; private readonly schema; private _initPromise?; constructor(config: RedisConfig); private ensureClient; private createIndex; initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; close(): Promise; getUserId(): Promise; setUserId(userId: string): Promise; } declare class ValkeyDB implements VectorStore { private client; private readonly collectionName; private readonly indexPrefix; private readonly embeddingModelDims; private readonly timezone; private readonly indexType; private readonly hnswM; private readonly hnswEfConstruction; private readonly hnswEfRuntime; private readonly clusterMode; private readonly valkeyUrl; private _initPromise?; constructor(config: ValkeyConfig); private buildIndexCreateCommand; private ensureSearchModule; private createIndex; private connectClient; initialize(): Promise; private _doInitialize; private buildSearchQuery; private docToResult; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; close(): Promise; getUserId(): Promise; setUserId(userId: string): Promise; } interface SupabaseConfig extends VectorStoreConfig { supabaseUrl: string; supabaseKey: string; tableName: string; embeddingColumnName?: string; metadataColumnName?: string; } declare class SupabaseDB implements VectorStore { private client; private readonly supabaseUrl; private readonly supabaseKey; private readonly tableName; private readonly embeddingColumnName; private readonly metadataColumnName; private _initPromise?; constructor(config: SupabaseConfig); private ensureClient; initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; } interface LangchainStoreConfig extends VectorStoreConfig { client: VectorStore$1; } declare class LangchainVectorStore implements VectorStore { private lcStore; private dimension?; private storeUserId; constructor(config: LangchainStoreConfig); insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; deleteCol(): Promise; getUserId(): Promise; setUserId(userId: string): Promise; initialize(): Promise; } interface VectorizeConfig extends VectorStoreConfig { apiKey?: string; indexName: string; accountId: string; } declare class VectorizeDB implements VectorStore { private client; private apiKey?; private dimensions; private indexName; private accountId; private _initPromise?; constructor(config: VectorizeConfig); private ensureClient; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; private generateUUID; getUserId(): Promise; setUserId(userId: string): Promise; initialize(): Promise; private _doInitialize; } /** * Configuration interface for Azure AI Search vector store */ interface AzureAISearchConfig extends VectorStoreConfig { /** * Azure AI Search service name (e.g., "my-search-service") */ serviceName: string; /** * Index/collection name to use */ collectionName: string; /** * API key for authentication (if not provided, uses DefaultAzureCredential) */ apiKey?: string; /** * Vector embedding dimensions */ embeddingModelDims: number; /** * Compression type: 'none', 'scalar', or 'binary' * @default 'none' */ compressionType?: "none" | "scalar" | "binary"; /** * Use half precision (float16) instead of full precision (float32) * @default false */ useFloat16?: boolean; /** * Enable hybrid search (combines vector + text search) * @default false */ hybridSearch?: boolean; /** * Vector filter mode: 'preFilter' or 'postFilter' * @default 'preFilter' */ vectorFilterMode?: string; } /** * Azure AI Search vector store implementation * Supports vector search with hybrid search, compression, and filtering */ declare class AzureAISearch implements VectorStore { private searchClient; private indexClient; private readonly serviceName; private readonly indexName; private readonly embeddingModelDims; private readonly compressionType; private readonly useFloat16; private readonly hybridSearch; private readonly vectorFilterMode; private readonly apiKey; private _initPromise?; constructor(config: AzureAISearchConfig); private ensureClient; /** * Initialize the Azure AI Search index if it doesn't exist */ initialize(): Promise; private _doInitialize; /** * Create a new index in Azure AI Search */ private createCol; /** * Generate a document for insertion */ private generateDocument; /** * Insert vectors into the index */ insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; /** * Sanitize filter keys to remove non-alphanumeric characters */ private sanitizeKey; /** * Build OData filter expression from SearchFilters */ private buildFilterExpression; /** * Extract JSON from payload string * Handles cases where payload might have extra text */ private extractJson; /** * Keyword search using Azure AI Search native full-text (BM25) capabilities */ keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; /** * Search for similar vectors */ search(query: number[], topK?: number, filters?: SearchFilters): Promise; /** * Delete a vector by ID */ delete(vectorId: string): Promise; /** * Update a vector and its payload */ update(vectorId: string, vector: number[], payload: Record): Promise; /** * Retrieve a vector by ID */ get(vectorId: string): Promise; /** * List all collections (indexes) */ private listCols; /** * Delete the index */ deleteCol(): Promise; /** * Get information about the index */ private colInfo; /** * List all vectors in the index */ list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; /** * Generate a random user ID */ private generateUUID; /** * Get user ID from memory_migrations collection * Required by VectorStore interface */ getUserId(): Promise; /** * Set user ID in memory_migrations collection * Required by VectorStore interface */ setUserId(userId: string): Promise; /** * Reset the index by deleting and recreating it */ reset(): Promise; } interface FilterResult { conditions: string[]; values: any[]; paramIndex: number; } declare function buildFilterConditions(filters: Record | undefined, startIndex: number): FilterResult; interface PGVectorConfig extends VectorStoreConfig { dbname?: string; user?: string; password?: string; host?: string; port?: number; connectionString?: string; ssl?: ClientConfig["ssl"]; embeddingModelDims: number; diskann?: boolean; hnsw?: boolean; } declare class PGVector implements VectorStore { private client; private collectionName; private useDiskann; private useHnsw; private readonly dbName; private readonly useDirectConnection; private config; private _initPromise?; constructor(config: PGVectorConfig); private col; initialize(): Promise; private _doInitialize; private checkDatabaseExists; private createDatabase; private createCol; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; private listCols; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; close(): Promise; getUserId(): Promise; setUserId(userId: string): Promise; } interface DatabricksConfig extends VectorStoreConfig { workspaceUrl?: string; host?: string; httpPath: string; accessToken?: string; clientId?: string; clientSecret?: string; endpointName?: string; endpointType?: "STANDARD" | "STORAGE_OPTIMIZED"; pipelineType?: "TRIGGERED" | "CONTINUOUS"; queryType?: "ANN" | "HYBRID"; catalog?: string; schema?: string; tableName?: string; embeddingModelDims?: number; syncPollIntervalMs?: number; syncTimeoutMs?: number; sqlClient?: DatabricksSqlClientLike; httpClient?: DatabricksHttpClientLike; } interface DatabricksSqlClientLike { connect(options: Record): Promise; openSession(): Promise; close?(): Promise; } interface DatabricksSqlSessionLike { executeStatement(statement: string): Promise; close?(): Promise; } interface DatabricksSqlOperationLike { fetchAll(): Promise>>; close?(): Promise; } interface DatabricksHttpClientLike { get(url: string, config?: Record): Promise<{ data: any; }>; post(url: string, data?: any, config?: Record): Promise<{ data: any; }>; delete(url: string, config?: Record): Promise<{ data: any; }>; } declare class DatabricksVectorStore implements VectorStore { private readonly host; private readonly workspaceUrl; private readonly httpPath; private readonly accessToken?; private readonly clientId?; private readonly clientSecret?; private readonly endpointName; private readonly endpointType; private readonly pipelineType; private readonly queryType; private readonly dimension; private readonly catalog; private readonly schema; private readonly tableName; private readonly indexName; private readonly fullTableName; private readonly fullIndexName; private readonly syncPollIntervalMs; private readonly syncTimeoutMs; private sqlClient; private readonly httpClient; private session?; private _sessionPromise?; private _initPromise?; private sqlModulePromise?; private indexSyncWait; private indexSyncRunning; private indexSyncQueued; private indexSyncError; private readonly oauthTokens; constructor(config: DatabricksConfig); initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; private ensureEndpointExists; private ensureIndexExists; private ensureChangeDataFeedEnabled; private createHttpClient; private withOAuthHeaders; private getOAuthAuthorizationDetails; private getOAuthAccessToken; private getSession; /** * `@databricks/sql` is an OPTIONAL peer, and `index.ts` re-exports this module eagerly, so a * top-level `import` makes `import "mem0ai/oss"` throw MODULE_NOT_FOUND for every user who * never installed the driver -- including everyone who uses a different vector store. Load it * on the first SQL call instead, the way milvus.ts and baidu.ts load theirs. * * This MUST be a dynamic `import()`, never `require()`: tsup/esbuild rewrite `require()` in * the published ESM bundle (`dist/oss/index.mjs`) into a `__require` shim that throws * `Dynamic require of "..." is not supported`, so every ESM consumer would hit a dead * provider even with the driver installed. */ private getSqlModule; private getSqlClient; private openSession; private buildSqlConnectionOptions; /** * Drop the cached session/session-promise so the next `getSession()` opens a fresh one. * Called after any SQL failure below -- a stale session (expired token, dropped socket) * would otherwise keep being handed out and keep failing forever. */ private resetSession; private executeSql; /** * A TRIGGERED pipeline only ingests new rows when it is explicitly synced, so every write * must request one. Writers fire the sync and return; only readers wait for it to land. * A sync already in flight absorbs later writes -- deleteAll()'s N sequential deletes * collapse into far fewer than N pipeline runs. */ private requestIndexSync; private drainIndexSync; private awaitIndexSync; private waitForEndpointReadiness; private waitForIndexReadiness; private shouldPaginateForLocalFiltering; private extractNextPageToken; private queryIndex; private normalizeQueryResults; private rowToObject; private parsePayload; private extractSessionValues; private assertVectorDimension; private matchFieldCondition; private filterVector; } /** * The `@aws-sdk/client-neptune-graph` dependency is loaded on first use via dynamic * `import()` so the package stays optional (mirrors `aws_bedrock.ts`). */ interface NeptuneAnalyticsConfig extends VectorStoreConfig { graphIdentifier?: string; endpoint?: string; collectionName: string; dimension?: number; client?: NeptuneGraphClientLike; } interface NeptuneGraphClientLike { send(command: any): Promise; } interface NeptuneExecuteQueryOutput { payload?: { transformToString(encoding?: string): Promise; }; } declare class NeptuneAnalyticsVectorStore implements VectorStore { private clientConfig; private clientOverride?; private sdkPromise?; private clientPromise?; private readonly graphIdentifier; private readonly collectionName; private readonly collectionLabel; private readonly collectionLabelExpr; private readonly userLabel; private readonly userLabelExpr; private readonly userNodeId; private readonly dimension; private _initPromise?; private cachedUserId?; constructor(config: NeptuneAnalyticsConfig); initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; private findExistingIds; private cleanupFailedInsert; private resolveGraphIdentifier; private buildClientConfig; private escapeLabel; private buildStoredPayload; private buildVertexFilter; private buildMetadataVertexFilter; private combineVertexFilters; private buildFieldVertexFilter; private buildSingleVertexFilter; private negateVertexFilter; private buildWhereClause; private buildFieldWhereClauses; private escapeProperty; private serializeAlgorithmInput; private serializeAlgorithmKey; private assertVectorDimension; private assertBatchDimensions; private normalizeNodeResult; private normalizeSearchResult; private extractNode; private extractPayload; private extractId; private extractUserId; private normalizePayload; private normalizeScore; private assertSuccessfulResults; /** * Load the optional AWS SDK on first use. * * This MUST be a dynamic `import()`, never `require()`: tsup/esbuild rewrite * `require()` in the published ESM bundle (`dist/oss/index.mjs`) into a * `__require` shim that throws `Dynamic require of "..." is not supported`, * so every ESM consumer would hit a dead provider even with the SDK installed. */ private getSDK; /** Memoized Neptune client; an injected `config.client` short-circuits the SDK. */ private getClient; private executeQuery; } interface ElasticsearchConfig extends VectorStoreConfig { /** Pre-configured Elasticsearch client instance (typed as `any` to keep the * optional driver's types out of the published type declarations). */ client?: any; host?: string; port?: number; cloudId?: string; apiKey?: string; username?: string; password?: string; collectionName: string; embeddingModelDims: number; dimension?: number; useSsl?: boolean; caCerts?: string; verifyCerts?: boolean; autoCreateIndex?: boolean; headers?: Record; } declare class ElasticsearchDB implements VectorStore { private client; private readonly config; private readonly collectionName; private readonly dimension; private readonly autoCreateIndex; private _initPromise?; constructor(config: ElasticsearchConfig); private ensureClient; initialize(): Promise; private _doInitialize; private ensureIndex; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; private generateUUID; getUserId(): Promise; setUserId(userId: string): Promise; } interface UpstashVectorConfig extends VectorStoreConfig { collectionName: string; url?: string; token?: string; /** Pre-configured Upstash Vector client instance (typed as `any` to keep * the optional driver's types out of the published type declarations). */ client?: any; } declare class UpstashVector implements VectorStore { private client; private readonly config; private readonly collectionName; constructor(config: UpstashVectorConfig); /** * Lazily construct (or reuse) the Upstash Vector client, importing the * optional `@upstash/vector` peer only when the store is first used so * consumers that never touch Upstash Vector don't need it installed. */ private ensureClient; initialize(): Promise; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(): Promise; reset(): Promise; private parseResult; private stringifyFilterValue; private convertFilters; private matchesFilters; } interface AzureMySQLConfig extends VectorStoreConfig { host: string; port?: number; user: string; password?: string; database: string; collectionName: string; embeddingModelDims: number; useAzureCredential?: boolean; sslCa?: string; sslDisabled?: boolean; maxConn?: number; } declare class AzureMySQLDB implements VectorStore { private pool?; private readonly collectionName; private readonly config; private _initPromise?; constructor(config: AzureMySQLConfig); private col; initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; close(): Promise; } interface CassandraConfig extends VectorStoreConfig { contactPoints?: string[]; port?: number; username?: string; password?: string; keyspace?: string; collectionName?: string; embeddingModelDims?: number; secureConnectBundle?: string; localDataCenter?: string; protocolVersion?: number; loadBalancingPolicy?: any; client?: CassandraClientLike; /** Pre-configured Cassandra driver module (typed as `any` to keep the * optional driver's types out of the published type declarations). */ driver?: any; } interface CassandraClientLike { connect?(): Promise; execute(query: string, params?: any[], options?: Record): Promise<{ rows?: any[]; pageState?: string | null; }>; } declare class CassandraDB implements VectorStore { private static readonly PAGE_SIZE; private readonly driver?; private readonly contactPoints?; private readonly port; private readonly username?; private readonly password?; private readonly keyspace; private readonly collectionName; private readonly dimension; private readonly secureConnectBundle?; private readonly localDataCenter?; private readonly protocolVersion?; private readonly loadBalancingPolicy?; private client?; private _initPromise?; constructor(config: CassandraConfig); initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; private createClient; private loadDriver; private validateIdentifier; private cosineSimilarity; private normalizeVector; private parsePayload; private matchFieldCondition; private filterVector; private assertVectorDimension; private assertBatchDimensions; private scanRows; private pushTopResult; } interface S3VectorsConfig extends VectorStoreConfig { vectorBucketName: string; collectionName: string; embeddingModelDims?: number; dimension?: number; distanceMetric?: "cosine" | "euclidean"; region?: string; regionName?: string; client?: S3VectorsClientLike; /** Pre-configured S3 Vectors client options (typed as `any` to keep the * optional SDK's types out of the published type declarations). */ clientConfig?: any; } interface S3VectorsClientLike { send(command: any): Promise; } declare class S3Vectors implements VectorStore { private readonly config; private readonly vectorBucketName; private readonly collectionName; private readonly dimension; private readonly distanceMetric; private client?; private clientPromise?; private sdkPromise?; private _initPromise?; private cachedUserId?; constructor(config: S3VectorsConfig); /** * Lazily import the optional `@aws-sdk/client-s3vectors` peer so consumers * who never use the S3 Vectors store don't need it installed. */ private getSdk; /** Lazily construct (or reuse) the S3 Vectors client. */ private getClient; private createClient; initialize(): Promise; private _doInitialize; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; private ensureBucketExists; private ensureIndexExists; private ensureMigrationIndex; private fetchStoredVector; private convertFilters; private convertFilterNode; private convertFieldFilter; private negateFilter; private matchesFilter; private matchesFieldFilter; private evaluateOperator; private toVectorData; private fromVectorData; private normalizeMetadata; private normalizeQueryVector; private normalizeStoredVector; private normalizeListedVector; private normalizeScore; private assertVectorDimension; private assertBatchDimensions; private isNotFound; private isConflict; private isAlwaysFalseFilter; private isNoOpFilter; } interface GoogleMatchingEngineConfig extends VectorStoreConfig { projectId: string; projectNumber: string; region: string; endpointId: string; indexId: string; deploymentIndexId: string; collectionName?: string; credentialsPath?: string; serviceAccountJson?: Record; vectorSearchApiEndpoint?: string; } declare class VertexAIVectorSearch implements VectorStore { private config; private matchClient; private indexClient; private _initPromise?; constructor(config: GoogleMatchingEngineConfig); initialize(): Promise; private _doInitialize; private _createRestriction; private _createDatapoint; private get indexPath(); private get indexEndpointPath(); insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; } interface PineconeDBConfig extends VectorStoreConfig { collectionName: string; embeddingModelDims: number; /** Pre-configured Pinecone client instance (typed as `any` to keep the * optional driver's types out of the published type declarations). */ client?: any; apiKey?: string; serverlessConfig?: { cloud: string; region: string; }; podConfig?: { environment: string; podType?: string; pods?: number; replicas?: number; shards?: number; }; metric?: "cosine" | "dotproduct" | "euclidean"; batchSize?: number; namespace?: string; extraParams?: Record; } declare class PineconeDB implements VectorStore { private client; private readonly config; private readonly collectionName; private readonly dimension; private readonly metric; private readonly batchSize; private readonly namespace; private readonly serverlessConfig?; private readonly podConfig?; private readonly extraParams; private _index?; private _initPromise?; constructor(config: PineconeDBConfig); /** * Lazily construct (or reuse) the Pinecone client, importing the optional * `@pinecone-database/pinecone` peer only when the store is first used so * consumers that never touch Pinecone don't need it installed. */ private ensureClient; initialize(): Promise; private _doInitialize; private _ensureIndex; private index; private namespacedIndex; private migrationsIndex; private createFilter; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(_query: string, _topK?: number, _filters?: SearchFilters): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; } interface TurbopufferConfig extends VectorStoreConfig { apiKey?: string; region?: string; collectionName: string; distanceMetric?: string; batchSize?: number; } declare class TurbopufferDB implements VectorStore { private clientInstance?; private clientPromise?; private readonly apiKey; private readonly region; private readonly collectionName; private readonly distanceMetric; private readonly batchSize; constructor(config: TurbopufferConfig); /** * Lazily construct (or reuse) the Turbopuffer client, importing the optional * `@turbopuffer/turbopuffer` peer only when the store is first used so * consumers that never touch Turbopuffer don't need it installed. */ private getClient; private createClient; private getNs; private getMigrationsNs; initialize(): Promise; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; private static readonly OPERATOR_MAP; private convertFilters; private parseRows; } /** * Supported Milvus metric types. Mirrors the Python provider * (`mem0/configs/vector_stores/milvus.py`). */ type MilvusMetricType = "L2" | "IP" | "COSINE" | "HAMMING" | "JACCARD"; interface MilvusConfig extends VectorStoreConfig { /** * Full URL/address for the Milvus or Zilliz server. * Defaults to `http://localhost:19530`. */ url?: string; /** Token / API key for Zilliz Cloud. Optional for a local setup. */ token?: string; /** Name of the database. Optional (Milvus default database when empty). */ dbName?: string; /** Collection name. Defaults to `mem0`. */ collectionName?: string; /** Embedding dimensionality. Defaults to 1536 (OpenAI). */ embeddingModelDims?: number; dimension?: number; /** Similarity metric. Defaults to `L2` (matches the Python provider). */ metricType?: MilvusMetricType; /** * Pre-constructed `MilvusClient` instance. When provided, `url`/`token`/`dbName` * are ignored. Primarily useful for dependency injection in tests. */ client?: any; } /** * Milvus vector store provider for the TypeScript OSS SDK. * * Mirrors the Python provider in `mem0/vector_stores/milvus.py`: dense-vector * CRUD (insert / search / get / update / delete / list + user-id helpers) plus * BM25 hybrid keyword search. New collections are created with a `text` + * `sparse` field pair and a BM25 function so `keywordSearch` can run full-text * search; collections created before BM25 support keep working with it disabled. * * The `@zilliz/milvus2-sdk-node` dependency is lazily required so the package * remains optional. Importing this module never forces the SDK to be installed * until a Milvus store is actually constructed. */ declare class Milvus implements VectorStore { private client; private readonly collectionName; private readonly dimension; private readonly metricType; private _initPromise?; private DataType; private FunctionType; private hasBm25Schema; constructor(config: MilvusConfig); initialize(): Promise; /** * Create the collection if it does not already exist, with an AUTOINDEX * dense-vector index plus a BM25 `text` -> `sparse` full-text index. Idempotent * (mirrors the Python `create_col`). When the collection already exists, detect * whether the BM25 `text`/`sparse` fields are present so keyword search * degrades gracefully on collections created before BM25 support. */ private createCol; /** * Filter keys are interpolated straight into the expression, so restrict them * to safe identifiers (same rule as the Python provider) to block injection. */ private static readonly SAFE_FILTER_KEY; /** * Build a Milvus boolean filter expression from a flat filters object. * Mirrors the Python `_create_filter` (equality only, AND-combined): validate * each key, escape string values (backslash first, then double-quote), and * reject value types Milvus can't compare against a scalar field. */ private createFilter; /** * Text fed to the BM25 sparse index for a payload. Prefers `textLemmatized`, * then `text_lemmatized`, then raw `data`; truncates to the VarChar limit. */ private bm25Text; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; /** * Map raw Milvus search hits to VectorStoreResult. For the L2 metric, * distances are unbounded and smaller-is-better, so normalise them to a 0..1 * similarity; every other metric passes the raw score through. Shared by * search and keywordSearch so both match the Python provider's `_parse_output` * (which likewise normalises by metric type regardless of dense vs BM25 score). */ private parseHits; search(query: number[], topK?: number, filters?: SearchFilters): Promise; /** * BM25 full-text keyword search over the sparse field. Milvus tokenizes the * raw query string via the collection's BM25 function. Returns null when the * collection has no BM25 schema so callers fall back to dense search only * (mirrors the Python provider). */ keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; private generateUUID; private ensureMigrationsCol; getUserId(): Promise; setUserId(userId: string): Promise; } interface MongoDBConfig extends VectorStoreConfig { url?: string; dbName?: string; collectionName?: string; embeddingModelDims?: number; dimension?: number; /** Pre-configured MongoDB client instance (typed as `any` to keep the * optional driver's types out of the published type declarations). */ client?: any; } declare class MongoDB implements VectorStore { private client; private db; private collection; private readonly config; private readonly collectionName; private readonly dbName; private readonly embeddingModelDims; private readonly indexName; private _initPromise?; constructor(config: MongoDBConfig); private ensureClient; initialize(): Promise; private textSearchIndexDefinition; private textSearchIndexMappingIsCurrent; private _doInitialize; private validateFilterValue; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; close(): Promise; } type OpenSearchAuth = { username?: string; password?: string; } | { user?: string; password?: string; } | Record; interface OpenSearchConfig extends VectorStoreConfig { /** Pre-configured OpenSearch client instance (typed as `any` to keep the * optional driver's types out of the published type declarations). */ client?: any; host?: string; port?: number; httpAuth?: OpenSearchAuth | [string, string]; user?: string; password?: string; useSSL?: boolean; verifyCerts?: boolean; collectionName: string; embeddingModelDims: number; autoRefresh?: boolean; } declare class OpenSearchDB implements VectorStore { private client; private readonly config; private readonly collectionName; private readonly embeddingModelDims; private readonly autoRefresh; private _initPromise?; constructor(config: OpenSearchConfig); private ensureClient; initialize(): Promise; private _doInitialize; private normalizeAuth; private indexExists; private createCol; private ensureMigrationIndex; private validateVector; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; reset(): Promise; getUserId(): Promise; setUserId(userId: string): Promise; private hitToResult; private buildFilterClauses; private buildFilterClause; private buildOperatorClause; private payloadField; private assertScalarValue; private assertScalarArray; } interface WeaviateConfig extends VectorStoreConfig { /** Pre-configured Weaviate client instance (typed as `any` to keep the * optional driver's types out of the published type declarations). */ client?: any; clusterUrl?: string; apiKey?: string; additionalHeaders?: Record; collectionName: string; embeddingModelDims: number; } declare class WeaviateDB implements VectorStore { private _config; private _client; private _sdk; private _col; private _userId; private _initPromise?; constructor(config: WeaviateConfig); initialize(): Promise; private ensureClient; private _doInitialize; private _buildFilters; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; keywordSearch(query: string, topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; } declare const DISTANCE_METRICS: readonly ["COSINE", "EUCLIDEAN", "EUCLIDEAN_SQUARED", "DOT", "HAMMING", "MANHATTAN"]; type DistanceMetric = (typeof DISTANCE_METRICS)[number]; type IndexType = "HNSW" | "IVF"; declare function quoteIdentifier(name: string): string; declare function buildFilterGroup(filters: Record, binds: Record): string; declare function buildWhereClause(filters?: SearchFilters): [string, Record]; interface OracleDBConfig extends VectorStoreConfig { connectionParams?: Record; useConnectionPool?: boolean; client?: Connection | Pool; collectionName?: string; embeddingModelDims?: number; distanceMetric?: DistanceMetric; doCreateIndex?: boolean; indexType?: IndexType; indexName?: string; indexParameters?: Record; indexAccuracy?: number; } declare class OracleAIVectorSearch implements VectorStore { private readonly collectionName; private readonly indexName; private readonly embeddingModelDims; private readonly distanceMetric; private readonly indexType; private readonly indexParameters; private readonly indexAccuracy?; private readonly doCreateIndex; private readonly config; private oracledb; private client?; private ownsClient; private _initPromise?; constructor(config: OracleDBConfig); private validateIndexParameters; initialize(): Promise; private _doInitialize; private isPool; private withConnection; private assertVectorSupport; private createIndexDdl; private createCol; private loadPayload; private vectorBind; private payloadBind; insert(vectors: number[][], ids: string[], payloads: Record[]): Promise; search(query: number[], topK?: number, filters?: SearchFilters): Promise; get(vectorId: string): Promise; update(vectorId: string, vector: number[], payload: Record): Promise; delete(vectorId: string): Promise; deleteCol(): Promise; list(filters?: SearchFilters, topK?: number): Promise<[VectorStoreResult[], number]>; getUserId(): Promise; setUserId(userId: string): Promise; close(): Promise; } interface RerankResult { /** Index into the input `documents` array. */ index: number; /** Relevance of the document to the query, 0..1, higher = more relevant. */ rerankScore: number; } interface Reranker { /** * Rank `documents` by relevance to `query`. * * Returns results sorted by descending relevance. When `topK` is given, at * most that many results are returned. Each result's `index` points back into * the input `documents` array so callers can recover the original item. */ rerank(query: string, documents: string[], topK?: number): Promise; } declare class CohereReranker implements Reranker { private clientInstance?; private clientPromise?; private readonly apiKey; private model; private topK?; private returnDocuments; private maxChunksPerDoc?; constructor(config: RerankerConfig); /** * Lazily construct (or reuse) the Cohere client, importing the optional * `cohere-ai` peer only when the reranker is first used so consumers that * never touch Cohere don't need it installed. */ private getClient; private createClient; rerank(query: string, documents: string[], topK?: number): Promise; } declare class LLMReranker implements Reranker { private llm; private topK?; constructor(config: RerankerConfig, llm: LLM); rerank(query: string, documents: string[], topK?: number): Promise; private score; private extractScore; } declare class ZeroEntropyReranker implements Reranker { private clientInstance?; private clientPromise?; private readonly apiKey; private model; private topK?; constructor(config: RerankerConfig); /** * Lazily construct (or reuse) the ZeroEntropy client, importing the * optional `zeroentropy` peer only when the reranker is first used so * consumers that never touch ZeroEntropy don't need it installed. */ private getClient; private createClient; rerank(query: string, documents: string[], topK?: number): Promise; } declare class CrossEncoderReranker implements Reranker { private modelId; private device?; private maxLength?; private normalize; private topK?; private loaded?; constructor(config: RerankerConfig, defaultModel: string, defaultMaxLength?: number); private load; rerank(query: string, documents: string[], topK?: number): Promise; } interface HistoryManager { addHistory(memoryId: string, previousValue: string | null, newValue: string | null, action: string, createdAt?: string, updatedAt?: string, isDeleted?: number): Promise; getHistory(memoryId: string): Promise; reset(): Promise; close(): void; saveMessages?(messages: Array<{ role: string; content: string; name?: string; }>, sessionScope: string): Promise; getLastMessages?(sessionScope: string, limit?: number): Promise>; batchAddHistory?(records: Array<{ memoryId: string; previousValue: string | null; newValue: string | null; action: string; createdAt?: string; updatedAt?: string; isDeleted?: number; }>): Promise; } declare class EmbedderFactory { static create(provider: string, config: EmbeddingConfig): Embedder; } declare class LLMFactory { static create(provider: string, config: LLMConfig): LLM; } declare class VectorStoreFactory { static create(provider: string, config: VectorStoreConfig): VectorStore; } declare class RerankerFactory { static create(provider: string, config: RerankerConfig): Reranker; private static buildLLMRerankerLLM; } declare class HistoryManagerFactory { static create(provider: string, config: HistoryStoreConfig): HistoryManager; } export { AWSBedrockEmbedder, AWSBedrockLLM, type AddMemoryOptions, AnthropicLLM, AzureAISearch, AzureMySQLDB, AzureOpenAIEmbedder, type BaiduConfig, BaiduDB, CassandraDB, CohereReranker, CrossEncoderReranker, DatabricksVectorStore, type DeleteAllMemoryOptions, ElasticsearchDB, type Embedder, EmbedderFactory, type EmbeddingConfig, type Entity, FastEmbedEmbedder, type GetAllMemoryOptions, GoogleEmbedder, GoogleLLM, type GoogleMatchingEngineConfig, GroqLLM, HistoryManagerFactory, type HistoryStoreConfig, HuggingFaceEmbedder, type LLM, type LLMConfig, LLMError, LLMFactory, LLMReranker, type LLMResponse, LMStudioEmbedder, LMStudioLLM, LangchainEmbedder, LangchainLLM, LangchainVectorStore, LiteLLM, Memory, type MemoryConfig, MemoryConfigSchema, type MemoryItem, MemoryVectorStore, type Message, Milvus, type MilvusConfig, type MilvusMetricType, MistralLLM, MongoDB, type MongoDBConfig, type MultiModalMessages, NeptuneAnalyticsVectorStore, OllamaEmbedder, OllamaLLM, OpenAIEmbedder, OpenAILLM, OpenAIStructuredLLM, OpenSearchDB, OracleAIVectorSearch, PGVector, PineconeDB, Qdrant, RedisDB, type RerankResult, type Reranker, type RerankerConfig, RerankerFactory, S3Vectors, type SearchFilters, type SearchMemoryOptions, type SearchResult, SupabaseDB, TogetherEmbedder, TurbopufferDB, type UpdateMemoryOptions, type UpdateProjectOptions, UpstashVector, type ValkeyConfig, ValkeyDB, type VectorStore, type VectorStoreConfig, VectorStoreFactory, type VectorStoreResult, VectorizeDB, type VertexAIConfig, VertexAIEmbedder, VertexAIVectorSearch, VllmLLM, WeaviateDB, ZeroEntropyReranker, buildFilterConditions, buildFilterGroup, buildRedisFilterExpr, buildWhereClause, extractProvider, quoteIdentifier };