> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Gentleman-Programming/engram/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Persistent memory system for AI coding agents

<img className="block" src="https://github.com/user-attachments/assets/32ed8985-841d-49c3-81f7-2aabc7c7c564" alt="Engram Header" />

## What is Engram?

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

## Key Features

<CardGroup cols={2}>
  <Card title="14 MCP Tools" icon="tools" href="/features/mcp-tools">
    Memory operations via Model Context Protocol — save, search, context, timeline, and more
  </Card>

  <Card title="SQLite + FTS5" icon="database" href="/concepts/architecture">
    Fast full-text search with zero external dependencies
  </Card>

  <Card title="HTTP REST API" icon="globe" href="/api/overview">
    RESTful API on port 7437 for integrations
  </Card>

  <Card title="Terminal UI" icon="terminal" href="/features/terminal-ui">
    Interactive TUI built with Bubbletea for browsing memories
  </Card>

  <Card title="Git Sync" icon="code-branch" href="/features/git-sync">
    Share memories across machines with compressed chunks
  </Card>

  <Card title="Multi-Agent Support" icon="robot" href="/agents/overview">
    Works with 8+ AI coding agents out of the box
  </Card>

  <Card title="Single Binary" icon="box" href="/installation">
    Zero runtime dependencies — just one Go binary
  </Card>

  <Card title="Privacy Built-In" icon="shield" href="/features/privacy">
    Redact sensitive data with privacy tags
  </Card>
</CardGroup>

## How It Works

Engram trusts the **agent** to decide what's worth remembering — not a firehose of raw tool calls.

### The Agent Saves, Engram Stores

<Steps>
  <Step title="Agent completes significant work">
    Bugfix, architecture decision, discovery, configuration change, etc.
  </Step>

  <Step title="Agent calls mem_save">
    Structured summary with:

    * **title**: "Fixed N+1 query in user list"
    * **type**: `bugfix`
    * **content**: What/Why/Where/Learned format
  </Step>

  <Step title="Engram persists to SQLite">
    Data is indexed with FTS5 for fast searching
  </Step>

  <Step title="Next session: agent searches memory">
    Gets relevant context from previous sessions
  </Step>
</Steps>

### Session Lifecycle

```
Session starts → Agent works → Agent saves memories proactively
                                    ↓
Session ends → Agent writes session summary (Goal/Discoveries/Accomplished/Files)
                                    ↓
Next session starts → Previous session context is injected automatically
```

## Why Engram?

<AccordionGroup>
  <Accordion title="Agent-Agnostic">
    Works with **any** MCP-compatible agent. Not locked to Claude Code like similar tools.

    Supported agents:

    * OpenCode
    * Claude Code
    * Gemini CLI
    * Codex
    * VS Code (Copilot)
    * Antigravity
    * Cursor
    * Windsurf
    * Any other MCP-compatible agent
  </Accordion>

  <Accordion title="Single Binary, Zero Dependencies">
    No Node.js, no Python, no Bun, no Docker, no ChromaDB, no vector database, no worker processes.

    **One binary, one SQLite file.**

    Uses `modernc.org/sqlite` — pure Go implementation with no CGO. True cross-platform binary distribution.
  </Accordion>

  <Accordion title="Agent-Curated Memories">
    The agent decides what to save via `mem_save` — no raw tool call firehose.

    **Why?** Raw tool calls (`edit: {file: "foo.go"}`, `bash: {command: "go build"}`) are noisy and pollute search results. The agent's curated summaries are higher signal, more searchable, and don't bloat the database.

    Shell history and git provide the raw audit trail.
  </Accordion>

  <Accordion title="FTS5 vs Vector Databases">
    SQLite's FTS5 covers 95% of use cases without the complexity of ChromaDB/Pinecone.

    * No separate database server
    * No embedding models
    * No vector similarity calculations
    * Fast keyword search with BM25 ranking
    * Simple query sanitization
  </Accordion>

  <Accordion title="Privacy at Two Layers">
    `<private>...</private>` tags are stripped at **two** levels:

    1. **Plugin layer** (TypeScript) — stripped before data leaves the process
    2. **Store layer** (Go) — `stripPrivateTags()` runs before any DB write

    Defense in depth ensures sensitive data never hits disk.
  </Accordion>
</AccordionGroup>

## Progressive Disclosure (3-Layer Pattern)

Token-efficient memory retrieval — don't dump everything, drill in:

<Steps>
  <Step title="mem_search">
    Search for relevant observations

    ```
    mem_search "auth middleware" → compact results with IDs (~100 tokens each)
    ```
  </Step>

  <Step title="mem_timeline">
    Get chronological context around a result

    ```
    mem_timeline observation_id=42 → what happened before/after in that session
    ```
  </Step>

  <Step title="mem_get_observation">
    Get full untruncated content

    ```
    mem_get_observation id=42 → full observation with all details
    ```
  </Step>
</Steps>

## Next Steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Get up and running in 5 minutes
  </Card>

  <Card title="Installation" icon="download" href="/installation">
    Install on macOS, Linux, or Windows
  </Card>

  <Card title="Agent Setup" icon="plug" href="/agents/overview">
    Connect your AI coding agent
  </Card>

  <Card title="Core Concepts" icon="book" href="/concepts/how-it-works">
    Understand how Engram works
  </Card>
</CardGroup>
