Gentleman-Programming

engram

Built by Gentleman-Programming β€’ 1,936 stars

What is engram?

Persistent memory system for AI coding agents. Agent-agnostic Go binary with SQLite + FTS5, MCP server, HTTP API, CLI, and TUI.

How to use engram?

1. Install a compatible MCP client (like Claude Desktop). 2. Open your configuration settings. 3. Add engram using the following command: npx @modelcontextprotocol/engram 4. Restart the client and verify the new tools are active.
πŸ›‘οΈ Scoped (Restricted)
npx @modelcontextprotocol/engram --scope restricted
πŸ”“ Unrestricted Access
npx @modelcontextprotocol/engram

Key Features

Native MCP Protocol Support
Real-time Tool Activation & Execution
Verified High-performance Implementation
Secure Resource & Context Handling

Optimized Use Cases

Extending AI models with custom local capabilities
Automating system workflows via natural language
Connecting external data sources to LLM context windows

engram FAQ

Q

Is engram safe?

Yes, engram follows the standardized Model Context Protocol security patterns and only executes tools with explicit user-granted permissions.

Q

Is engram up to date?

engram is currently active in the registry with 1,936 stars on GitHub, indicating its reliability and community support.

Q

Are there any limits for engram?

Usage limits depend on the specific implementation of the MCP server and your system resources. Refer to the official documentation below for technical details.

Official Documentation

View on GitHub
<p align="center"> <img width="1024" height="340" alt="image" src="https://github.com/user-attachments/assets/32ed8985-841d-49c3-81f7-2aabc7c7c564" /> </p> <p align="center"> <strong>Persistent memory for AI coding agents</strong><br> <em>Agent-agnostic. Single binary. Zero dependencies.</em> </p> <p align="center"> <a href="docs/INSTALLATION.md">Installation</a> &bull; <a href="docs/AGENT-SETUP.md">Agent Setup</a> &bull; <a href="docs/ARCHITECTURE.md">Architecture</a> &bull; <a href="docs/PLUGINS.md">Plugins</a> &bull; <a href="CONTRIBUTING.md">Contributing</a> &bull; <a href="DOCS.md">Full Docs</a> </p>

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 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)

Quick Start

Install

brew install gentleman-programming/tap/engram

Windows, Linux, and other install methods β†’ docs/INSTALLATION.md

Setup Your Agent

AgentOne-liner
Claude Codeclaude plugin marketplace add Gentleman-Programming/engram && claude plugin install engram
OpenCodeengram setup opencode
Gemini CLIengram setup gemini-cli
Codexengram setup codex
VS Codecode --add-mcp '{"name":"engram","command":"engram","args":["mcp"]}'
Cursor / Windsurf / Any MCPSee docs/AGENT-SETUP.md

Full per-agent config, Memory Protocol, and compaction survival β†’ docs/AGENT-SETUP.md

That's it. No Node.js, no Python, no Docker. One binary, one SQLite file.

How It Works

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

MCP Tools

ToolPurpose
mem_saveSave observation
mem_updateUpdate by ID
mem_deleteSoft or hard delete
mem_suggest_topic_keyStable key for evolving topics
mem_searchFull-text search
mem_session_summaryEnd-of-session save
mem_contextRecent session context
mem_timelineChronological drill-in
mem_get_observationFull content by ID
mem_save_promptSave user prompt
mem_statsMemory statistics
mem_session_startRegister session start
mem_session_endMark session complete
mem_capture_passiveExtract learnings from text output
mem_merge_projectsMerge project name variants (admin)

Full tool reference β†’ docs/ARCHITECTURE.md#mcp-tools

Terminal UI

engram tui
<p align="center"> <img src="assets/tui-dashboard.png" alt="TUI Dashboard" width="400" /> <img width="400" alt="image" src="https://github.com/user-attachments/assets/0308991a-58bb-4ad8-9aa2-201c059f8b64" /> <img src="assets/tui-detail.png" alt="TUI Observation Detail" width="400" /> <img src="assets/tui-search.png" alt="TUI Search Results" width="400" /> </p>

Navigation: j/k vim keys, Enter to drill in, / to search, Esc back. Catppuccin Mocha theme.

Git Sync

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

CLI Reference

CommandDescription
engram setup [agent]Install agent integration
engram serve [port]Start HTTP API (default: 7437)
engram mcpStart MCP server (stdio). Accepts --project or ENGRAM_PROJECT
engram tuiLaunch terminal UI
engram search <query>Search memories
engram save <title> <msg>Save a memory
engram timeline <obs_id>Chronological context
engram context [project]Recent session context
engram statsMemory statistics
engram export [file]Export to JSON
engram import <file>Import from JSON
engram syncGit sync export
engram projects listShow all projects with observation/session/prompt counts
engram projects consolidateInteractive merge of similar project names (--all, --dry-run)
engram projects pruneRemove projects with 0 observations (--dry-run)
engram versionShow version

Documentation

DocDescription
InstallationAll install methods + platform support
Agent SetupPer-agent configuration + Memory Protocol
ArchitectureHow it works + MCP tools + project structure
PluginsOpenCode & Claude Code plugin details
ComparisonWhy Engram vs claude-mem
ContributingContribution workflow + standards
Full DocsComplete technical reference

License

MIT


Inspired by claude-mem β€” but agent-agnostic, simpler, and built different.

Global Ranking

-
Trust ScoreMCPHub Index

Based on codebase health & activity.

Manual Config

{ "mcpServers": { "engram": { "command": "npx", "args": ["engram"] } } }