/** * Turbopuffer SearchIndex implementation. * * Adapts the Turbopuffer vector database to the kernl SearchIndex interface. * Turbopuffer uses "namespaces" as the equivalent of our "indexes". * * @see https://turbopuffer.com/docs */ import type { SearchIndex, IndexHandle, NewIndexParams, ListIndexesParams, IndexSummary, IndexStats, UnknownDocument, SearchCapabilities } from "@kernl-sdk/retrieval"; import { CursorPage } from "@kernl-sdk/shared"; import { TurbopufferConfig } from "./types.js"; /** * Turbopuffer search index adapter. * * Implements the kernl SearchIndex interface backed by Turbopuffer's * vector database. Supports vector search, full-text search (BM25), * and hybrid queries. * * @example * ```ts * const tpuf = turbopuffer({ * apiKey: "your-api-key", * region: "us-east-1", * }); * * const docs = tpuf.index("my-index"); * * await docs.upsert({ * id: "doc-1", * text: "Hello world", * vector: [0.1, 0.2, ...], * }); * * const hits = await docs.query({ * query: [{ vector: [0.1, 0.2, ...] }], * limit: 10, * }); * ``` */ export declare class TurbopufferSearchIndex implements SearchIndex { readonly id = "turbopuffer"; private readonly client; /** * Create a new Turbopuffer search index. */ constructor(config: TurbopufferConfig); /** * Create a new index (namespace) in Turbopuffer. */ createIndex(params: NewIndexParams): Promise; /** * List indexes (namespaces) with optional pagination and prefix filtering. */ listIndexes(params?: ListIndexesParams): Promise>; /** * Get metadata and statistics about an index (namespace). */ describeIndex(id: string): Promise; /** * Delete an index (namespace) and all its documents. */ deleteIndex(id: string): Promise; /** * Get a handle for operating on a specific index. */ index(id: string): IndexHandle; /** * Bind an existing resource as an index. * * Not supported by Turbopuffer - indexes are created implicitly. */ bindIndex(_id: string, _config: unknown): Promise; /** * Warm/preload an index for faster queries. */ warm(id: string): Promise; /** * Turbopuffer capabilities. * * Note: Turbopuffer supports text (BM25) and vector (ANN) separately, * but not hybrid fusion (text + vector in the same query). */ capabilities(): SearchCapabilities; } //# sourceMappingURL=search.d.ts.map