feat:记忆系统再优化,现在及时构建,并且不会重复构建

This commit is contained in:
SengokuCola
2025-08-14 13:13:13 +08:00
parent 3bf476c610
commit bf7419c693
22 changed files with 210 additions and 1314 deletions

View File

@@ -141,20 +141,14 @@ class MainSystem:
if global_config.memory.enable_memory and self.hippocampus_manager:
tasks.extend(
[
self.build_memory_task(),
# 移除记忆构建的定期调用改为在heartFC_chat.py中调用
# self.build_memory_task(),
self.forget_memory_task(),
]
)
await asyncio.gather(*tasks)
async def build_memory_task(self):
"""记忆构建任务"""
while True:
await asyncio.sleep(global_config.memory.memory_build_interval)
logger.info("正在进行记忆构建")
await self.hippocampus_manager.build_memory() # type: ignore
async def forget_memory_task(self):
"""记忆遗忘任务"""
while True: