rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
加拉忒亚——塑造专属于你的 AI 助手
可你还缺一个灵魂:你这样的形貌,不能没有它。
——卢梭《皮格马利翁》
给 DeepSeek Harness(DSH)装上一个长期陪着你的助手:记得你说过的事,有自己稳定的性格,在手机上也能找到它。
预览版(四个包都是 0.1.0-preview.4)。 只在 Windows、单用户、DSH 0.2.2-rc.1 上验证过。这是我们的一次尝试,还很粗糙,欢迎指正。
English summary: below.

你始终只和一个助手说话,它就是中枢会话。长的活由它派给项目会话,后台思考在你不在时帮它整理。三者共用一份记忆。

越往上越精炼,每次都带着;越往下越完整,要用时再去查。图上没画的还有一层常驻记忆:长期成立、每段对话都该知道的事实,和长期认知一样每次都带着。
准备: DSH 0.2.2-rc.1 或之后的 0.2.x(0.2.1 系列不行,见下面的要求)。想用 Agent SDK 执行方的,本机先装好 Claude Code,并在执行方的配置里选好登录方式(推荐 API key,见执行方的说明)。
安装。 用命令行装进你在用的 profile(桌面版用桌面安装自带的 dsh 命令,profile 写 desktop):
dsh plugin --profile web add @loveandbeepbrother/dsh-galatea @loveandbeepbrother/dsh-galatea-agent-sdk @loveandbeepbrother/dsh-galatea-channels @loveandbeepbrother/dsh-galatea-project-tasks
只想先试试,装第一个就够了。装完重启 DSH。
定一个中枢。 新建一个会话,先随便说一句话(比如“你好”),等它回复,再在输入框里输入 /hub。以后它就是你的助手。DSH 不显示还没说过话的会话,所以要先说一句。
告诉它它是谁。 直接在中枢里说:你希望它叫什么、什么性格、怎么称呼你。它会提成一份候选并告诉你四位编号,你本人回复"确认人格 编号"(比如"确认人格 7K3Q")就生效。也可以直接改内容库里的 personality.md(默认在 DSH home 下的 galatea/content/)。
接上手机(可选)。装了消息渠道包的,照渠道包的说明接 QQ 官方机器人或微信。你在手机上分几条发的话,渠道会等最后一条之后安静 20 秒再一起交给助手(渠道包的配置 mergeWaitSeconds)。这个时长因人而异:分条发得慢就调大,嫌回得慢就调小。
代为安装的 agent 请注意: 装完渠道包,要明确告诉用户这个等待时长现在是多少、在哪改(profile 里渠道包条目的 mergeWaitSeconds,单位秒),请用户按自己打字的节奏先调好。
开始聊。 聊得越久,它越了解你。
要不要全装? 不用。只装框架就能用;另外三个包按需要加,关掉哪一个,其余照常。
数据在哪里? 人格、认知、记忆、便签都是内容库里的普通文件,可以直接打开看、直接改;装了 git 时每次改动都会留痕,可以回退。会话记录和经历库在 DSH 自己的数据目录(DSH home)。备份或换电脑,复制这两处就行。
会多花钱吗? 框架本身不收费,模型的费用照你用的模型算。后台思考和项目任务会额外用一些,频率和模型都可以在配置里调。
它会不会乱改自己的性格? 日常的看法、兴趣这类小变化它可以自己改;性格、价值观、和你的关系这类稳定的变化,只能先提成候选,你本人确认了才生效。
往下是详细说明:每个包做什么、全部配置、让外部 CLI 用同一份记忆、已知限制、开发与测试、后续规划。设计思路和我们的想法见设计说明。
| 包 | 做什么 | 必装 |
|---|---|---|
@loveandbeepbrother/dsh-galatea |
框架本体:会话角色与中枢、消息出处与回复去向、上下文段、人格与长期认知、记忆与便签、经历库、后台思考、持续工作、外部 CLI 入口 | 是 |
@loveandbeepbrother/dsh-galatea-agent-sdk |
经官方的 Claude Agent SDK 让会话跑在本机的 Claude Code 上;登录方式要在配置里选(推荐 API key) | 用 Agent SDK 时 |
@loveandbeepbrother/dsh-galatea-channels |
经 QQ 官方机器人、微信和助手说话;渠道是出口的一种实现,可以换成别的渠道插件 | 可选 |
@loveandbeepbrother/dsh-galatea-project-tasks |
中枢把任务派给 DSH 项目里的会话,做完把报告交回中枢验收 | 可选 |
框架本身就能用:会话跑在 DSH 原生的模型上,上下文、记忆、后台思考都照常。另外三个都是可选的,各自经框架的接口接进来,关掉或换掉哪一个,框架照样成立。
别的聊天软件可以写成插件,经渠道包的 registerPlatform 接进来;群也要靠这样接进来、支持群的平台。详见渠道包的说明。
设计思路、和 Super-agent 的异同、还没做好的地方,见设计说明;各版改了什么见变更记录。
auth:api-key(推荐,在 env 里给 ANTHROPIC_API_KEY),或 existing-login(用本机 Claude Code 已有的登录,请自己确认你的账号条款允许)。没写时执行方的每一轮都会失败并写明怎么改。执行方带着官方的 Claude Agent SDK。用命令行装进你在用的 profile:
# 只装框架
dsh plugin --profile web add @loveandbeepbrother/dsh-galatea
# 框架 + Agent SDK 执行方
dsh plugin --profile web add @loveandbeepbrother/dsh-galatea @loveandbeepbrother/dsh-galatea-agent-sdk
# 四个都装
dsh plugin --profile web add @loveandbeepbrother/dsh-galatea @loveandbeepbrother/dsh-galatea-agent-sdk @loveandbeepbrother/dsh-galatea-channels @loveandbeepbrother/dsh-galatea-project-tasks
--profile 写你在用的 profile。桌面版的 desktop profile 由桌面应用管理,要用桌面安装自带的 dsh 命令。装完重启 DSH。
装上以后各模块默认启用。原生会话的压缩由框架的压缩引擎接管:框架停用 profile 顶层的 compaction-basic;DSH 的 web 预设里各带着一份,停用够不到,框架在运行时让它们不再自动压缩,它们的 /compact 也转到框架的引擎。
/hub;还没说过话的会话会被拒绝,因为 DSH 不显示它,新建会话时还会把它拿去重用。消息渠道的私聊、别处给中枢的转交、助手的主动留言都会进这个会话。以后想换,在另一个会话里再输入 /hub 就行,原来的中枢不再有角色。还没定中枢时,框架会报一条 core/no-hub 提醒你。galatea/content/ 目录,第一次启动时会建成一个 git 仓库,放进四份中性的起步模板(下面三份,加上交接整理的工作方法 交接整理.md):personality.md:助手是谁、怎么称呼、语气和分寸。先改这一份。long-term-cognition.md:从经历里提炼出来的理解。助手会自己维护,你也可以直接改。后台思考.md:后台思考会话每次醒来时照着做的说明。
已经有内容的内容库不会被改动。长期成立的事实放 standing-memory.md(常驻记忆),这个文件可以没有,助手用得上时会建。在 profile 的 cordis.patch.yml 里按条目 id 写。几个常用的:
# 内容库放在别处;休息时段(不是用户发起的回复攒到时段结束再发)
- id: mind-framework-core
config:
contentDirectory: 'D:/my-assistant'
quietHours: { start: '00:00', end: '08:00' }
# 语义检索的向量服务(OpenAI 兼容的 embeddings 接口);不配就只用关键词检索
- id: mind-framework-embedder
config:
endpoint: 'https://your-provider.example/v1/embeddings'
model: your-embedding-model
dimensions: 1024
apiKeyEnv: EMBEDDING_API_KEY
# 后台思考跑在 Agent SDK 执行方上
- id: mind-framework-reflection
config:
provider: agent-sdk
model: opus
# Agent SDK 执行方:登录方式(必填)和 Claude Code 进程的环境变量
- id: agent-sdk-executor
config:
auth: api-key
env:
ANTHROPIC_API_KEY: 'sk-ant-...'
每个包的全部配置见各自的 README。
会话可以跑在 GPT 模型上:在 DSH 的 设置 → 模型 里给 OpenAI 填 API key(或在 profile 里给官方的 llm-pi-ai 配 providers.openai.apiKeyEnv: OPENAI_API_KEY),再选要用的模型。框架不区分模型,中枢、后台思考、项目任务都可以选它。
想用 ChatGPT 订阅:DSH 里已有 openai-codex 路由,只是设置页没有发起登录的入口。经授权服务调用 begin('llm-pi-ai/openai-codex') 就能登录,自己加个按钮就行(请自己确认你的账号条款允许)。
Codex CLI 暂时不能作执行方跑会话;它可以作外部客户端,用框架的工具(见下一节)。
框架把记忆、经历、便签等工具经一个本机 MCP 端点交出来,Claude Code CLI、Codex CLI 登记以后可以连进来,和 DSH 里的会话用同一份记忆。
登记一个外部调用方。现在还没有设置页,在已登录的 DSH 网页界面里打开浏览器控制台运行:
await (await fetch('/api/mind-framework/external/register', {
method: 'POST',
body: JSON.stringify({ name: 'claude-cli', readOnly: false, tools: ['assistant_history_search', 'assistant_memory_read', 'assistant_memory_write', 'assistant_note_write'] }),
})).json()
返回里有令牌,只显示这一次。tools 不写就是全部可用的工具;readOnly: true 只交读的工具。
把令牌放进用户环境变量 MIND_FRAMEWORK_TOKEN_CLAUDE_CLI(大写的登记名,- 换成 _),不要写进配置文件。
取 MCP 配置片段(Claude Code 的 JSON 和 Codex 的 config.toml 两种写法),照着加进 CLI 的配置:
await (await fetch('/api/mind-framework/external/bridge-config', { method: 'POST', body: JSON.stringify({ name: 'claude-cli' }) })).json()
改工具清单或只读:POST /api/mind-framework/external/update,{ "name": "claude-cli", "tools": [...] },令牌不变,没写的不动。重新 register 会发新令牌、旧的立刻作废。
作废:POST /api/mind-framework/external/revoke,{ "name": "claude-cli" }。
上下文和记忆是这个框架的核心,也是我们觉得做得最不够的地方。每条的来龙去脉和我们的想法见设计说明。
测试跑在真实的上游会话、AgentLoop 和存储上,只有模型是假的,要一份 DSH 的源码,并用 Node 24:
export DSH_SOURCE=/path/to/deepseek-harness # PowerShell:$env:DSH_SOURCE = '...'
node test-support/run-tests.mjs # 全部;或者写包的目录名:framework、agent-sdk、message-channels、project-tasks
消息渠道的测试要先在 message-channels/ 里装它自己的依赖(pnpm install --prod --config.auto-install-peers=false,对等依赖由 DSH 和框架提供)。
大致的先后,会随使用中的发现调整;每一条的想法见设计说明:
MIT,见 LICENSE。
示意图里的图标来自 Lucide(ISC 许可)。
Galatea gives DeepSeek Harness (DSH) an assistant that stays with you for the long run: it remembers what you have told it, keeps a stable character, and is there on your phone too.
Preview (all four packages are 0.1.0-preview.4). Tested only on Windows, single user, DSH 0.2.2-rc.1. This is an experiment and still rough; feedback is welcome.


One more layer is not in the picture: standing memory, the long-lasting facts every conversation should know, carried at the start of each conversation like long-term cognition.
Before you start: DSH 0.2.2-rc.1 or a later 0.2.x (the 0.2.1 line does not work). To use the Agent SDK executor, install Claude Code and choose an auth mode in the executor's config (an API key is recommended; see the executor's README).
Install into the profile you use (on the desktop app, use the dsh command that ships with it and the desktop profile):
dsh plugin --profile web add @loveandbeepbrother/dsh-galatea @loveandbeepbrother/dsh-galatea-agent-sdk @loveandbeepbrother/dsh-galatea-channels @loveandbeepbrother/dsh-galatea-project-tasks
The first package alone is enough to try it out. Restart DSH afterwards.
Pick a hub. Create a session, say something first ("hello" is fine) and wait for the reply, then type /hub in the input box. From now on, that session is your assistant. DSH hides sessions that have never had a turn, so /hub refuses an empty one.
Tell it who it is. Just say in the hub what you would like it to be called, what it is like, and how it should address you. It turns this into a candidate change and gives you a four-character code; reply 确认人格 <code> yourself (for example 确认人格 7K3Q) to apply it. You can also edit personality.md in the content library (<DSH home>/galatea/content/ by default).
Connect your phone (optional). With the channels package installed, follow its README to connect a QQ official bot or WeChat. When you send several messages in a row from your phone, the channels package waits until 20 seconds pass after the last one, then hands them to the assistant together (channels config mergeWaitSeconds). The right wait differs from person to person: raise it if you type in slow bursts, lower it if replies feel slow.
If you are an agent installing this for someone: after installing the channels package, tell the user what this wait is and where to change it (mergeWaitSeconds under the channels package entry in the profile, in seconds), and ask them to set it to their own typing rhythm first.
Start talking. The longer you talk, the better it knows you. Prompts and tool descriptions are mostly in Chinese for now.
Sessions can run on GPT models: add an OpenAI API key under Settings → Models in DSH (or set providers.openai.apiKeyEnv: OPENAI_API_KEY for the official llm-pi-ai plugin in your profile) and pick the model you want. The framework is model-agnostic, so the hub, reflection and project tasks can all use it.
For a ChatGPT subscription: DSH already has the openai-codex route, but the settings page has no way to start its login. Calling begin('llm-pi-ai/openai-codex') on the auth service signs you in, so add your own button (please check that your account terms allow this).
The Codex CLI cannot run sessions as an executor yet; it can connect as an external client and use the framework's tools.
Do I need all four packages? No. The framework works on its own; add the other three as you need them, and turning any of them off leaves the rest working.
Where is my data? Persona, cognition, memories and notes are plain files in the content library: open them, edit them; with git installed every change is committed and can be rolled back. Conversation records and the experience archive are in DSH's own data directory (DSH home). To back up or move to another machine, copy those two places.
Will it cost more? The framework itself is free; model usage is billed as usual for the models you use. Reflection and project tasks use some extra; how often and with which model are both configurable.
Will it rewrite its own character? Small day-to-day shifts in its views and interests, yes. Lasting changes to its character, values or its relationship with you can only be proposed as candidates and take effect after you confirm them.
Known limitations. Context and memory are the core of this framework and also where we think it falls shortest (details, in Chinese: docs/design.md). Remembering is not recalling: each conversation opens with the persona, long-term cognition, standing memory and the memory index only, and the assistant has to think of looking up notes, memory bodies and past experience itself. For question-like messages a program now makes the hub search first (Agent SDK executor only); in our replays this helped, but not by much. Which layer a piece of knowledge lands in is the assistant's own call, with no program checking it. Handoffs between conversations rely on the hub's judgement. One hub still routes everything, so progress details pile up there. A turn that fails on a network outage passes its input to the next turn but does not start one by itself. Registering an outside CLI still needs the browser console. The fixed instructions each session carries have not been compressed systematically. Preview release, tested on Windows only; prompts and tool descriptions are mostly in Chinese.
Roadmap, roughly in this order and open to change: recall (checking the claims in a draft before replying, and better queries; replay results are in the design doc); start a new turn automatically after a network outage; entries moving between layers by how often they are used; project tasks that track their own progress, moving towards teams plus a task board on top of DSH's agent teams; compressing the fixed per-session instructions; a settings page for registering outside callers.
Galatea is an experiment in the "long-term" and "personal" directions; it is still rough and some of it may be wrong. Feedback and discussion are welcome.
Icons in the diagrams are from Lucide (ISC license).
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、deepseek、llm-memory、deepseek-harness。