import type Database from 'better-sqlite3';
import { Memory, MemoryCategory, MemoryConfig, SearchResult } from './types.js';
export interface SearchExecutionOptions {
    enableSideEffects: boolean;
    includeExplanation: boolean;
}
export interface SearchScoringContext {
    db: Database.Database;
    config: MemoryConfig;
    detectedCategory: MemoryCategory | null;
    queryTags: string[];
    vectorResults: Map<number, number>;
    query: string;
}
export interface SearchScoreValues {
    ftsScore: number;
    vectorSimilarity: number;
    vectorBoost: number;
    decayedScore: number;
    priorityBoost: number;
    recencyBoost: number;
    categoryBoost: number;
    linkBoost: number;
    tagBoost: number;
    activationBoost: number;
    contradictionPenalty: number;
    finalScore: number;
}
export declare function detectQueryCategory(query: string): MemoryCategory | null;
export declare function calculateLinkBoost(memoryId: number, db: Database.Database): number;
export declare function calculateTagScore(queryTags: string[], memoryTags: string[]): number;
export declare function extractQueryTags(query: string): string[];
/**
 * Decode a persisted `memories.embedding` BLOB into a Float32Array view.
 *
 * The embedding column is written as the raw little-endian bytes of a 384-dim
 * Float32Array (addMemory: `Buffer.from(embedding.buffer)`). better-sqlite3 hands
 * it back as a Node Buffer; this returns a zero-copy Float32Array view over those
 * bytes. Shared by `vectorSearch` and the recall reuse path (`findSimilarMemories`)
 * so the BLOB→vector decode lives in exactly one place.
 */
export declare function decodeEmbeddingBlob(buf: Buffer): Float32Array;
/**
 * Score embedded memories against a query embedding and return the top-k by
 * cosine similarity. Selects ONLY `id, embedding` and returns lean
 * `{ id, similarity }` pairs — the sole caller (search-recall) needs nothing
 * more, so per-row Memory hydration (rowToMemory: 2 JSON parses + several
 * `new Date()` per row) is deferred to whoever actually loads the survivors.
 */
export declare function vectorSearch(db: Database.Database, queryEmbedding: Float32Array, limit: number, project?: string, includeGlobal?: boolean): Array<{
    id: number;
    similarity: number;
}>;
export declare function buildSearchExplanation(memory: Memory, context: SearchScoringContext, values: SearchScoreValues): SearchResult['explanation'];
