# engram

Adds local persistent memory to AI agents using SQLite and on-device embeddings without external APIs. Useful when keeping agent context between sessions entirely on your machine.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 9
- Author: HBarefoot
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/HBarefoot/engram
- Updated: 2026-07-07
- HTML: https://affpapa.org/en/nevibecode/mcp/hbarefoot-engram

## What it does

The server attaches persistent storage to your agent process without requiring external cloud accounts or containers. It stores records inside a local SQLite database and handles semantic lookup through a lightweight `all-MiniLM-L6-v2` embedding model. That model takes roughly 23 MB and caches locally under `~/.engram/models`. The runtime requires Node.js 20 or higher to operate.

Through MCP, the server exposes 6 distinct tools across 5 functional categories. Every write passes through automated secret detection. Private keys, API tokens, database connection strings, and JWT values are blocked before they reach the database file. If you run Ollama locally, you can also enable an optional model layer for sharper entity extraction.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add engram -- npx -y @hbarefoot/engram
```

### Codex

**Platform CLI**
```bash
codex mcp add hbarefoot-engram -- npx -y @hbarefoot/engram
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "hbarefoot-engram": {
            "command": "npx",
            "args": [
                "-y",
                "@hbarefoot/engram"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "hbarefoot-engram": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@hbarefoot/engram"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add hbarefoot-engram npx -y @hbarefoot/engram
```

## When to use it
- keep project context intact across separate agent sessions
- retrieve stored knowledge by meaning without cloud requests
- prevent API tokens and database secrets from entering memory
- reconcile conflicting facts through side-by-side review

## Example prompts
- Remember that we use Vitest instead of Jest for test suites in this project.
- Recall the naming conventions we established for Git branches.
- Check your memory for our staging deployment guidelines.

## Similar
- [engram-server](https://affpapa.org/en/nevibecode/mcp/engram-server.md) — MCP server · ★ 23
- [Infimium](https://affpapa.org/en/nevibecode/mcp/infimium.md) — MCP server · ★ 25
- [Kybase](https://affpapa.org/en/nevibecode/mcp/kybase.md) — MCP server · ★ 6
- [Pensyve](https://affpapa.org/en/nevibecode/mcp/pensyve.md) — MCP server · ★ 97
- [clude](https://affpapa.org/en/nevibecode/mcp/clude.md) — MCP server · ★ 22
- [genome](https://affpapa.org/en/nevibecode/mcp/genome.md) — MCP server · ★ 10

## Other versions with the same name
- [engram · nickcirv](https://affpapa.org/en/nevibecode/mcp/nickcirv-engram.md) — ★ 143
- [engram · tstockham96](https://affpapa.org/en/nevibecode/mcp/tstockham96-engram.md) — ★ 47
- [engram · kael-bit](https://affpapa.org/en/nevibecode/mcp/kael-bit-engram.md) — ★ 28
- [Engram · get-engram](https://affpapa.org/en/nevibecode/mcp/engram.md) — ★ 20
- [Engram · rwnalds](https://affpapa.org/en/nevibecode/mcp/rwnalds-engram.md) — ★ 17

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
