feat: 采用三层内存系统实现统一内存管理器

- 添加了UnifiedMemoryManager,以整合感知层、短期记忆层和长期记忆层。
- 实现了初始化、消息添加和内存搜索功能。
- 引入了记忆从短期存储到长期存储的自动转移机制。
- 开发了用于结构化内存表示的内存格式化工具。
- 增强日志记录功能,以便在内存操作过程中更好地进行追踪。
This commit is contained in:
Windpicker-owo
2025-11-18 16:17:25 +08:00
parent e44f238e53
commit 5798d11066
19 changed files with 1544 additions and 1686 deletions

View File

@@ -249,7 +249,7 @@ class MainSystem:
# 停止增强记忆系统
# 停止三层记忆系统
try:
from src.memory_graph.three_tier.manager_singleton import get_unified_memory_manager, shutdown_unified_memory_manager
from src.memory_graph.manager_singleton import get_unified_memory_manager, shutdown_unified_memory_manager
if get_unified_memory_manager():
cleanup_tasks.append(("三层记忆系统", shutdown_unified_memory_manager()))
@@ -480,7 +480,7 @@ MoFox_Bot(第三方修改版)
# 初始化三层记忆系统(如果启用)
try:
if global_config.three_tier_memory and global_config.three_tier_memory.enable:
from src.memory_graph.three_tier.manager_singleton import initialize_unified_memory_manager
from src.memory_graph.manager_singleton import initialize_unified_memory_manager
logger.info("三层记忆系统已启用,正在初始化...")
await initialize_unified_memory_manager()
logger.info("三层记忆系统初始化成功")