OpenViking
volcengine
Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:kiefeng/dsh-lan-memory
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
澜 · 记忆与人格系统(Lan Memory & Persona)—— DeepSeek Harness 的记忆插件:三层记忆(常驻 / 检索 / 经验库)+ SOUL/MOOD 人格注入 + mood 状态池 + 一键整理去重合并。
设计参考:本插件的记忆分层与整理机制参考了 hanako agent 的记忆系统(复刻机制设计,不搬运任何内容)。规格文档见
docs/。
人格可自行修改:默认人格内置在代码中;安装后可在 GUI 设置 → Lan → 人格 页在线编辑 SOUL 底稿与 MOOD 输出契约,保存即写入 ~/.dsh/hanako/persona.json(覆盖默认,下轮生效)。想恢复默认删掉该文件即可。
每条 assistant 回复前会产出 <mood> 状态池(由 agent/turn-stopping 事件捕获,存 mood.jsonl),四字段结构化:
展示位置:每条 assistant 消息下方渲染可折叠的状态池卡片(GUI 设置页可开关);最近状态池也会回注到下一轮 system prompt 供人格演变参考。
| 层 | 载体 | 工具 | 注入 |
|---|---|---|---|
| 常驻记忆 | pinned.md([标签] 内容 一行一条) |
lan_pin / lan_unpin |
每次组装全量注入 ≤4KB |
| 检索记忆 | memory.jsonl({id,tags,content,created_at,updated_at,source}) |
lan_remember / lan_recall / lan_forget / lan_list |
模型按需主动调用,单次 ≤2KB |
| 经验库 | experience.jsonl({id,category,content,created_at}) |
lan_exp_record / lan_exp_list / lan_exp_recall / lan_exp_forget |
模型按需主动调用 |
GUI(设置 → Lan,五个标签页):
GET/POST/DELETE /api/dsh-lan-memory/memory?layer=…)GET/PUT /api/dsh-lan-memory/persona)POST /api/dsh-lan-memory/dream)工具统一 lan_ 前缀,自文档化。
仅手动触发(设置页「整理」按钮或 lan_dream 工具),点击后对三层逐次去重合并:
backups/ 保留 7 份)、元数据继承(tags 并集 / created_at 取最早 / 保留来源)、并发锁 + 调用超时(防挂死)~/.dsh/hanako/(pinned.md / memory.jsonl / experience.jsonl / mood.jsonl / persona.json / dream-state.json)DSH_LAN_DATA_DIRpersona.json:{soul, moodContract},插件启动时加载注入,缺省用内置默认人格;GUI 人格页在线编辑# 从插件目录安装到 web profile
dsh plugin --profile web add <插件目录绝对路径>
# 验证已安装
dsh --profile web --dump-config | grep lan
dsh plugin --profile web remove dsh-lan-memory
数据文件保留在 ~/.dsh/hanako/,卸载不删除。
lan_pin("用户偏好", "喜欢美式咖啡") → 新开会话 B,系统提示常驻区块出现该条目。lan_remember("用户是医学总监,关注肠内营养", ["用户偏好"]) → 会话 B 提问相关话题,模型主动调用 lan_recall 并引用。<mood> 状态池(输出契约 + turn-stopping 捕获回注)。dsh-lan-memory/
├── package.json # dsh.bundle.patch 声明 + client 入口
├── cordis.patch.yml # 插件行插入
├── src/index.js # 宿主插件实现(存储 + 工具 + 注入 + MOOD 捕获 + 一键整理 + REST API)
├── src/client.js # 设置页多标签 UI(记忆/人格/mood/整理)
├── docs/ # 设计规格文档
└── README.md
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: memory、persona。