
hmem — Humanlike Memory for AI Agents
io.github.Bumblebiber由 GitHub 账号 Bumblebiber 发布v1.6.7更新于 Oct 24, 2026
Persistent 5-level hierarchical memory for AI agents. SQLite-backed, lazy-loaded.
发布方自己的服务:Memory.fit
概览
为 AI 助手提供持久的分层项目记忆,可跨会话、跨设备和跨模型保留。
- 可以做什么
- 把记忆以五层树结构存放在本地 SQLite 的 .hmem 文件中,按需惰性加载,只读取所需层级。日常服务器提供 13 个工具,包括 read_memory、write_memory、append_memory、search_memory(FTS5 全文检索)、find_related、load_project、create_project 和 flush_context。另有一个需手动启用的 curate 服务器,提供 11 个维护工具,用于统计、健康检查、批量修改、标签重命名、导出导入和 ID 重命名。会话通过钩子自动记录,后台检查点会提取经验、错误和决策。
- 适用场景
- 当助手在会话之间反复丢失上下文,或需要在多个项目、设备和 AI 工具之间保持一致记忆时使用。适合希望长期保存决策、错误、任务和约定的开发者,也适合需要共享公司记忆库的团队。它不是通用的笔记应用。},
- 运行要求
- 本地 Node.js 进程,通过 npx 运行(npm 包 hmem-mcp),仅支持桌面端。HMEM_STORAGE_DIR 指定 .hmem SQLite 数据库的存放目录(默认 ~/.hmem/);手动配置还会用到 HMEM_PROJECT_DIR 和 HMEM_AGENT_ID。后台检查点需要 LLM:环境变量中的 API 密钥(如 ANTHROPIC_API_KEY、OPENAI_API_KEY 或 DEEPSEEK_API_KEY),或 PATH 中的 claude 命令行。跨设备同步需要单独的 hmem-sync 包、服务器地址和 HMEM_SYNC_PASSPHRASE。
安装
在 SourceWeft 中
- 打开 控制台中的 hmem — Humanlike Memory for AI Agents,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
hmem — Humanlike Memory for AI Agents
Your AI forgets everything between sessions. hmem fixes that.
One load_project() call. ~3000 tokens. Your agent knows everything important about a project — every past mistake, every decision, every open task — across sessions, devices, and AI providers. No setup per conversation. No "let me re-read the codebase." It just remembers.
AI agent? Skip this file. Read AGENT_SETUP.md — written for you, not for humans.
Naming note (v8.0): This package was briefly published as
its-over-9k(1.x). It is nowhmemagain — pure memory framework, nothing else. Theits-over-9kname lives on as a separate project: the o9k token-efficiency meta-framework, which combines skills/plugins like this one. Related: TIM — hmem's next-generation successor (hypergraph memory, CRDT sync).
What This Is
hmem is not a note-taking plugin. It's a memory framework for AI agents — a complete infrastructure layer for persistent, portable, token-efficient knowledge that survives session boundaries, device switches, and provider changes.
Four core guarantees:
The Problem
Every AI session starts from zero. Your agent asks the same questions, makes the same mistakes, contradicts last week's decisions, and wastes 50k tokens loading context it already processed yesterday.
You've tried workarounds — CLAUDE.md files, custom prompts, manually pasting context. They don't scale. You have 10 projects. You switch between 3 devices. You use different AI tools.
The Solution
That's it. 3000 tokens for a complete project briefing. The agent knows the stack, the architecture, the open bugs, the recent decisions, and exactly where you left off — even if "you" was a different AI on a different machine yesterday.
How It Works
At session start, the agent loads Level 1 summaries — one line per memory. When it needs detail, it drills down. Your 300-entry memory costs 5k tokens to overview. A single project costs ~3000 tokens.
Nothing is summarized away. Level 1 is a compressed view, but Levels 2–5 hold the complete original text, word for word, accessible on demand.
Framework Features
Automatic Session Memory
Every conversation is recorded automatically. No "save your work" prompts. No manual checkpoints.
Switch projects mid-session? The O-entry switches too. Start a new session on a different device? The next agent sees every exchange from every device — the conversation never dies.
Haiku Background Checkpoints
Every N exchanges (configurable, default 5), a Haiku subagent wakes up in the background. It reads the recent conversation, extracts lessons learned, errors encountered, and decisions made, then writes them to long-term memory — with full MCP tool access. Your main agent is never interrupted.
The checkpoint also writes a handoff note to the project: "Here's what was done, here's what's in progress, here's the next step." The next agent — on any device, any provider — picks up exactly where you left off.
Project-Based, Not Session-Based
Sessions are meaningless. Projects are everything.
- O-entries are linked to the active project, not the session
- Checkpoint counters count project exchanges, not session messages
load_projectshows recent conversations with full context — across all devices
Skills System
hmem ships with a complete skills layer — structured behavior files that agents load on demand. Skills define how an agent should do something (debug, write memory, curate entries, handle a session start) — separate from memory, separate from prompts.
Skills are versioned and updated independently. Your agents get smarter without reinstalling. 21 skills ship by default:
Company Memory
Beyond personal memory, agents can maintain a shared company store — a separate company.hmem that multiple agents and team members can read from. Personal and company memory coexist; agents query both simultaneously.
Embeddable SDK
hmem ships as a fully documented TypeScript SDK — import HmemStore directly into your own agents, tools, or automation pipelines:
MCP Tools
hmem ships two MCP servers:
hmem(daily-use, 13 tools) — read, write, search, project lifecycle.hmem-curate(maintenance, 11 tools) — bulk edits, schema migrations, backup/restore. Activate only when curating.
hmem — daily-use server (13)
hmem-curate — maintenance server (11)
The daily hmem server is registered automatically by hmem init. hmem-curate is opt-in because its tools are destructive — register it when you need to curate:
Then toggle it via /mcp only during curation sessions. For other MCP clients, see Manual setup.
CLI Commands
After npm install -g hmem-mcp, the hmem binary is on PATH.
User-facing
Hook drivers (called by AI tools, not by hand)
Curation
Sync (requires hmem-sync installed)
Backup / migration
hmem serve starts the MCP stdio server directly — your AI tool launches it automatically; you only run it by hand for debugging.
Memory Categories
Default prefixes (configurable via prefixes in hmem.config.json):
Add custom prefixes (e.g. A for App, F for Function reference) by listing them under prefixes in hmem.config.json — they show up in read_memory({ prefix: "X" }) filters automatically.
Quick Start
1. Install
2. Run the interactive installer
Detects your AI tools, creates the memory directory, configures MCP, and installs all hooks:
3. Verify
Restart your AI tool, then:
Empty response = working (first run). Error = check the troubleshooting section.
Manual setup
Claude Code — edit ~/.claude/.mcp.json
Find the paths:
Open Code — edit ~/.config/opencode/opencode.json
Cursor / Windsurf / Cline
Edit ~/.cursor/mcp.json, ~/.codeium/windsurf/mcp_config.json, or .vscode/mcp.json:
Configuration
hmem.config.json in your HMEM_PROJECT_DIR (or Agents/NAME/):
All keys are optional. Missing keys use defaults.
Checkpoint setup per harness
The auto-checkpoint agent runs in the background after every Nth exchange. It needs an LLM call — three paths, picked automatically:
- API key in environment (any harness) → direct provider API loop. Configure
checkpointProvider+checkpointModel+checkpointApiKeyEnvinhmem.config.json. Works from Pi, Hermes, OpenCode, and Claude Code. - No API key, but
claudeCLI in PATH → subprocess fallback (claude -p). Zero-config for Claude Code / Claude Max users. - Neither → checkpoint fails with a config-hint error.
Recommended cheap setup (DeepSeek, ~10× cheaper than Haiku):
Then export DEEPSEEK_API_KEY=sk-... in your shell profile. Works for any harness.
Claude Code / Claude Max (zero-config): no provider settings needed — the subprocess fallback uses your existing claude login.
Per-harness exchange logging: Claude Code uses Stop hooks (installed by npx hmem init). Pi uses the built-in extension (src/extensions/pi-hmem.ts). Hermes needs the hermes-hmem plugin (see plugins/hermes-hmem/README.md). OpenCode uses the same hook system as Claude Code.
⚠ Pi users: Hook-based exchange logging is currently not working in the Pi runtime. Exchanges are not saved to O-entries automatically. Manual checkpointing via
hmem checkpointis the workaround until this is resolved.
Cross-Device Sync
Sync memories across all devices with zero-knowledge AES-256-GCM encryption.
Add HMEM_SYNC_PASSPHRASE to your MCP config for automatic sync on every read/write.
Multi-server redundancy
Announcements
Broadcast to all synced agents across all devices:
Windows
On Windows with Git for Windows, Claude Code routes hook and statusLine commands through Git Bash by default. Git Bash's MSYS2 runtime crashes transiently at startup, killing the command before it runs.
Fix: add "shell": "powershell" to every hook command and to statusLine in ~/.claude/settings.json.
See settings.windows.example.json for the full working config. Key differences:
Run npm root -g to get the correct node_modules path for your machine.
statusLine on Windows: Stable with
"shell": "powershell". Without it the statusline disappears intermittently.
Troubleshooting
Updating
License
MIT
来源:README.md,提交 0e35095
工具
0版本历史
1- v1.6.7最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Memory 集成

Memory.fit
fit.memory官方发布者
托管式 Memory.fit 服务器,让 AI 读取你的训练、睡眠、恢复与饮食数据,并写回每周计划、每日目标和饮食计划。
pg.ddx.io: the PostgreSQL community's memory
io.ddx.pg官方发布者
pg.ddx.io: the PostgreSQL community's memory 的托管 MCP 服务,由 pg.ddx.io 发布;无需登录;Streamable HTTP;29 个工具。
var.gg Naming Memory
gg.var官方发布者
远程 MCP 服务器,可根据领域概念推荐并检索韩、日、中、越、英多语言的代码标识符名称,并提供 ERD 结构查询。

Counterparts
ai.counterparts
面向 Claude Code 与 Claude Desktop 的本地优先长期记忆:助手自行写下关于你和项目的笔记,并在之后的会话中回忆起来。

LAHZE - Persian AI Memory Platform
由 GitHub 账号 pedramgholizadeh 发布
以波斯语为先的地理记忆平台:发现地点,起草并发布仅限波斯语的记忆。AI 翻译