import { type EmbeddingProvider, type VectorDocument, type VectorSearchOptions, type VectorSearchResult, type VectorStore } from '../hallucination/retrieval.js'; /** Options for the Qdrant store. */ export interface QdrantVectorStoreOptions { /** The Qdrant server, such as `http://localhost:6333` or a Qdrant Cloud cluster URL. */ url: string; /** The collection chunks are kept in. */ collection: string; /** Width of every vector. Must match the embedding function's output. */ dimensions: number; /** Sent as the `api-key` header, for Qdrant Cloud or a secured server. */ apiKey?: string; /** Embeds chunks that arrive without a vector, and search queries. Defaults to hashed term vectors. */ embed?: EmbeddingProvider; /** Replaces the global `fetch`, for a proxy, retries, or tests. */ fetch?: typeof globalThis.fetch; /** Headers added to every request. */ headers?: Record; /** Aborts a request that takes longer, in milliseconds. Defaults to 30 seconds. */ timeoutMs?: number; } /** Raised when Qdrant answers with an error. */ export declare class QdrantError extends Error { /** The HTTP status Qdrant answered with. */ readonly status: number; /** Qdrant's response body, as text. */ readonly body?: string | undefined; constructor(message: string, /** The HTTP status Qdrant answered with. */ status: number, /** Qdrant's response body, as text. */ body?: string | undefined); } /** * Retrieval chunks in a Qdrant collection, through its REST API. * * No Qdrant client is a dependency: the store speaks HTTP through `fetch`, so it runs wherever * `fetch` and Web Crypto do, edge runtimes included. The same contract as `MemoryVectorStore`, * checked by the same tests. Qdrant point ids must be UUIDs or integers, so each chunk id is mapped * to a stable UUID derived from it, and the original id travels in the payload. */ export declare class QdrantVectorStore implements VectorStore { private readonly options; private readonly base; private readonly embed; private readonly fetchImpl; constructor(options: QdrantVectorStoreOptions); /** * Creates the collection with cosine distance unless it already exists, then indexes the * `metadata` fields you filter on. A list indexes them as keywords; a map names each field's type. * Never runs implicitly. */ migrate(options?: { filterFields?: readonly string[] | Record; }): Promise; /** Adds chunks, or replaces those whose id exists, embedding those without a vector in one batch. */ add(documents: VectorDocument[]): Promise; /** The chunks most similar to a query, best first. */ search(query: string, options?: VectorSearchOptions): Promise; /** The chunks most similar to a vector, best first. */ searchVector(vector: number[], options?: VectorSearchOptions): Promise; /** Removes chunks by id. */ delete(ids: readonly string[]): Promise; private assertWidth; private request; }