What happened / 发生了什么
新版将知识库注入改成了user消息导致定时任务触发时知识库注入相关内容被当做了刚刚的实时对话信息,可能也有可能有mne的milvus被并入的原因。日志里只能看到定时任务那里会固定触发五条内容注入,但是看不到具体内容。但是bot接下来的定时小结还有反馈让我估计是这一点的原因。解决方法可能要自定义定时任务触发时注不注入内容以及自定义注入内容时不要采取user注入加一个保持系统注入或者原本的注入方式。(如果有人能告诉我我判断错误了,或者不是知识库的问题是milvus记忆库的问题也行,也非常感谢,这是我目前的判断orz)
bot回复:我现在回顾对话记录——你确实问了"xxxx(有点隐私就匿了)",但这个问题是在02:58到03:10之间问的,不是在"zzzzz"之后问的。而且"zzzzz"这个问题,我在对话记录里没有找到你问过。
这个时间点完全对的上定时任务(因为我设置的是整点)
Reproduce / 如何复现?
设置定时任务,时间到了会看见注入x条知识库内容
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
docker部署 4.26.0 aiocqhttp
OS
Linux
Logs / 报错日志
[2026-06-25 19:14:26.421] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> input_state_by_napcat - after_message_sent
[2026-06-25 19:14:26.421] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-06-25 19:14:26.508] [Plug] [DBUG] [astrbot_plugin_chat_archive.db_config:203]: SQLiteDatabase connection closed and released to pool.
[2026-06-25 19:14:26.525] [Core] [DBUG] [pipeline.scheduler:93]: pipeline execution completed.
[2026-06-25 20:00:00.207] [Core] [DBUG] [tools.knowledge_base_tools:57]: [知识库] 使用会话级配置,知识库数量: 3
[2026-06-25 20:00:00.207] [Core] [DBUG] [tools.knowledge_base_tools:72]: [知识库] 开始检索知识库,数量: 3, top_k=5
[2026-06-25 20:00:00.933] [Core] [DBUG] [retrieval.manager:120]: Dense retrieval across 3 bases took 0.73s and returned 79 results.
[2026-06-25 20:00:00.946] [Core] [DBUG] [retrieval.manager:132]: Sparse retrieval across 3 bases took 0.01s and returned 36 results.
[2026-06-25 20:00:00.946] [Core] [DBUG] [retrieval.manager:144]: Rank fusion took 0.00s and returned 60 results.
[2026-06-25 20:00:00.965] [Core] [DBUG] [tools.knowledge_base_tools:85]: [知识库] 为会话 Dani:FriendMessage:3151469879 注入了 5 条相关知识块
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.tool_loop_agent_runner:616]: [BefCompact] messages -> [2] system,user
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.tool_loop_agent_runner:616]: [AftCompact] messages -> [2] system,user
[2026-06-25 20:10:06.534] [Core] [DBUG] [sources.openai_source:524]: completion: ChatCompletion(id='msg_01Qp6nrgzT9zdUYWCpoUu8pr', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='内部确认核心记忆\n\naaaaaaaa(aaa是匿掉的个人信息)回顾最近的对话状态*\n\n现在是04:00,距离上次对话(03:14)过了46分钟。\n\n从02:58到03:14的对话中:\n\n1. 小千问了她的"问题":zzzzz?"(这个问题我在上次触发后的对话中看到了完整内容)
注意这里的zzzzz问题并不是在对话里出现的内容 所以应该是被注入的内容被当做了对话内容,因为我问的是xxxx,而且bot其实有说,自己察觉“(这个问题我在上次触发后的对话中看到了完整内容)”
Are you willing to submit a PR? / 你愿意提交 PR 吗?
Code of Conduct
What happened / 发生了什么
新版将知识库注入改成了user消息导致定时任务触发时知识库注入相关内容被当做了刚刚的实时对话信息,可能也有可能有mne的milvus被并入的原因。日志里只能看到定时任务那里会固定触发五条内容注入,但是看不到具体内容。但是bot接下来的定时小结还有反馈让我估计是这一点的原因。解决方法可能要自定义定时任务触发时注不注入内容以及自定义注入内容时不要采取user注入加一个保持系统注入或者原本的注入方式。(如果有人能告诉我我判断错误了,或者不是知识库的问题是milvus记忆库的问题也行,也非常感谢,这是我目前的判断orz)
bot回复:我现在回顾对话记录——你确实问了"xxxx(有点隐私就匿了)",但这个问题是在02:58到03:10之间问的,不是在"zzzzz"之后问的。而且"zzzzz"这个问题,我在对话记录里没有找到你问过。
这个时间点完全对的上定时任务(因为我设置的是整点)
Reproduce / 如何复现?
设置定时任务,时间到了会看见注入x条知识库内容
AstrBot version, deployment method (e.g., Windows Docker Desktop deployment), provider used, and messaging platform used. / AstrBot 版本、部署方式(如 Windows Docker Desktop 部署)、使用的提供商、使用的消息平台适配器
docker部署 4.26.0 aiocqhttp
OS
Linux
Logs / 报错日志
[2026-06-25 19:14:26.421] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> input_state_by_napcat - after_message_sent
[2026-06-25 19:14:26.421] [Core] [DBUG] [pipeline.context_utils:95]: hook(OnAfterMessageSentEvent) -> astrbot - after_message_sent
[2026-06-25 19:14:26.508] [Plug] [DBUG] [astrbot_plugin_chat_archive.db_config:203]: SQLiteDatabase connection closed and released to pool.
[2026-06-25 19:14:26.525] [Core] [DBUG] [pipeline.scheduler:93]: pipeline execution completed.
[2026-06-25 20:00:00.207] [Core] [DBUG] [tools.knowledge_base_tools:57]: [知识库] 使用会话级配置,知识库数量: 3
[2026-06-25 20:00:00.207] [Core] [DBUG] [tools.knowledge_base_tools:72]: [知识库] 开始检索知识库,数量: 3, top_k=5
[2026-06-25 20:00:00.933] [Core] [DBUG] [retrieval.manager:120]: Dense retrieval across 3 bases took 0.73s and returned 79 results.
[2026-06-25 20:00:00.946] [Core] [DBUG] [retrieval.manager:132]: Sparse retrieval across 3 bases took 0.01s and returned 36 results.
[2026-06-25 20:00:00.946] [Core] [DBUG] [retrieval.manager:144]: Rank fusion took 0.00s and returned 60 results.
[2026-06-25 20:00:00.965] [Core] [DBUG] [tools.knowledge_base_tools:85]: [知识库] 为会话 Dani:FriendMessage:3151469879 注入了 5 条相关知识块
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.base:64]: Agent state transition: AgentState.IDLE -> AgentState.RUNNING
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.tool_loop_agent_runner:616]: [BefCompact] messages -> [2] system,user
[2026-06-25 20:00:00.967] [Core] [DBUG] [runners.tool_loop_agent_runner:616]: [AftCompact] messages -> [2] system,user
[2026-06-25 20:10:06.534] [Core] [DBUG] [sources.openai_source:524]: completion: ChatCompletion(id='msg_01Qp6nrgzT9zdUYWCpoUu8pr', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='内部确认核心记忆\n\naaaaaaaa(aaa是匿掉的个人信息)回顾最近的对话状态*\n\n现在是04:00,距离上次对话(03:14)过了46分钟。\n\n从02:58到03:14的对话中:\n\n1. 小千问了她的"问题":zzzzz?"(这个问题我在上次触发后的对话中看到了完整内容)
注意这里的zzzzz问题并不是在对话里出现的内容 所以应该是被注入的内容被当做了对话内容,因为我问的是xxxx,而且bot其实有说,自己察觉“(这个问题我在上次触发后的对话中看到了完整内容)”
Are you willing to submit a PR? / 你愿意提交 PR 吗?
Code of Conduct