Environment Variables
ENGRAM_DATA_DIR
Override the default data directory where Engram stores the SQLite database and related files.string
default:"~/.engram"
Path to data directory. Will be created if it doesn’t exist.
ENGRAM_PORT
Override the default HTTP server port.number
default:"7437"
Port number for HTTP API server (1024-65535)
- Command-line argument:
engram serve 8080 - Environment variable:
ENGRAM_PORT=8080 - Default:
7437
Database Configuration
Engram uses SQLite with the following built-in configuration:SQLite Settings
string
default:"WAL"
Write-Ahead Logging for concurrent reads during writes
number
default:"5000"
Milliseconds to wait before timing out on locked database (5 seconds)
string
default:"NORMAL"
Balance between safety and performance
boolean
default:"ON"
Enforce referential integrity constraints
boolean
default:"enabled"
Full-text search enabled on observations and prompts
MCP Server Configuration
Tool Profiles
Control which MCP tools are exposed to agents:profile
11 tools for AI coding agents:
mem_save- Save observationsmem_search- Search memoriesmem_context- Recent contextmem_session_summary- Session summariesmem_session_start- Start sessionsmem_session_end- End sessionsmem_get_observation- Get full contentmem_suggest_topic_key- Topic key suggestionsmem_capture_passive- Passive learning extractionmem_save_prompt- Save user promptsmem_update- Update observations
profile
3 tools for manual curation:
mem_delete- Delete observationsmem_stats- System statisticsmem_timeline- Timeline view
profile
All 14 tools (agent + admin)
Agent Configuration Files
Engram integrates with various AI coding agents through their configuration files.OpenCode
Plugin Location:~/.config/opencode/plugins/engram.ts
MCP Config: ~/.config/opencode/opencode.json
Claude Code
Plugin Location:~/.claude/plugins/engram/
MCP Config: ~/.claude/mcp.json
~/.claude/settings.json
Gemini CLI
Config Location:~/.gemini/settings.json
~/.gemini/system.md
Compaction Recovery: ~/.gemini/.env
Install:
Codex
Config Location:~/.codex/config.toml
Git Sync Configuration
Sync Directory Structure
.gitignore
Add to your project’s.gitignore:
Sync Workflow
Export:engram sync --import at startup if .engram/manifest.json exists.
HTTP API Configuration
The HTTP server binds to127.0.0.1 (localhost only) for security.
Server Details
string
default:"127.0.0.1"
Server only accepts local connections
number
default:"7437"
Configurable via
ENGRAM_PORT or command-line argumentboolean
default:"false"
Not enabled - local access only
Health Check
Privacy Configuration
Private Tag Stripping
Engram strips<private> tags at two levels:
- Plugin layer (TypeScript) - Before sending to HTTP API
- Store layer (Go) - Inside
AddObservation()andAddPrompt()
Performance Tuning
Database Optimization
Engram uses SQLite’s WAL mode for optimal performance:- Concurrent reads during writes
- Checkpoint automatic background
- Page size 4096 bytes (default)
Search Performance
FTS5 query optimization:- Queries are sanitized and quoted automatically
- Search limited to 20 results max
- Indexes on
session_id,project,scope,created_at
Memory Usage
Typical memory footprint:- Binary size: ~15MB (includes SQLite)
- Runtime memory: ~10-20MB (idle)
- Database size: ~1KB per observation (compressed)
Troubleshooting
Database Locked
If you see “database is locked” errors:Port Already in Use
Data Directory Permissions
Sync Conflicts
Chunks are content-hashed and never conflict. If manifest conflicts:Default Values Reference
Configuration Files Location Summary
Install any agent: