智能与内容增强配置
本页逐项说明画像、学习、知识、笔记、关系、连续性和 Agent 工具配置。这些功能在基础记忆链之上提供附加能力,适合在核心写入和召回稳定后按需启用。
涉及自动写入、Agent 写工具或在线学习的配置会改变数据或策略状态。启用前应先确认权限边界、最小置信度和每日上限,避免把低质量推断长期固化。
用户画像
配置域:"user_profile"。为每个用户构建动态画像(标签+偏好),驱动个性化记忆检索
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"user_profile.enabled" | "bool" | true | - | 启用用户画像 开启后自动从对话中提取用户标签与偏好,并用于个性化记忆排序。 |
"user_profile.boost_strength" | "float" | 0.15 | - | 个性化加权强度 用户标签匹配时的检索得分加成比例。建议 0.1-0.2。 |
"user_profile.tag_decay_rate" | "float" | 0.98 | - | 标签衰减率 每日标签置信度的指数衰减系数。0.98 表示每天降低 2%。值越小标签遗忘越快。 |
"user_profile.min_tag_confidence" | "float" | 0.1 | - | 标签最低置信度 置信度低于此值的标签将被自动清理。0.1 表示只保留有足够证据的标签。 |
自主学习
配置域:"auto_learning"。从统一可信反馈聚合生成 shadow 参数候选,人工确认后按 revision CAS 发布;不自动修改生产配置。
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"auto_learning.enabled" | "bool" | false | - | 启用自主学习 shadow 候选 开启后从统一反馈聚合生成参数候选并等待人工 CAS 发布,不自动修改生产配置。 |
知识库
配置域:"knowledge_base"。结构化知识存储与查询,从记忆原子中提炼长期知识
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"knowledge_base.enabled" | "bool" | true | - | 启用知识库 开启后自动从重要记忆中提取结构化知识条目。 |
"knowledge_base.dedup_threshold" | "float" | 0.85 | - | 去重 Jaccard 阈值 新知识与已有知识的文本相似度超过该值时触发合并。建议 0.75-0.90。 |
"knowledge_base.expire_days" | "int" | 365 | - | 知识过期天数 超过该天数的知识条目将被自动清理。0 表示永不过期。 |
自主笔记
配置域:"notes"。支持自主创建、修改、读取和索引笔记,提供 Agent 工具接口
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"notes.enabled" | "bool" | true | - | 启用笔记系统 开启后插件可自主管理笔记,支持全文搜索和版本历史。 |
"notes.auto_create_min_length" | "int" | 50 | - | 自动创建最低长度 对话文本达到该字符数时才触发自动笔记生成。建议 50-200。 |
"notes.max_tags" | "int" | 10 | - | 笔记最大标签数 自动生成笔记标签的数量上限。 |
"notes.max_versions" | "int" | 20 | - | 每条笔记最多保留的历史版本数。超过上限时淘汰最旧版本,用于限制编辑历史占用的存储空间;调低前先确认不再需要长期回溯。 |
异常检测
配置域:"anomaly_detection"。每日按 UTC 日聚合 SQLite canonical 创建量,与滚动窗口均值/标准差比较;超阈值时写入脱敏诊断事件并在健康页显示最近状态与 reason code。
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"anomaly_detection.enabled" | "bool" | true | - | 启用异常检测 开启后每日统计记忆创建量,与 7 日滚动窗口对比,超 3-sigma 时记录告警。 |
"anomaly_detection.window_days" | "int" | 7 | - | 滚动窗口天数 计算基线均值与标准差所用的历史天数。 |
"anomaly_detection.sigma_threshold" | "float" | 3 | - | Sigma 告警阈值 当日创建量偏离均值超过 sigma 倍标准差时触发告警。3.0 为标准 3-sigma。 |
对话连续性追踪
配置域:"continuity_tracking"。只从通过质量门并成功写入 canonical 的 topics 追踪同 session 未完成话题;启动时恢复未过期状态,召回结果仅进入受预算与保护的临时请求上下文。关闭后不读取、不写入、不注入。
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"continuity_tracking.enabled" | "bool" | true | - | 启用连续性追踪 开启后标记未完成话题并在下次对话时优先注入上下文。 |
"continuity_tracking.topic_ttl_days" | "int" | 7 | - | 话题存活天数 未完成话题的最大保留时间。超过后自动清理不再注入。 |
"continuity_tracking.max_pending_topics" | "int" | 10 | - | 最大待处理话题数 同时追踪的未完成话题数量上限。超出后最旧的将被移除。 |
Agent 工具
配置域:"agent_tools"。控制注册到 AstrBot Agent 的 LLM 工具
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"agent_tools.enable_recall_tool" | "bool" | true | - | 启用记忆召回工具 向 Agent 注册 memory_search 工具。 |
"agent_tools.enable_memorize_tool" | "bool" | false | - | 启用记忆写入工具 向 Agent 注册 memory_memorize 工具。谨慎开启。 |
"agent_tools.enable_note_tools" | "bool" | null | - | 启用笔记工具(旧版兼容) 旧版总开关;新配置请使用 enable_note_read_tools 与 enable_note_write_tool。 |
"agent_tools.enable_note_read_tools" | "bool" | true | - | 启用笔记读取工具 向 Agent 注册 note_search 与 note_read 工具。 |
"agent_tools.enable_note_write_tool" | "bool" | false | - | 启用笔记写入工具 向 Agent 注册 note_write 工具。默认关闭,建议仅在可信场景下开启。 |
"agent_tools.enable_knowledge_tools" | "bool" | true | - | 启用知识库工具 向 Agent 注册 knowledge_search/read 工具。 |
"agent_tools.enable_profile_tools" | "bool" | true | - | 启用用户画像工具 向 Agent 注册 profile_lookup 工具。 |
"agent_tools.enable_jargon_tools" | "bool" | true | - | 启用黑话查询工具 向 Agent 注册 jargon_explain/list 工具。self_learning 伴侣插件活跃时可能委托并跳过本地注册。 |
"agent_tools.enable_affection_tools" | "bool" | true | - | 启用好感度工具 向 Agent 注册 affection_check/bot_mood 工具。self_learning 伴侣插件活跃时可能委托并跳过本地注册。 |
"agent_tools.enable_social_tools" | "bool" | true | - | 启用社交关系工具 向 Agent 注册 relation_lookup/graph 工具。self_learning 伴侣插件活跃时可能委托并跳过本地注册。 |
"agent_tools.enable_expression_tools" | "bool" | true | - | 启用表达模式工具 向 Agent 注册 expression_recall 工具。self_learning 伴侣插件活跃时可能委托并跳过本地注册。 |
黑话发现
配置域:"jargon"。控制群消息统计与 LLM 黑话推断;关闭后保留已有词条数据,但不再收集候选或调用 LLM。
| 配置项 | 类型 | 默认值 | 选项与范围 | 说明 |
|---|---|---|---|---|
"jargon.enabled" | "bool" | false | - | 启用黑话自动发现 默认关闭。开启后会统计群消息候选词,并在达到渐进阈值时调用 LLM 推断。修改后需重载插件生效。 |
返回配置参考总览。
