Gentleman-Programming/engram

GitHub: Gentleman-Programming/engram

一个为 AI 编程代理提供持久化记忆的单一 Go 二进制解决方案,解决会话遗忘问题。

Stars: 2592 | Forks: 278

image

Persistent memory for AI coding agents
Agent-agnostic. Single binary. Zero dependencies.

InstallationAgent SetupArchitecturePluginsContributingFull Docs

Your AI coding agent forgets everything when the session ends. Engram gives it a brain. A **Go binary** with SQLite + FTS5 full-text search, exposed via CLI, HTTP API, MCP server, and an interactive TUI. Works with **any agent** that supports MCP — Claude Code, OpenCode, Gemini CLI, Codex, VS Code (Copilot), Antigravity, Cursor, Windsurf, or anything else. ``` Agent (Claude Code / OpenCode / Gemini CLI / Codex / VS Code / Antigravity / ...) ↓ MCP stdio Engram (single Go binary) ↓ SQLite + FTS5 (~/.engram/engram.db) ``` ## 快速开始 ### 安装 ``` brew install gentleman-programming/tap/engram ``` Windows, Linux, and other install methods → [docs/INSTALLATION.md](docs/INSTALLATION.md) ### 设置您的代理 | Agent | One-liner | |-------|-----------| | Claude Code | `claude plugin marketplace add Gentleman-Programming/engram && claude plugin install engram` | | OpenCode | `engram setup opencode` | | Gemini CLI | `engram setup gemini-cli` | | Codex | `engram setup codex` | | VS Code | `code --add-mcp '{"name":"engram","command":"engram","args":["mcp"]}'` | | Cursor / Windsurf / Any MCP | See [docs/AGENT-SETUP.md](docs/AGENT-SETUP.md) | Full per-agent config, Memory Protocol, and compaction survival → [docs/AGENT-SETUP.md](docs/AGENT-SETUP.md) That's it. No Node.js, no Python, no Docker. **One binary, one SQLite file.** ## 工作原理 ``` 1. Agent completes significant work (bugfix, architecture decision, etc.) 2. Agent calls mem_save → title, type, What/Why/Where/Learned 3. Engram persists to SQLite with FTS5 indexing 4. Next session: agent searches memory, gets relevant context ``` Full details on session lifecycle, topic keys, and memory hygiene → [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md) ## MCP 工具 (15) | Category | Tools | |----------|-------| | **Save & Update** | `mem_save`, `mem_update`, `mem_delete`, `mem_suggest_topic_key` | | **Search & Retrieve** | `mem_search`, `mem_context`, `mem_timeline`, `mem_get_observation` | | **Session Lifecycle** | `mem_session_start`, `mem_session_end`, `mem_session_summary` | | **Utilities** | `mem_save_prompt`, `mem_stats`, `mem_capture_passive`, `mem_merge_projects` | Full tool reference with parameters → [DOCS.md#mcp-tools-15-tools](DOCS.md#mcp-tools-15-tools) ## 终端用户界面 ``` engram tui ```

TUI Dashboard image TUI Observation Detail TUI Search Results

**Navigation**: `j/k` vim keys, `Enter` to drill in, `/` to search, `Esc` back. Catppuccin Mocha theme. ## Git 同步 Share memories across machines. Uses compressed chunks — no merge conflicts, no huge files. ``` engram sync # Export new memories as compressed chunk git add .engram/ && git commit -m "sync engram memories" engram sync --import # On another machine: import new chunks engram sync --status # Check sync status ``` Full sync documentation → [DOCS.md](DOCS.md) ## CLI 参考 | Command | Description | |---------|-------------| | `engram setup [agent]` | Install agent integration | | `engram serve [port]` | Start HTTP API (default: 7437) | | `engram mcp` | Start MCP server (stdio) | | `engram tui` | Launch terminal UI | | `engram search ` | Search memories | | `engram save <msg>` | Save a memory | | `engram timeline <obs_id>` | Chronological context | | `engram context [project]` | Recent session context | | `engram stats` | Memory statistics | | `engram export [file]` | Export to JSON | | `engram import <file>` | Import from JSON | | `engram sync` | Git sync export/import | | `engram projects list\|consolidate\|prune` | Manage project names | | `engram obsidian-export` | Export to Obsidian vault (beta) | | `engram version` | Show version | Full CLI with all flags → [docs/ARCHITECTURE.md#cli-reference](docs/ARCHITECTURE.md#cli-reference) ## 文档 | Doc | Description | |-----|-------------| | [Installation](docs/INSTALLATION.md) | All install methods + platform support | | [Agent Setup](docs/AGENT-SETUP.md) | Per-agent configuration + Memory Protocol | | [Architecture](docs/ARCHITECTURE.md) | How it works + MCP tools + project structure | | [Plugins](docs/PLUGINS.md) | OpenCode & Claude Code plugin details | | [Comparison](docs/COMPARISON.md) | Why Engram vs claude-mem | | [Intended Usage](docs/intended-usage.md) | Mental model — how Engram is meant to be used | | [Obsidian Brain](docs/beta/obsidian-brain.md) | Export memories as Obsidian knowledge graph (beta) | | [Contributing](CONTRIBUTING.md) | Contribution workflow + standards | | [Full Docs](DOCS.md) | Complete technical reference | ## 许可证 MIT **Inspired by [claude-mem](https://github.com/thedotmack/claude-mem)** — but agent-agnostic, simpler, and built different. ## 贡献者 <a href="https://github.com/Gentleman-Programming/engram/graphs/contributors"> <img src="https://contrib.rocks/image?repo=Gentleman-Programming/engram&max=100" /> </a> </div><div><strong>标签:</strong>Agent无关, AI编码代理, CLI, EVTX分析, FTS5, Go语言, Homebrew, HTTP API, MCP服务器, Python脚本, SQLite, TUI, WiFi技术, 全文本搜索, 单机二进制, 威胁情报, 工程化工具, 开发者工具, 持久化内存, 搜索引擎, 数据库, 文档结构分析, 日志审计, 程序破解, 记忆系统, 跨平台安装, 零依赖</div></article></div> <!-- 人机验证 --> <script> (function () { var base = (document.querySelector('base') && document.querySelector('base').getAttribute('href')) || ''; var path = base.replace(/\/?$/, '') + '/cap-wasm/cap_wasm.min.js'; window.CAP_CUSTOM_WASM_URL = new URL(path, window.location.href).href; })(); </script> </body> </html>