/** * Document-memory search — pure-TS chunked TF scoring (no native deps). * * Chunks of ~1600 chars with 320 overlap; term-frequency scoring reusing * the session-search tokenizer; TEMPORAL DECAY applies ONLY to session-log * chunks (half-life 7 days) — curated global/workspace/trading files are * long-term knowledge and never decay. Old session hits carry a staleness * note so the model verifies before trusting. An mtime-keyed cache keeps * re-index cost at zero for unchanged files. */ import { type MemoryFileRef } from './store.js'; export declare const CHUNK_CHARS = 1600; export declare const CHUNK_OVERLAP = 320; export declare const SESSION_HALF_LIFE_DAYS = 7; export interface MemoryHit { file: string; scope: MemoryFileRef['scope']; snippet: string; score: number; /** Present on old session hits — surfaced verbatim to the model. */ stalenessNote?: string; } export declare function resetMemoryIndexCache(): void; export declare function searchMemory(query: string, workDir: string, opts?: { limit?: number; minScore?: number; }): MemoryHit[]; /** Compact context block for prompt injection; ~1.5k-token budget. */ export declare function formatMemoryContext(hits: MemoryHit[], budgetChars?: number): string;