lorehub
Version:
Capture and surface the collective wisdom of your codebase
41 lines • 1.19 kB
TypeScript
import type { Lore } from './types.js';
export declare class SearchCache {
private embeddingCache;
private resultsCache;
private readonly EMBEDDING_TTL;
private readonly RESULTS_TTL;
private readonly MAX_EMBEDDING_ENTRIES;
private readonly MAX_RESULTS_ENTRIES;
getEmbedding(query: string): Float32Array | null;
setEmbedding(query: string, embedding: Float32Array): void;
getResults(query: string, options: {
realmId?: string;
threshold?: number;
limit?: number;
}): (Lore & {
similarity?: number;
})[] | null;
setResults(query: string, options: {
realmId?: string;
threshold?: number;
limit?: number;
}, results: (Lore & {
similarity?: number;
})[]): void;
clear(): void;
clearExpired(): void;
getCacheStats(): {
embeddings: {
size: number;
maxSize: number;
};
results: {
size: number;
maxSize: number;
};
};
private generateResultsKey;
private findOldestEntry;
}
export declare function getSearchCache(): SearchCache;
//# sourceMappingURL=search-cache.d.ts.map