import { MastraVector } from '@mastra/core/vector'; import type { CreateIndexParams, DeleteIndexParams, DeleteVectorParams, DescribeIndexParams, IndexStats, QueryResult, DeleteVectorsParams, UpdateVectorParams } from '@mastra/core/vector'; import type { UpstashVectorFilter } from './filter.js'; import type { UpstashUpsertVectorParams, UpstashQueryVectorParams } from './types.js'; export declare class UpstashVector extends MastraVector { private client; /** * Creates a new UpstashVector instance. * @param {object} params - The parameters for the UpstashVector. * @param {string} params.id - The unique identifier for this vector store instance. * @param {string} params.url - The URL of the Upstash vector index. * @param {string} params.token - The token for the Upstash vector index. */ constructor({ url, token, id }: { url: string; token: string; } & { id: string; }); /** * Upserts vectors into the index. * @param {UpsertVectorParams} params - The parameters for the upsert operation. * @returns {Promise} A promise that resolves to the IDs of the upserted vectors. */ upsert({ indexName: namespace, vectors, metadata, ids, sparseVectors, }: UpstashUpsertVectorParams): Promise; /** * Transforms a Mastra vector filter into an Upstash-compatible filter string. * @param {UpstashVectorFilter} [filter] - The filter to transform. * @returns {string | undefined} The transformed filter string, or undefined if no filter is provided. */ transformFilter(filter?: UpstashVectorFilter): string | undefined; /** * Creates a new index. For Upstash, this is a no-op as indexes (known as namespaces in Upstash) are created on-the-fly. * @param {CreateIndexParams} _params - The parameters for creating the index (ignored). * @returns {Promise} A promise that resolves when the operation is complete. */ createIndex(_params: CreateIndexParams): Promise; /** * Queries the vector index. * @param {QueryVectorParams} params - The parameters for the query operation. indexName is the namespace in Upstash. * @returns {Promise} A promise that resolves to the query results. */ query({ indexName: namespace, queryVector, topK, filter, includeVector, sparseVector, fusionAlgorithm, queryMode, }: UpstashQueryVectorParams): Promise; /** * Lists all namespaces in the Upstash vector index, which correspond to indexes. * @returns {Promise} A promise that resolves to a list of index names. */ listIndexes(): Promise; /** * Retrieves statistics about a vector index. * * @param {string} indexName - The name of the namespace to describe * @returns A promise that resolves to the index statistics including dimension, count and metric */ describeIndex({ indexName: namespace }: DescribeIndexParams): Promise; /** * Deletes an index (namespace). * @param {DeleteIndexParams} params - The parameters for the delete operation. * @returns {Promise} A promise that resolves when the deletion is complete. */ deleteIndex({ indexName: namespace }: DeleteIndexParams): Promise; /** * Updates a vector by its ID or multiple vectors matching a filter. * @param params - Parameters containing the id or filter for targeting the vector(s) to update * @param params.indexName - The name of the namespace containing the vector. * @param params.id - The ID of the vector to update (mutually exclusive with filter). * @param params.filter - Filter to match multiple vectors to update (mutually exclusive with id). * @param params.update - An object containing the vector and/or metadata to update. * @returns A promise that resolves when the update is complete. * @throws Will throw an error if no updates are provided or if the update operation fails. */ updateVector(params: UpdateVectorParams): Promise; /** * Deletes a vector by its ID. * @param indexName - The name of the namespace containing the vector. * @param id - The ID of the vector to delete. * @returns A promise that resolves when the deletion is complete. * @throws Will throw an error if the deletion operation fails. */ deleteVector({ indexName: namespace, id }: DeleteVectorParams): Promise; /** * Deletes multiple vectors by IDs or filter. * @param indexName - The name of the namespace containing the vectors. * @param ids - Array of vector IDs to delete (mutually exclusive with filter). * @param filter - Filter to match vectors to delete (mutually exclusive with ids). * @returns A promise that resolves when the deletion is complete. * @throws Will throw an error if both ids and filter are provided, or if neither is provided. */ deleteVectors({ indexName: namespace, filter, ids }: DeleteVectorsParams): Promise; } //# sourceMappingURL=index.d.ts.map