Skip to main content
Engram provides a comprehensive command-line interface for managing persistent memory. All commands interact with the local SQLite database at ~/.engram/engram.db.

Installation

After installing Engram, the binary is available at $GOPATH/bin/engram (typically ~/go/bin/engram).

Usage

Core Commands

serve

Start the HTTP API server for agent integrations.
number
Port number for the HTTP server. Default: 7437 (ENGR on phone keypad).
Examples:
Output:

mcp

Start the MCP (Model Context Protocol) server for AI agent integrations.
string
Filter which tools to expose. Options:
  • agent - 11 tools for AI coding agents
  • admin - 3 tools for manual curation (delete, stats, timeline)
  • all - All 14 tools (default)
  • Comma-separated profiles: agent,admin
  • Individual tool names: mem_save,mem_search
Tool Profiles:
  • agent (11 tools): mem_save, mem_search, mem_context, mem_session_summary, mem_session_start, mem_session_end, mem_get_observation, mem_suggest_topic_key, mem_capture_passive, mem_save_prompt, mem_update
  • admin (3 tools): mem_delete, mem_stats, mem_timeline
Examples:
MCP Configuration Example: Add to your agent’s config file:

tui

Launch the interactive terminal UI for browsing memories.
Features:
  • Browse sessions and observations
  • Full-text search with FTS5
  • View timelines and context
  • Vim-style navigation (j/k, Enter, Esc)
  • Catppuccin Mocha color scheme
Output:

Search & Retrieval

Search memories using FTS5 full-text search.
string
required
Search query - natural language or keywords. Multiple words are automatically combined.
string
Filter by observation type: decision, architecture, bugfix, pattern, config, discovery, learning, manual
string
Filter by project name
string
Filter by scope: project or personal
number
Maximum results to return (default: 10)
Examples:
Output:

context

Show recent context from previous sessions.
string
Filter context by project name. If omitted, shows all recent context.
Examples:
Output:

timeline

Show chronological context around a specific observation.
number
required
ID of the observation to center the timeline on
number
Number of observations to show before the target (default: 5)
number
Number of observations to show after the target (default: 5)
Examples:
Output:

Memory Management

save

Save a memory from the command line.
string
required
Short, searchable title for the memory
string
required
Memory content. Use the structured format with What, Why, Where, Learned
string
Observation type: decision, architecture, bugfix, pattern, config, discovery, learning (default: manual)
string
Project name to associate with this memory
string
Scope: project (default) or personal
string
Topic key for upserts (e.g., architecture/auth-model). Memories with the same topic_key in the same project+scope are updated instead of creating duplicates.
Examples:
Output:

stats

Show memory system statistics.
Output:

Import & Export

export

Export all memories to JSON.
string
Output filename (default: engram-export.json)
Examples:
Output:
Export Format:

import

Import memories from a JSON export file.
string
required
JSON file to import (created by engram export)
Examples:
Output:
Import uses INSERT OR IGNORE for sessions to skip duplicates. All operations run in a single atomic transaction.

Git Sync

sync

Export and import memories using Git-based chunked sync.
boolean
Import new chunks from .engram/ directory into local database
boolean
Show sync status (local vs remote chunks, pending imports)
string
Filter export to a specific project. Default: current directory name
boolean
Export ALL projects (ignore directory-based filter)
Examples:
Export Output:
Import Output:
Status Output:
Directory Structure:
Each sync creates a new chunk file - old chunks are never modified. This prevents merge conflicts when multiple developers sync to the same repository.

Agent Setup

setup

Install Engram plugin for AI coding agents.
string
Agent name: opencode, claude-code, gemini-cli, or codex. If omitted, shows interactive selection.
Supported Agents:
  • opencode - Installs to ~/.config/opencode/plugins/engram.ts
  • claude-code - Installs to ~/.claude/plugins/
  • gemini-cli - Configures ~/.gemini/settings.json
  • codex - Configures ~/.codex/config.toml
Examples:
Interactive Output:

Utility Commands

version

Print Engram version.
Output:

help

Show help message.
Output:

Exit Codes

  • 0 - Success
  • 1 - Error (invalid command, missing arguments, operation failed)

Error Handling

All commands print errors to stderr: