/** * Embedding model registry helpers. * * Each search-index document carries an `embedding_model_id` field that * identifies which model produced its vector. The registry's job is to: * * 1. Validate at deployment startup that the configured embedding * provider's `dimensions` matches the configured `IndexerAdapter`'s * `vectorDimensions`. Mismatch → fail loudly. * 2. Track the active model id so search queries can scope vector * lookups to documents using a compatible model. During a model * migration window the index can hold mixed-model documents — old * ones get skipped on vector queries and re-embedded by the * `bulkReindex(forceReembed: true)` job. * * See `docs/architecture/catalog-architecture.md` for the design. */ import type { IndexerCapabilities } from "@voyant-travel/catalog-contracts/indexer/contract"; import type { EmbeddingProviderCapabilities } from "./contract.js"; /** * Validate that an embedding provider's capabilities are compatible with * the search engine's vector configuration. Call this at deployment * startup; throw if incompatible. */ export declare function validateEmbeddingCompatibility(providerCapabilities: EmbeddingProviderCapabilities, indexerCapabilities: IndexerCapabilities): void; /** * Returns true if a given document's `embedding_model_id` matches the * deployment's active model. Vector queries should filter to active-model * documents; non-matching documents fall through to keyword-only * scoring until `bulkReindex(forceReembed: true)` re-embeds them. */ export declare function isActiveEmbeddingModel(documentModelId: string | undefined, activeModelId: string): boolean; /** * Convenience: stamp an `IndexerDocument`'s `embedding_model_id` from a * provider's capabilities. Use this when constructing documents in the * embedding pipeline so the active model id propagates to the index. */ export declare function stampEmbeddingModelId(providerCapabilities: EmbeddingProviderCapabilities): { embedding_model_id: string; }; /** * Plan the embedding workload for a re-index pipeline. Given the current * document set (each row tagged with its embedding_model_id) and the * active model, returns lists of: * - `embedded` — already on the active model; no work * - `pending` — never embedded; needs first-time embedding * - `migrating` — embedded under an older model; needs re-embedding * * Drives the `bulkReindex(forceReembed: true)` migration UX. */ export interface EmbeddingMigrationPlan { embedded: string[]; pending: string[]; migrating: string[]; totalDocuments: number; activeModelId: string; } export declare function planEmbeddingMigration(documents: ReadonlyArray<{ id: string; embedding_model_id?: string | null; }>, activeModelId: string): EmbeddingMigrationPlan;