import { MemoryFile, TopicScore } from './types.js';

/**
 * Topic Extraction (Phase 4B)
 *
 * Extract key topics from all memories using TF-IDF weighting.
 * Runs as a batch process during consolidation.
 */

/**
 * Calculate TF-IDF scores for terms across all memories.
 *
 * TF (term frequency) = count of term in document / total terms in document
 * IDF (inverse document frequency) = log(total documents / documents containing term)
 * TF-IDF = TF * IDF
 *
 * Terms with high TF-IDF are frequent in specific memories but rare overall.
 */
declare function extractTopics(memories: MemoryFile[], topN?: number): TopicScore[];
/**
 * Compare two topic lists to find trending changes.
 * Returns topics that are new or significantly increased.
 */
declare function findTrendingTopics(currentTopics: TopicScore[], previousTopics: TopicScore[], threshold?: number): {
    rising: TopicScore[];
    falling: TopicScore[];
};

export { extractTopics, findTrendingTopics };
