feat(memory): 添加配置系统支持,移除旧memory配置
重大改进:
- 在 bot_config_template.toml 添加 [memory_graph] 配置段
- 移除旧的 [memory] 配置段(~85行)
- 更新 MemoryGraphConfig 支持从 bot_config 加载
- 更新 MemoryManager 使用配置参数
- 更新 manager_singleton 支持配置初始化
配置系统:
- enable: 启用/禁用记忆图系统
- data_dir: 数据存储目录
- 向量存储: collection_name, db_path
- 检索: top_k, min_importance, similarity_threshold
- 智能查询优化: enable_query_optimization
- 整合: enabled, interval_hours, similarity_threshold, time_window
- 遗忘: enabled, activation_threshold, min_importance
- 激活: decay_rate, propagation_strength, propagation_depth
- 性能: max_nodes_per_memory, max_related_memories
配置加载流程:
1. MemoryGraphConfig.from_bot_config(global_config)
2. 使用 getattr 安全获取配置值
3. 提供默认值作为后备
使用配置:
- MemoryManager 从 config 读取所有参数
- maintenance 使用 consolidation_* 参数
- auto_forget_memories 使用 forgetting_* 参数
- activate_memory 使用 activation_* 参数
向后兼容:
- [memory_legacy] 保留旧配置供参考
- [vector_db] 保留给其他系统使用
- 新系统使用独立 chromadb 实例
完成 Step 4: 添加配置支持