enabled
插件本体和 config 都要开,才有机会运行。
Concepts 导读
Active Memory 是一个在主回复之前自动检索相关记忆的插件,解决“记忆系统只能被动等待调用”的问题。先按“Paste This Into Your Agent”里的 JSON 配置启用,注意只对 direct 会话生效,且默认复用当前会话模型;想提速就单独配一个 Cerebras 等低延迟模型,但务必确认 API Key 有 chat/completions 权限。
先讲这一页到底在解决什么
Active Memory 是一个在主回复之前自动检索相关记忆的插件,解决“记忆系统只能被动等待调用”的问题。先按“Paste This Into Your Agent”里的 JSON 配置启用,注意只对 direct 会话生效,且默认复用当前会话模型;想提速就单独配一个 Cerebras 等低延迟模型,但务必确认 API Key 有 chat/completions 权限。
第一站
Active Memory 的工作很克制:先根据当前对话做一次记忆查询,找到就把摘要塞进隐藏上下文,找不到就不打扰主回复。
User Message
→ Build Memory Query
→ Active Memory blocking memory sub-agent
→ NONE 或 relevant summary
→ Main Reply
它不是循环查很久,而是在回复前给记忆系统一次有限尝试。
blocking memory sub-agent 只用 memory_search 和 memory_get,工具面很窄。
正常客户端不会显示原始 <active_memory_plugin> 标签,只会影响模型输入。
适合长期偏好、反复出现的习惯、需要连续性的用户上下文;不适合一次性 API 任务和后台自动化。
第二站
第一次配置时,最好小范围打开。先让 main agent 在 direct 会话里试跑,日志开着,调稳后再扩大。
{
plugins: {
entries: {
"active-memory": {
enabled: true,
config: {
enabled: true,
agents: ["main"],
allowedChatTypes: ["direct"],
modelFallback: "google/gemini-3-flash",
queryMode: "recent",
promptStyle: "balanced",
timeoutMs: 15000,
maxSummaryChars: 220,
persistTranscripts: false,
logging: true,
},
},
},
},
}
enabled插件本体和 config 都要开,才有机会运行。
agents只让指定 agent 使用,避免所有 agent 一起翻记忆。
allowedChatTypes默认 direct 最稳;group、channel 要明确 opt in。
timeoutMs它跑在回复路径里,超时要克制,否则用户会等很久。
第三站
很多“为什么没跑”的问题,其实都是没过门槛。配置门和运行时门缺一个,它都会安静跳过。
插件启用,当前 agent id 在 config.agents 里,聊天类型在 allowedChatTypes 里。
会话必须是交互式、持久的聊天会话;headless one-shot、heartbeat、内部 helper execution 都不跑。
plugin enabled
+ agent id targeted
+ allowed chat type
+ eligible interactive persistent chat session
= active memory runs
/active-memory off、on、status 只影响当前会话;带 --global 才写全局 config。
第四站
queryMode 和 promptStyle 决定“翻多少、翻多积极”一个管给记忆 sub-agent 看多少对话,一个管它多愿意返回记忆。
message只看最新用户消息,最快,适合偏稳定偏好的召回。
recent看最新消息加一点最近对话,速度和上下文比较均衡。
full看完整对话,最重,只有真的需要远处上下文时再用。
promptStylestrict 更保守,contextual 更重连续性,preference-only 更偏长期喜好。
第五站
官方给了很明确的调试路线:开 verbose、开 trace、看 gateway log,再用 memory status 深查。
/verbose on
/trace on
what should I order?
/verbose on能看到类似 Active Memory: status=ok elapsed=842ms 的状态线。
/trace on能看到给人读的 Active Memory debug summary,帮助你判断召回是否合理。
memory status --deep如果召回慢、空、报 provider 错,先检查 memory-search 后端和索引健康。
如果你依赖 embedding 召回,建议显式 pin agents.defaults.memorySearch.provider,不要让环境里“刚好可用”的 provider 随机改变结果。
最后总结
Active Memory 是一个可选的回复前记忆召回插件:只在符合条件的持久聊天里运行,找到有用记忆就加进隐藏上下文,找不到就安静让主回复继续。