Engram: Persistent Memory System for AI Coding Agents in Go

Summary
Engram is an agent-agnostic, persistent memory system designed for AI coding agents. Built as a single Go binary, it leverages SQLite with FTS5 for efficient storage and retrieval of agent memories. It offers various interfaces including a CLI, HTTP API, MCP server, and a TUI, ensuring broad compatibility and ease of use for any agent supporting the Memory Protocol.
Repository Info
Tags
Click on any tag to explore related repositories
Introduction
Engram, developed by Gentleman-Programming, provides a crucial missing piece for AI coding agents: persistent memory. Often, AI agents lose all context and learned information at the end of a session. Engram solves this by giving agents a "brain" where they can store, retrieve, and manage their observations and decisions across sessions.
This system is implemented as a lightweight, single Go binary with zero external dependencies, making it highly portable and easy to deploy. It uses SQLite with FTS5 for robust full-text search capabilities, allowing agents to quickly find relevant past memories. Engram is agent-agnostic, designed to work with any AI coding agent that supports the Memory Protocol (MCP), such as Claude Code, OpenCode, Gemini CLI, and others.
Installation
Getting started with Engram is straightforward. For macOS users, you can install it via Homebrew:
brew install gentleman-programming/tap/engram
Detailed installation instructions for Windows, Linux, and other platforms are available in the official documentation: Installation Guide.
Examples
Engram integrates seamlessly with various AI agents. Here are a few quick setup examples:
- Claude Code:
claude plugin marketplace add Gentleman-Programming/engram && claude plugin install engram - Pi:
engram setup pi - OpenCode:
engram setup opencode - VS Code (Copilot):
code --add-mcp '{"name":"engram","command":"engram","args":["mcp"]}'
Once set up, agents can save memories using tools like mem_save and retrieve context with mem_search. For instance, an agent might save a memory after completing a significant task:
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
Engram also features a powerful Terminal User Interface (TUI) for human interaction, allowing you to browse, search, and manage memories directly from your terminal:
engram tui
For sharing memories across machines, Engram offers Git Sync, which uses compressed chunks to avoid merge conflicts and manage file sizes:
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
Why Use Engram
Engram stands out as a robust solution for AI agent memory due to several key advantages:
- Agent-Agnostic: Works with any agent supporting the Memory Protocol (MCP), providing a universal memory layer.
- Single Binary, Zero Dependencies: Extremely easy to install and run, eliminating complex setup or dependency management.
- Persistent & Searchable: Utilizes SQLite with FTS5 for reliable storage and fast, full-text search capabilities, ensuring agents can always access relevant past information.
- Comprehensive Toolset: Offers a rich set of MCP tools for saving, updating, searching, and managing memories, along with session lifecycle management and conflict surfacing.
- Flexible Interfaces: Provides a CLI for scripting, an HTTP API for programmatic access, an MCP server for agent communication, and an interactive TUI for human oversight.
- Cloud Integration (Opt-In): Supports optional cloud replication for sharing memories across teams and machines, with local SQLite remaining the source of truth.
- Memory Conflict Surfacing: Beta features allow agents to detect and semantically judge conflicting memories, enhancing the quality of stored knowledge.
Links
- GitHub Repository: https://github.com/Gentleman-Programming/engram
- Installation Guide: https://github.com/Gentleman-Programming/engram/blob/main/docs/INSTALLATION.md
- Agent Setup: https://github.com/Gentleman-Programming/engram/blob/main/docs/AGENT-SETUP.md
- Full Documentation: https://github.com/Gentleman-Programming/engram/blob/main/DOCS.md