engram README

The project's README from github.com/Gentleman-Programming/engram. As one markdown file: README.md.

Engram — One Brain. Local or Cloud.

Persistent memory for AI coding agents
One brain. Local or cloud. Agent-agnostic, single binary, zero dependencies.

Website • Gentle-AI • Gentle-AI Wiki

Installation • Release Policy • Engram Cloud • Agent Setup • Codebase Guide • Architecture • Plugins • Team Usage • Contributing • Full Docs

Star History Chart

engram /ˈen.ɡræm/ — neuroscience: the physical trace of a memory in the brain.

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 through CLI, HTTP API, MCP, and an interactive TUI. It works with any MCP-compatible agent, including Claude Code, OpenCode, Gemini CLI, Codex, VS Code (Copilot), Antigravity, Cursor, and Windsurf.

No Node.js, Python, or Docker is required: one binary, one SQLite file.

Agent (Claude Code / OpenCode / Gemini CLI / Codex / VS Code / Antigravity / ...)
    ↓ MCP stdio
Engram (single Go binary)
    ↓
SQLite + FTS5 (~/.engram/engram.db)

For agents

Treat Engram as a curated project memory, not a transcript sink. Use this operating contract throughout the session.

  1. Orient before writing. Start with mem_current_project to confirm the resolved project and its source. At the start of related work, use mem_context and mem_search to recover the relevant history.
  2. Search before repeating. Before revisiting a decision, bug, convention, or request that may already be known, search with focused terms. Search results are previews, not the complete record.
  3. Retrieve progressively. Use mem_search for candidates, mem_timeline when surrounding session context matters, and mem_get_observation before relying on a full observation.
  4. Save significant knowledge deliberately. Save completed bug fixes, decisions, discoveries, configuration changes, patterns, and durable user constraints with mem_save. Do not capture raw tool output or every conversational turn.
  5. Keep evolving knowledge stable. Give an evolving topic a stable topic_key such as architecture/auth-model; reuse it to update that topic rather than creating competing memories. Use mem_suggest_topic_key when the key is unclear.
  6. Leave a handoff. Before ending a session, save a mem_session_summary with the goal, instructions, discoveries, accomplished work, next steps, and relevant files.
  7. Recover after compaction. Persist the compacted handoff with mem_session_summary first. Then call mem_context to recover recent session history before continuing.

A useful memory is structured

**What**: Added retry-safe upload handling.
**Why**: Retries could create duplicate records.
**Where**: internal/upload/handler.go
**Learned**: Reuse the request id as the idempotency key.

Use a short, searchable title and a fitting type with that content. The full Memory Protocol defines the durable-save rules and session-summary shape.

Choose MCP tools by intent

Tool availability can vary by MCP profile. Start with the intent, then use your client's tool discovery mechanism (such as ToolSearch) only when a deferred tool is needed.

Intent Start with
Confirm the project and recover recent work mem_current_project, mem_context
Find prior knowledge without repeating work mem_search
Inspect a result in enough detail mem_timeline, mem_get_observation
Save or refine durable knowledge mem_save, mem_update, mem_suggest_topic_key
Preserve the user's request mem_save_prompt
Hand off or close a session mem_session_summary, mem_session_start, mem_session_end
Review stale knowledge or memory relationships mem_review, mem_judge, mem_compare
Diagnose project or store state mem_doctor

For parameters and the complete, current tool reference, see the full documentation.

Quick start

Install

For production use and security support, install the latest stable release from GitHub Releases. Release candidates are prerelease validation and feedback builds; choose one only when you accept prerelease risk. See the Release Policy before upgrading.

Homebrew remains on the stable v1.20.0 line:

brew install gentleman-programming/tap/engram

For Windows, Linux, source builds, and all installation methods, see Installation.

Set up your agent

Run the setup command for the agent you use, then restart that agent. engram setup writes the applicable MCP and integration configuration; it does not require you to start a server for the usual stdio-only setup.

Agent Setup
Claude Code claude plugin marketplace add Gentleman-Programming/engram && claude plugin install engram
Pi engram setup pi
OpenCode engram setup opencode
Gemini CLI engram setup gemini-cli
Codex engram setup codex
Antigravity CLI engram setup antigravity-cli
Windsurf engram setup windsurf
Qwen Code engram setup qwen
Kiro engram setup kiro
Cursor engram setup cursor
VS Code (Copilot) engram setup vscode-copilot
Kilo Code engram setup kilocode
Another MCP-compatible agent Manual MCP setup

See Agent Setup for per-agent configuration, plugin behavior, manual MCP setup, compaction resilience, and troubleshooting. Pi users can also find the package at gentle-engram.

Local first, portable when needed

Engram keeps memory local by default. The local SQLite database is authoritative; Git Sync exports portable compressed chunks for sharing across machines, and Engram Cloud is optional, project-scoped replication/shared access with browser visibility.

Need Start here
Local memory and the runtime model Architecture
Share memory with Git Git Sync reference
Use optional Cloud replication Engram Cloud
Diagnose or recover Cloud operations Cloud troubleshooting

For an existing local database, use the guided upgrade sequence. If the dry run reports changes, apply them before bootstrap; otherwise continue directly to bootstrap.

engram cloud upgrade doctor --project <project>
engram cloud upgrade repair --project <project> --dry-run
engram cloud upgrade repair --project <project> --apply # only when the dry run reports changes
engram cloud upgrade bootstrap --project <project>
engram cloud upgrade status --project <project>

See the Cloud upgrade reference for apply, rollback, and recovery details.

Project-aware reads

Project-aware reads use the canonical current project when no selector is supplied: an explicit project, then ENGRAM_PROJECT, then cwd detection. Use --all in the CLI or all_projects=true in HTTP for an intentional global read; do not combine either with an explicit project. engram context retains its positional project as an alias for --project. GET /sync/status supports one resolved project and rejects all_projects=true because its provider cannot aggregate status.

Terminal UI

engram tui

TUI Dashboard TUI recent observations TUI Observation Detail TUI Search Results

Navigate with j/k, use Enter to drill in, c to copy content to the clipboard, / to search, and Esc to go back. The TUI uses the Catppuccin Mocha theme.

Documentation

Doc Description
Installation Platform support and all installation methods
Release Policy Stable, RC, security-support, upgrade, and rollback guidance
Agent Setup Per-agent configuration and compaction resilience
Intended Usage The human mental model for using Engram
Architecture Memory model, tool behavior, and project structure
Codebase Guide Repository structure, flows, and implementation landmarks
Plugins OpenCode and Claude Code plugin details
Team Usage Shared-memory conventions
Engram Cloud Cloud quickstart, deployment, and technical links
Doctor Operational diagnosis and repair workflows
Binary self-testing Isolated reliability and performance checks for released binaries
Beta Testing Isolated beta testing flows and cleanup guidance
Comparison Engram compared with claude-mem
Obsidian Brain Export memories as an Obsidian knowledge graph (beta)
Full Docs Complete CLI, environment, API, and operational reference

Dashboard contributors: if you modify .templ files in internal/cloud/dashboard/, run make templ to regenerate before committing. See Dashboard templ regeneration.

Contributing

Every change starts with an approved issue. See Contributing for the issue-first workflow, labels, review requirements, and contributor standards.

Trademark notice: The Engram names and logos are trademarks of Alan Buscaglia. The MIT License applies to the code; it does not permit implying endorsement or official affiliation. See TRADEMARKS.md.

License

MIT


Inspired by claude-mem — but agent-agnostic, simpler, and built different.

Contributors

engram (Gentleman-Programming/engram)

Searching Database…

7.4K ·GitHub
这是干什么用的?Engram 是一个面向 AI 编程智能体的持久记忆系统——它给你的智能体装上一个跨会话的大脑,不会在会话结束后把一切忘光。
它是云服务,还是在我自己的电脑上运行?它在本地运行:一个 Go 二进制文件,底层是一个带 FTS5 全文检索功能的 SQLite 文件,通过 CLI、HTTP API、MCP 服务器和交互式 TUI 提供服务。云同步是可选的。
怎么把它接到我的编程智能体上?从 GitHub Releases 安装稳定版本(也可以用 Homebrew),然后为你的智能体运行对应的 setup 命令——例如 'engram setup cursor'——再重启它。Claude Code 则是通过它的插件市场安装的。
我需要先装 Node.js、Docker 之类的东西吗?不需要。它是一个零依赖的单个二进制文件——不要求 Node.js、Python 或 Docker,只需要它自己的一个 SQLite 文件。
哪些编程智能体能用它?任何兼容 MCP 的智能体都可以。一条命令即可完成配置的有 Claude Code、OpenCode、Gemini CLI、Codex、Cursor、Windsurf、VS Code (Copilot)、Antigravity、Pi、Qwen Code、Kiro 和 Kilo Code;其他智能体可通过手动 MCP 配置接入。
我的项目记忆到底存在哪里?默认存在本地:你电脑上的 SQLite 数据库是权威数据源。Git Sync 可以导出便于携带的压缩数据块,方便在多台机器之间共享;Engram Cloud 复制是可选的,并且按项目划分。
代码是 MIT 的——有什么坑吗?有一点:Engram 这个名称和标志是 Alan Buscaglia 的商标,所以许可证只覆盖代码,不能暗示该项目为你背书或与你存在官方关联。
智能体日常实际是怎么用它干活的?通过 MCP 工具来用:memsearch 查找已有的知识,避免智能体重复劳动;memsave 保存决策、bug 修复和长期有效的用户约束;memcontext 在开始相关工作时恢复最近的历史记录。
我的智能体上下文被压缩后会发生什么?系统为此设计了恢复机制:流程是先用 memsessionsummary 保存一份压缩后的交接摘要,然后调用 memcontext 恢复最近的会话历史,再继续工作。
在终端界面里我能做什么?可以交互式地浏览和查看记忆:j/k 移动,Enter 深入查看,c 复制内容,/ 搜索,Esc 返回。它自带 Catppuccin Mocha 主题。
怎么在多台机器或团队成员之间共享记忆?Git Sync 可以把本地数据库导出成便于携带的压缩数据块,方便在多台机器之间共享;Engram Cloud 则提供可选的按项目划分的复制功能,还能在浏览器里查看。
为什么不直接用 claude-mem,而要做这个?作者说它受 claude-mem 启发,但不绑定特定智能体、更简单,而且走的是不同的路线——记忆功能适用于任何兼容 MCP 的智能体,而不是只针对 Claude。
Size
35.5 MB
Stars
7.4K
Age
8mo
Commits · 90 Days