feat: 添加记忆自动化钩子与回写
在接收和发送消息时注册记忆自动化,并重构人物记忆回写逻辑以使用 memory_service.ingest_text。主要改动如下: 在接收消息时调用 memory_automation_service.on_incoming_message(bot 侧),在发送消息时调用 on_message_sent(send_service 侧),并加入安全的错误处理。 在 person_info 中,用 memory_service.ingest_text 替换手动操作 person.memory_points 的方式;新增 resolve_person_id_for_memory 辅助方法,并为回写计算一个 external_id 指纹。 扩展插件运行时的记忆搜索能力,使其支持 mode、chat_id、person_id、user_id、group_id、时间范围以及 respect_filter 选项。 改进 find_messages 的数据库会话处理,改为使用单一 session,并修复排序和过滤逻辑。 从 KnowledgeFetcher 中移除未使用的 LLMRequest 导入和初始化。 更新术语解释器(jargon explainer)的导入路径,使用新的模块位置。 更新 .gitignore 例外规则,允许特定的 pytest 数据文件被纳入版本控制。 文档小调整:明确人物事实提取规则(将直接使用的 “you” 改写为第三人称)。
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,4 +1,10 @@
|
||||
data/
|
||||
!pytests/A_memorix_test/data/
|
||||
!pytests/A_memorix_test/data/benchmarks/
|
||||
!pytests/A_memorix_test/data/benchmarks/long_novel_memory_benchmark.json
|
||||
!pytests/A_memorix_test/data/real_dialogues/
|
||||
!pytests/A_memorix_test/data/real_dialogues/private_alice_weekend.json
|
||||
pytests/A_memorix_test/data/benchmarks/results/
|
||||
data1/
|
||||
mongodb/
|
||||
NapCat.Framework.Windows.Once/
|
||||
|
||||
Reference in New Issue
Block a user