import { MastraVector } from '@mastra/core/vector';
import type { IndexStats, QueryResult, QueryVectorParams, CreateIndexParams, UpsertVectorParams, DescribeIndexParams, DeleteIndexParams, DeleteVectorParams, UpdateVectorParams, DeleteVectorsParams } from '@mastra/core/vector';
import type { LibSQLVectorFilter } from './filter.js';
interface LibSQLQueryVectorParams extends QueryVectorParams<LibSQLVectorFilter> {
    minScore?: number;
}
export interface LibSQLVectorConfig {
    /**
     * The URL of the LibSQL database.
     * Examples: 'file:./dev.db', 'file::memory:', 'libsql://your-db.turso.io'
     */
    url: string;
    authToken?: string;
    syncUrl?: string;
    syncInterval?: number;
    /**
     * Maximum number of retries for write operations if an SQLITE_BUSY error occurs.
     * @default 5
     */
    maxRetries?: number;
    /**
     * Initial backoff time in milliseconds for retrying write operations on SQLITE_BUSY.
     * The backoff time will double with each retry (exponential backoff).
     * @default 100
     */
    initialBackoffMs?: number;
    /**
     * Over-fetch multiplier for vector_top_k queries when metadata filters are present.
     * Since vector_top_k doesn't support inline WHERE clauses, we fetch topK * this multiplier
     * candidates and post-filter. Higher values improve recall at the cost of more data scanned.
     * @default 10
     */
    vectorTopKOverFetchMultiplier?: number;
}
export declare class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
    private turso;
    private readonly maxRetries;
    private readonly initialBackoffMs;
    private readonly overFetchMultiplier;
    private readonly isMemoryDb;
    private vectorIndexes;
    constructor({ url, authToken, syncUrl, syncInterval, maxRetries, initialBackoffMs, vectorTopKOverFetchMultiplier, id, }: LibSQLVectorConfig & {
        id: string;
    });
    private discoverVectorIndexes;
    private executeWriteOperationWithRetry;
    transformFilter(filter?: LibSQLVectorFilter): LibSQLVectorFilter;
    private hasVectorIndex;
    private queryWithIndex;
    query({ indexName, queryVector, topK, filter, includeVector, minScore, }: LibSQLQueryVectorParams): Promise<QueryResult[]>;
    upsert(args: UpsertVectorParams): Promise<string[]>;
    private doUpsert;
    createIndex(args: CreateIndexParams): Promise<void>;
    private doCreateIndex;
    deleteIndex(args: DeleteIndexParams): Promise<void>;
    private doDeleteIndex;
    listIndexes(): Promise<string[]>;
    /**
     * Retrieves statistics about a vector index.
     *
     * @param {string} indexName - The name of the index to describe
     * @returns A promise that resolves to the index statistics including dimension, count and metric
     */
    describeIndex({ indexName }: DescribeIndexParams): Promise<IndexStats>;
    /**
     * Updates a vector by its ID with the provided vector and/or metadata.
     *
     * @param indexName - The name of the index containing the vector.
     * @param id - The ID of the vector to update.
     * @param update - An object containing the vector and/or metadata to update.
     * @param update.vector - An optional array of numbers representing the new vector.
     * @param update.metadata - An optional record containing the new metadata.
     * @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(args: UpdateVectorParams<LibSQLVectorFilter>): Promise<void>;
    private doUpdateVector;
    /**
     * Deletes a vector by its ID.
     * @param indexName - The name of the index 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(args: DeleteVectorParams): Promise<void>;
    private doDeleteVector;
    deleteVectors(args: DeleteVectorsParams<LibSQLVectorFilter>): Promise<void>;
    private doDeleteVectors;
    truncateIndex(args: DeleteIndexParams): Promise<void>;
    private _doTruncateIndex;
}
export {};
//# sourceMappingURL=index.d.ts.map