feat(chat): 优化记忆检索逻辑,异步调用增强记忆系统
This commit is contained in:
@@ -471,6 +471,13 @@ class DefaultReplyer:
|
||||
# 使用新的增强记忆系统
|
||||
from src.chat.memory_system.enhanced_memory_integration import recall_memories, remember_message
|
||||
|
||||
# 检索相关记忆
|
||||
enhanced_memories = await recall_memories(
|
||||
query=target,
|
||||
user_id=str(self.chat_stream.stream_id),
|
||||
chat_id=self.chat_stream.stream_id
|
||||
)
|
||||
|
||||
# 异步存储聊天历史(非阻塞)
|
||||
asyncio.create_task(
|
||||
remember_message(
|
||||
@@ -479,12 +486,6 @@ class DefaultReplyer:
|
||||
chat_id=self.chat_stream.stream_id
|
||||
)
|
||||
)
|
||||
# 检索相关记忆
|
||||
enhanced_memories = await recall_memories(
|
||||
query=target,
|
||||
user_id=str(self.chat_stream.stream_id),
|
||||
chat_id=self.chat_stream.stream_id
|
||||
)
|
||||
|
||||
# 转换格式以兼容现有代码
|
||||
running_memories = []
|
||||
|
||||
Reference in New Issue
Block a user