经 AI Skill Hub 精选评估,铁记忆 获评「推荐使用」。这款Agent工作流在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.2 分,适合有一定技术背景的用户使用。
为AI编码助手提供持久化会话记忆的开源工作流工具。自动记录编码上下文,支持Claude Code和Copilot等助手,帮助开发者维持长期对话记忆,提升AI辅助编程效率。适合需要持续编码协助的开发者。
铁记忆 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
为AI编码助手提供持久化会话记忆的开源工作流工具。自动记录编码上下文,支持Claude Code和Copilot等助手,帮助开发者维持长期对话记忆,提升AI辅助编程效率。适合需要持续编码协助的开发者。
铁记忆 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:cargo install(推荐) cargo install iron-mem # 方式二:从源码编译 git clone https://github.com/BMC-INC/Iron-mem cd Iron-mem cargo build --release # 二进制在 ./target/release/iron-mem
# 查看帮助 iron-mem --help # 基本运行 iron-mem [options] <input> # 详细使用说明请查阅文档 # https://github.com/BMC-INC/Iron-mem
# iron-mem 配置说明 # 查看配置选项 iron-mem --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export IRON_MEM_CONFIG="/path/to/config.yml"
<p align="center"> <img src="memorylogo.png" alt="IronMem" width="120"/> <br/> <img src="assets/title.png" alt="IRON-MEM" width="300"/> </p>
<p align="center"> <strong>Persistent memory for AI coding assistants.</strong> </p>
<p align="center"> Stop re-explaining your project every time you start a new session. </p>
<p align="center"> <a href="#install">Install</a> • <a href="#how-it-works">How It Works</a> • <a href="#cli">CLI</a> • <a href="#multi-provider-support">Multi-Provider</a> • <a href="#contributing">Contributing</a> </p>
<p align="center"> <img src="https://img.shields.io/badge/built_with-Rust-F74C00?style=for-the-badge&logo=rust&logoColor=white" alt="Built with Rust"/> <img src="https://img.shields.io/badge/MCP-Native-6c5ce7?style=for-the-badge" alt="MCP Native"/> <img src="https://img.shields.io/badge/SQLite%20%2B%20Postgres-003B57?style=for-the-badge&logo=sqlite&logoColor=white" alt="SQLite + Postgres"/> <img src="https://img.shields.io/badge/Docker%20Ready-2496ED?style=for-the-badge&logo=docker&logoColor=white" alt="Docker Ready"/> <img src="https://img.shields.io/badge/license-Apache--2.0-brightgreen?style=for-the-badge" alt="License"/> <img src="https://img.shields.io/github/stars/BMC-INC/Iron-mem?style=for-the-badge&color=yellow" alt="Stars"/> <img src="https://img.shields.io/github/issues/BMC-INC/Iron-mem?style=for-the-badge" alt="Issues"/> <a href="https://github.com/BMC-INC/Iron-mem/actions/workflows/rust.yml"><img src="https://github.com/BMC-INC/Iron-mem/actions/workflows/rust.yml/badge.svg" alt="CI"/></a> </p>
<p align="center"> <img src="https://img.shields.io/badge/works_with-Claude_Desktop-D97706?style=flat-square&logo=anthropic&logoColor=white" alt="Claude Desktop"/> <img src="https://img.shields.io/badge/works_with-Claude_Code-D97706?style=flat-square&logo=anthropic&logoColor=white" alt="Claude Code"/> <img src="https://img.shields.io/badge/works_with-Cursor-000000?style=flat-square&logo=cursor&logoColor=white" alt="Cursor"/> <img src="https://img.shields.io/badge/works_with-ChatGPT_Desktop-10a37f?style=flat-square&logo=openai&logoColor=white" alt="ChatGPT Desktop"/> <img src="https://img.shields.io/badge/works_with-Copilot-2b3137?style=flat-square&logo=github&logoColor=white" alt="Copilot"/> <img src="https://img.shields.io/badge/works_with-Windsurf-06B6D4?style=flat-square" alt="Windsurf"/> <img src="https://img.shields.io/badge/works_with-Zed-000000?style=flat-square" alt="Zed"/> </p>
---
Lossless, reversible memory — plus a real memory model: scoping, typed memories, an always-on user profile, and a correction miner.
retrieve_original tool pulls the exact original back behind any compressed memory. No more lossy truncation.project vs. user/cross-project) and a kind (session, error_solution, preference, architecture, learned_pattern, project_config, profile). Session-start injection ranks project ∪ user memories and boosts durable kinds.remember tool — store an explicit, typed memory in one call (scope, kind, text, tags). User-scope facts follow you into every project.get_profile / refresh_profile.error_solution memories and surfaced via list_corrections, so past fixes resurface when the work recurs.retrieve_original, remember, get_profile, refresh_profile, list_corrections.<details> <summary>v0.3.0</summary>
- Multi-provider compression — use OpenAI, Google Gemini, or Anthropic as your LLM. Set "provider": "openai" in settings. - Neovim plugin — native Lua plugin with auto session lifecycle, :IronMemSearch, :IronMemStatus - Windows support — install.ps1, platform-aware messages, robust home directory detection - Web UI — browse, search, and delete memories at http://localhost:37778/ui - Discovery tools — list known projects, search across all projects, and inspect per-project session history - Still zero telemetry. Still local-first. Your data stays yours. </details>
<details> <summary>v0.2.0</summary>
- 13 MCP tools — session_start, session_end, record_event, compress_session, get_context, get_status, list_memories, search_memories, search_global, list_projects, list_sessions, inject_context, wipe_project - Dual database — SQLite (local, FTS5 full-text search) + Postgres (self-hosted, tsvector) via DATABASE_URL - Every MCP client — Claude Desktop, Claude Code, Cursor, Windsurf, ChatGPT Desktop, Zed, and more - Docker deployment — docker-compose up for remote/team setups with Postgres - ironmem mcp — new subcommand for direct MCP stdio transport (Claude Desktop/Code) - REST server still works — existing hooks and curl-based workflows unaffected </details>
---
IronMem gives AI coding tools persistent memory across sessions. It silently records what happened during your session, compresses it into concise memory, and injects that context into your next session automatically.
No copy-pasting. No rebuilding context from scratch. No "remember when we refactored auth yesterday?"
Works with every major AI coding tool — Claude Code, Claude Desktop, Cursor, Windsurf, ChatGPT Desktop, GitHub Copilot, Zed, VS Code, and any MCP-compatible client.
Compress with the LLM you already pay for — Anthropic Claude, OpenAI GPT-4o, or Google Gemini. Switch providers with one config change.
Free and open source. Runs locally or on your own infrastructure. No telemetry. No cloud dependency. No subscription. SQLite or Postgres storage. Plain markdown output. Single Rust binary.
<p align="center"> <img src="assets/demo.gif" alt="IronMem in action" width="640"/> </p>
curl -fsSL https://raw.githubusercontent.com/BMC-INC/Iron-mem/main/install.sh | bash
Or clone and build manually:
git clone https://github.com/BMC-INC/Iron-mem.git
cd Iron-mem
chmod +x install.sh
./install.sh
Windows:
git clone https://github.com/BMC-INC/Iron-mem.git
cd Iron-mem
powershell -ExecutionPolicy Bypass -File install.ps1
Add IronMem to your PATH (in ~/.zshrc or ~/.bashrc) and write your API key to IronMem's key file:
export PATH="$HOME/.ironmem/bin:$PATH" # in ~/.zshrc / ~/.bashrc
echo "your-key-here" > ~/.ironmem/api_key && chmod 600 ~/.ironmem/api_key
Use the key file, notexport ANTHROPIC_API_KEY— a globalANTHROPIC_API_KEYmakes Claude Code (and similar tools) bill against pay-as-you-go API credit instead of your subscription. IronMem reads~/.ironmem/api_keyautomatically.
Restart your terminal and Claude Code. That's it.
Requirements: Rust/Cargo (the installer will tell you if it's missing)
---
IronMem supports two MCP transports:
Once connected over MCP, IronMem now supports project discovery directly:
list_projects — show every project with stored memoriessearch_global — search across all projectslist_sessions — inspect session history inside a projectClaude Code connects via stdio — it launches ironmem mcp directly.
Option A: CLI (recommended)
claude mcp add ironmem -- ~/.ironmem/bin/ironmem mcp
Option B: Project .mcp.json (share with your team)
Create .mcp.json in your project root:
{
"mcpServers": {
"ironmem": {
"command": "~/.ironmem/bin/ironmem",
"args": ["mcp"],
"env": {
"ANTHROPIC_API_KEY": "your-key-here"
}
}
}
}
Note: Claude Code hooks (installed by install.sh) and MCP can coexist. The hooks use the REST API for automatic observation recording; MCP gives you direct tool access. You can use both, or just one.
Claude Desktop also connects via stdio.
Add to your claude_desktop_config.json:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ironmem": {
"command": "/Users/YOU/.ironmem/bin/ironmem",
"args": ["mcp"],
"env": {
"ANTHROPIC_API_KEY": "your-key-here"
}
}
}
}
Replace /Users/YOU with your actual home directory path. Restart Claude Desktop after saving.
Both use stdio. Add to your MCP settings:
Cursor: Settings → MCP → Add Server
Windsurf: Settings → MCP → Add Server
{
"ironmem": {
"command": "~/.ironmem/bin/ironmem",
"args": ["mcp"]
}
}
ollama pull nomic-embed-text
Run IronMem with Postgres for team/remote setups:
ANTHROPIC_API_KEY=your-key docker-compose up --build
This starts IronMem with Streamable HTTP on http://localhost:37779/mcp and Postgres 16, plus the REST server on http://localhost:37778.
---
1. Install IronMem:
curl -fsSL https://raw.githubusercontent.com/BMC-INC/Iron-mem/main/install.sh | bash
2. Add your API key to IronMem's key file: echo "your-key-here" > ~/.ironmem/api_key && chmod 600 ~/.ironmem/api_key
> Prefer the key file over export ANTHROPIC_API_KEY. Claude Code (and some other tools) bill against ANTHROPIC_API_KEY whenever it's set in your shell — using pay-as-you-go API credit instead of your Claude subscription. The key file keeps IronMem's key out of your environment so it can't change how other tools bill. (IronMem still honors ANTHROPIC_API_KEY if you prefer the env var.) 3. Start coding! IronMem handles the rest silently in the background.
---
~/.ironmem/settings.json:
{
"port": 37778,
"provider": "anthropic",
"model": "claude-sonnet-4-6-20250627",
"inject_limit": 5,
"max_observation_bytes": 2048,
"db_path": "/Users/you/.ironmem/mem.db",
"database_url": null,
"mcp_transport": "stdio",
"mcp_sse_port": 37779,
"auth_token": null,
"embedding": {
"provider": "auto",
"model": null,
"ollama_url": "http://localhost:11434",
"weights": { "relevance": 0.5, "recency": 0.3, "importance": 0.2 },
"recency_half_life_days": 30
}
}
All fields optional. Sensible defaults provided. auth_token is generated automatically the first time you run ironmem serve without --no-auth. The embedding block is optional — omit it entirely and IronMem behaves exactly as before (keyword-only search, recency injection).
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | _(none)_ | Postgres URL. Overrides db_path when set. |
IRONMEM_MCP_TRANSPORT | stdio | MCP transport: stdio or sse |
ANTHROPIC_API_KEY | _(none)_ | Required when provider is anthropic (default) |
OPENAI_API_KEY | _(none)_ | Required when provider is openai |
GOOGLE_API_KEY | _(none)_ | Required when provider is google |
IronMem needs an LLM API key to compress session observations into memories.
Recommended (Anthropic): write the key to ~/.ironmem/api_key (echo "your-key" > ~/.ironmem/api_key && chmod 600 ~/.ironmem/api_key). Keeping it in this file rather than a global ANTHROPIC_API_KEY export avoids changing how other tools bill — Claude Code, for instance, charges pay-as-you-go API credit whenever ANTHROPIC_API_KEY is set in the environment, instead of using your subscription. IronMem reads the file automatically (it also works when the background server is spawned via nohup, where some shells strip env vars from child processes).
IronMem still honors the per-provider environment variable if you prefer it — ANTHROPIC_API_KEY, OPENAI_API_KEY, or GOOGLE_API_KEY. The file fallback applies to the default Anthropic provider.
---
cat ~/.ironmem/api_key # Should contain your key echo $ANTHROPIC_API_KEY # Optional env-var fallback (may be empty)
IronMem includes a native Neovim plugin that communicates via MCP stdio.
Install with lazy.nvim:
{
"BMC-INC/Iron-mem",
config = function()
require("ironmem").setup({
-- binary = "~/.ironmem/bin/ironmem", -- default
-- auto_start = true, -- session_start on VimEnter
-- auto_end = true, -- session_end on VimLeavePre
-- record_events = true, -- record buffer writes
})
end,
}
Commands:
| Command | Description |
|---|---|
:IronMemStart | Manually start a session |
:IronMemEnd | End session and compress |
:IronMemStatus | Show database stats |
:IronMemSearch <query> | Search memories in a split buffer |
---
Without IronMem:
"We already changed the auth middleware, switched to JWT, updated the migration, and fixed the failing tests in billing. Let me explain the whole thing again."
With IronMem:
Open a new session. Your assistant already has the recent project context.
---
Server not starting:
ironmem status # Check if server responds
cat ~/.ironmem/server.log # Check server logs
~/.ironmem/bin/ironmem server # Run manually to see errors
Observations not being recorded:
ironmem status # Check observation count
sqlite3 ~/.ironmem/mem.db "SELECT count(*) FROM observations;"
If count stays at 0, your hooks may not be installed. Re-run ./install.sh or check that ~/.claude/hooks/post-tool-use.sh exists and is executable.
Compression failing (memories always 0):
```bash
创新的会话记忆解决方案,解决AI助手长期对话的上下文丢失问题。Rust实现保证性能,但生态成熟度有限,适合早期采用者。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
AI Skill Hub 点评:铁记忆 的核心功能完整,质量良好。对于自动化工程师和运维人员来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | Iron-mem |
| 原始描述 | 开源AI工作流:Persistent session memory for AI coding assistants. IronMem silently records you。⭐5 · Rust |
| Topics | AI编码会话记忆上下文管理CLI工具Rust实现 |
| GitHub | https://github.com/BMC-INC/Iron-mem |
| License | Apache-2.0 |
| 语言 | Rust |
收录时间:2026-06-06 · 更新时间:2026-06-11 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端