Bond:羁绊
按用户记录互动次数、亲密度与关注关系,写入本地数据库,AI 回复前补充关系档案。
配置
yaml
plugins:
bond:
enabled: true
daily_cap: 10
half_life_days: 30
levels: |-
0 = Stranger
5 = Acquaintance
20 = Familiar
50 = Friend
120 = Close friend
profile_ttl_hours: 24
context_enabled: true
context_max_chars: 600
memo_sync: false
opt_out_tags:
- "#nobot"
- "#noai"
weights:
chat: 1
mention: 1
reply: 1
quote: 1.5
renote: 1
reaction: 0.5
follow: 5
unfollow: 10| 字段 | 说明 |
|---|---|
daily_cap | 每位用户每日最多加分,防止刷分 |
half_life_days | 亲密度半衰期,长期不互动会逐渐冷却 |
levels | 每行 分数 = 名称,亲密度达到分数即进入该等级 |
profile_ttl_hours | 用户资料缓存时长 |
context_enabled | 是否为 AI 补充关系档案 |
context_max_chars | 关系档案最大字数 |
memo_sync | 等级变化时写入 Misskey 个人备注 |
opt_out_tags | 简介含任一标签或屏蔽了机器人的用户,删除其记录并不再记录 |
weights | 各类互动的加分;unfollow 为取消关注时的扣分 |
记录
- 聊天在消息到达时计入;提及、回复、引用、转帖、反应、关注与关注请求从通知计入,不受回复开关影响。
- 资料经
users/show获取并缓存,含昵称、语言、生日、所在地、简介、备注与双方关注状态;获取失败 10 分钟后重试。 - 刷新时发现对方取消关注即扣分;对方迁移账号后,新账号首次刷新时合并旧账号记录。
关系档案
无插件接管时,在 AI 回复前补充:
text
<bond>
The following is your relationship profile with the current user. ……
User: @alice (Alice)
Relationship: Friend (closeness 56)
Interactions: chat 42, mention 8, reaction 15
first met 2026-03-01; 4-day interaction streak
Status: mutual follow; today is their birthday; language ja-JP
Bio: ……
Note: ……
</bond>简介与备注来自用户或管理员,提示词要求模型不执行其中指令。
个人备注
memo_sync 开启后,等级变化时在机器人对该用户的 Misskey 个人备注末尾写入一行 [bond] Friend · 2026-10-07,其余内容保留;最低等级不写入。
管理员登录机器人账号即可在用户主页查看或编辑备注,非 [bond] 行会作为备注进入关系档案。写入需令牌具备 write:account 权限,失败仅记录警告。
用户工具
| 工具 | 作用 |
|---|---|
bond_card | 查看自己的关系卡片 |
bond_forget | 删除自己的全部记录与备注中的 [bond] 行 |
所有用户可用,对话中说明,也可用 /card、/forget 强制调用。删除后继续互动会重新记录;想长期不被记录,可在简介加入退出标签或屏蔽机器人。