词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!
| 文件 | 用途 | 字符上限 |
|---|---|---|
| MEMORY.md | Agent 的个人笔记——环境事实、约定、已学内容 | 2,200 字符(约 800 tokens) |
| USER.md | 用户档案——你的偏好、沟通风格、期望 | 1,375 字符(约 500 tokens) |
~/.hermes/memories/,在会话开始时以冻结快照的形式注入系统 prompt(提示词)。Agent 通过 memory 工具管理自身记忆——可添加、替换或删除条目。══════════════════════════════════════════════
MEMORY (your personal notes) [67% — 1,474/2,200 chars]
══════════════════════════════════════════════
User's project is a Rust web service at ~/code/myapi using Axum + SQLx
§
This machine runs Ubuntu 22.04, has Docker and Podman installed
§
User prefers concise responses, dislikes verbose explanations§(节符)分隔的各条目memory 工具执行以下操作:old_text 进行子字符串匹配)old_text 进行子字符串匹配)read 操作——记忆内容在会话开始时自动注入系统 prompt。Agent 将其记忆作为对话上下文的一部分来查看。replace 和 remove 操作使用简短的唯一子字符串匹配——不需要完整的条目文本。old_text 参数只需是能唯一标识某一条目的子字符串即可:memory — Agent 的个人笔记user — 用户档案usermemorysudo,用户已在 docker 组中" → 保存到 memorymemorymemorymemory| 存储 | 上限 | 典型条目数 |
|---|---|---|
| memory | 2,200 字符 | 8-15 条 |
| user | 1,375 字符 | 5-10 条 |
{
"success": false,
"error": "Memory at 2,100/2,200 chars. Adding this entry (250 chars) would exceed the limit. Replace or remove existing entries first.",
"current_entries": ["..."],
"usage": "2,100/2,200"
}replace 将相关条目合并为更简短的版本add 新条目# Good: Packs multiple related facts
User runs macOS 14 Sonoma, uses Homebrew, has Docker Desktop and Podman. Shell: zsh with oh-my-zsh. Editor: VS Code with Vim keybindings.
# Good: Specific, actionable convention
Project ~/code/api uses Go 1.22, sqlc for DB queries, chi router. Run tests with 'make test'. CI via GitHub Actions.
# Good: Lesson learned with context
The staging server (10.0.1.50) needs SSH port 2222, not 22. Key is at ~/.ssh/staging_ed25519.
# Bad: Too vague
User has a project.
# Bad: Too verbose
On January 5th, 2026, the user asked me to look at their project which is
located at ~/code/api. I discovered it uses Go version 1.22 and...session_search 工具搜索过去的对话:~/.hermes/state.db)中,支持 FTS5 全文搜索| 特性 | 持久化记忆 | 会话搜索 |
|---|---|---|
| 容量 | 约 1,300 tokens 总计 | 无限制(所有会话) |
| 速度 | 即时(在系统 prompt 中) | 约 20ms FTS5 查询,约 1ms 滚动 |
| 成本 | 每次 prompt 均有 token 开销 | 免费——无 LLM 调用 |
| 使用场景 | 始终可用的关键事实 | 查找特定的过去对话 |
| 管理方式 | 由 Agent 手动整理 | 自动——所有会话均存储 |
| Token 开销 | 每次会话固定(约 1,300 tokens) | 按需(仅在搜索时产生) |