# Engram: Persistent Memory System for AI Coding Agents in Go

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/gentleman-programming-engram
Generated for open source discovery and AI-assisted research.

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.

GitHub: https://github.com/Gentleman-Programming/engram
OSRepos URL: https://osrepos.com/repo/gentleman-programming-engram

## 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.

## Topics

- Go
- AI
- AgentMemory
- SQLite
- FTS5
- DeveloperTools
- CLI
- OpenSource

## Repository Information

Last analyzed by OSRepos: Tue Jun 02 2026 01:59:45 GMT+0100 (Western European Summer Time)
Detail views: 12
GitHub clicks: 20

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## 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:

bash
brew install gentleman-programming/tap/engram


Detailed installation instructions for Windows, Linux, and other platforms are available in the official documentation: [Installation Guide](https://github.com/Gentleman-Programming/engram/blob/main/docs/INSTALLATION.md).

## 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:

bash
engram tui


For sharing memories across machines, Engram offers Git Sync, which uses compressed chunks to avoid merge conflicts and manage file sizes:

bash
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](https://github.com/Gentleman-Programming/engram "Engram GitHub Repository" target="_blank")
*   **Installation Guide**: [https://github.com/Gentleman-Programming/engram/blob/main/docs/INSTALLATION.md](https://github.com/Gentleman-Programming/engram/blob/main/docs/INSTALLATION.md "Engram Installation Guide" target="_blank")
*   **Agent Setup**: [https://github.com/Gentleman-Programming/engram/blob/main/docs/AGENT-SETUP.md](https://github.com/Gentleman-Programming/engram/blob/main/docs/AGENT-SETUP.md "Engram Agent Setup" target="_blank")
*   **Full Documentation**: [https://github.com/Gentleman-Programming/engram/blob/main/DOCS.md](https://github.com/Gentleman-Programming/engram/blob/main/DOCS.md "Engram Full Documentation" target="_blank")