refactor: Replace knowledge graph with session clustering system

Remove legacy knowledge graph and evolution tracking features,
introduce new session clustering model for Core Memory.

Changes:
- Remove knowledge_graph, knowledge_graph_edges, evolution_history tables
- Add session_clusters, cluster_members, cluster_relations tables
- Add session_metadata_cache for metadata caching
- Add new interfaces: SessionCluster, ClusterMember, ClusterRelation, SessionMetadataCache
- Add CRUD methods for cluster management
- Add session metadata upsert and search methods
- Remove extractKnowledgeGraph, getKnowledgeGraph, trackEvolution methods
- Remove API routes for /knowledge-graph, /evolution, /graph
- Add database migration to clean up old tables
- Update generateClusterId() for CLST-* ID format

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-18 19:21:52 +08:00
parent 17af615fe2
commit 68f9de0c69
4 changed files with 419 additions and 365 deletions

View File

@@ -94,9 +94,6 @@ function executeImport(params: Params): ImportResult {
content: text.trim(),
});
// Extract knowledge graph
store.extractKnowledgeGraph(memory.id);
return {
operation: 'import',
id: memory.id,