About Engram
Engram is an MCP server published by Gentleman-Programming in the Data category: persistent memory system for AI coding agents. Agent-agnostic Go binary with SQLite + FTS5, MCP server, HTTP API, CLI, and TUI. Conduid read 27 tools from its source: mem_capture_passive, mem_compare, mem_consolidate, mem_context, mem_current_project, mem_delete and 21 more. No package is published for it, so it installs from a source checkout.
The repository has 8.4K stars and 843 forks, is licensed MIT, and its last commit was on 24 Nov 2026. The latest release is pi-v0.8.0 (14 Nov 2026): gentle-engram 0.8.0 Minor companion for Engram 3.7.2. It follows v3.7.2 (14 Nov 2026), and the 5 most recent releases go back to v3.7.0 (7 Nov 2026). It passes 5 of the 6 static checks Conduid ran on the repository; it does not pass Scoped permissions. Its topics include data.
Install
git clone https://github.com/Gentleman-Programming/engramTools (27)
mem_capture_passiveExtract and save structured learnings from text output. Use this at the end of a task to capture knowledge automatically. The tool looks for sections like "## Key Learnings:" or "## Aprendizajes Clave:" and extracts numbered or bulleted items. Each item is saved as a separate observation. Duplicates are automatically detected and skipped — safe to call multiple times with the same content.| Parameter | Type | Description |
|---|---|---|
| content * | string | The text output containing a '## Key Learnings:' section with numbered or bulleted items |
| session_id | string | Optional authoritative session ID already registered by the runtime or mem_session_start; never invent one. Omit by default; ambiguity fails closed. |
| source | string | Source identifier (e.g. 'subagent-stop', 'session-end') |
mem_comparePersist a semantic verdict you have already judged externally (with your LLM) into Engram. WHEN TO CALL: After you have evaluated two memories and reached a verdict, call mem_compare to PERSIST that verdict into the relation store. You do the judgment; mem_compare records it. PARAMS: memory_id_a (required) — integer id of the first observation (from mem_search or mem_get_observation) memory_id_b (required) — integer id of the second observation relation (required) — one of: related, compatible, scoped, conflicts_with, supersedes, not_conflict confidence (required) — float 0..1; your self-reported confidence in the verdict reasoning (required) — explanation of the verdict, max 200 chars model (optional) — your model identifier, stored for provenance (e.g. "claude-haiku-4-5") BEHAVIOR: - Persists the verdict via JudgeBySemantic with system provenance (marked_by_actor="engram"). - not_conflict: persists a judged relation and returns its sync_id, so future scans do not re-evaluate the pair. - Idempotent: calling again for the same pair updates the existing row. - Cross-project pairs are rejected. SUCCESS: Returns { "sync_id": "rel-..." } on every persisted verdict. ERROR: Returns IsError=true if IDs are unknown, relation is invalid, or cross-project pair.| Parameter | Type | Description |
|---|---|---|
| confidence * | number | Confidence score 0.0..1.0 |
| memory_id_a * | number | Integer id of the first observation (from mem_search #id) |
| memory_id_b * | number | Integer id of the second observation (from mem_search #id) |
| model | string | Your model identifier for provenance (e.g. "claude-haiku-4-5") |
| reasoning * | string | Brief explanation of the verdict (max 200 chars) |
| relation * | string | Verdict: related | compatible | scoped | conflicts_with | supersedes | not_conflict |
mem_consolidateAtomically consolidate at least two live observations owned by expected_project. Preview by default without writes; inspect the returned plan, then repeat the exact arguments with confirm=true and its opaque fingerprint. Drift refuses without writes and returns a new preview. Never automatically confirm a replacement plan or retry an uncertain write. Session/scope are inherited; this guarantees local atomicity, not remote visibility.| Parameter | Type | Description |
|---|---|---|
| confirm | boolean | Default false: preview only; true requires the preview fingerprint |
| expected_project * | string | Explicit expected canonical owner of every source, not a target-project override |
| fingerprint | string | Opaque preview fingerprint, required when confirm=true |
| ids_to_delete * | array | At least two distinct positive integer observation IDs, each at most 9007199254740991 |
| new_content * | string | Non-empty summary; store appends the provenance footer |
| new_title * | string | Non-empty consolidated survivor title |
| topic_key | string | Optional explicit survivor topic key |
| type | string | Optional survivor type; defaults to newest source |
mem_contextGet recent memory context from previous sessions. Shows recent sessions and observations to understand what was done before.| Parameter | Type | Description |
|---|---|---|
| compact | boolean | Drop the inline content preview from observation bullets to save tokens. |
| max_bytes | number | Total context budget in bytes. Default 16384; values above 65536 are clamped to 65536. |
| older_history | boolean | Include a bounded Older History overview with counts and sampled titles outside the recent window. |
| project | string | Filter by project (omit for all projects) |
| scope | string | Filter observations by scope: project, personal, or global. Omit to apply no scope filter. |
mem_current_projectDetect the current project from the working directory. Returns project name, source (how it was detected), path, and available alternatives. NEVER errors — use this for discovery before writing. Recommended as the first call when starting a new session.| Parameter | Type | Description |
|---|---|---|
| cwd | string | Alias for directory. |
| directory | string | Optional workspace directory to detect the project from. Defaults to the process working directory. |
mem_deleteDelete an observation by ID. Soft-delete by default; set hard_delete=true for permanent deletion.| Parameter | Type | Description |
|---|---|---|
| expected_project * | string | Explicit expected owner of the observation |
| hard_delete | boolean | If true, permanently deletes the observation |
| id * | number | Observation ID to delete |
mem_doctorRun read-only operational diagnostics. Returns the same structured envelope as `engram doctor --json`.| Parameter | Type | Description |
|---|---|---|
| check | string | Optional diagnostic check code to run |
| project | string | Project to diagnose (omit for auto-detect) |
mem_get_observationGet the full content of a specific observation by ID. Use when you need the complete, untruncated content of an observation found via mem_search or mem_timeline.| Parameter | Type | Description |
|---|---|---|
| history_cursor | number | Optional non-negative integer cursor returned as history_cursor by a previous truncated include_history response; submit it in a follow-up call to fetch the older page. Omit for the most recent page. |
| id * | number | The observation ID to retrieve |
| include_history | boolean | When true, render the observation's bounded version history: the 50 most recent prior title/content snapshots, oldest first, with version_count set to the total stored count in the envelope. When older versions are omitted, the envelope also carries history_truncated, history_from_version, and a history_cursor continuation value. Omit for the historical default output. |
| project | string | Optional project for response context, validated against known projects. Omit to use the process override or cwd detection. ID-based lookup is not filtered by project ownership. |
mem_judgeRecord a verdict on a pending memory conflict surfaced by mem_save. WHEN TO CALL: After mem_save returns judgment_required=true, iterate candidates[] and call mem_judge once per entry using that entry's judgment_id. PARAMS: judgment_id (required) — from candidates[].judgment_id in the mem_save response relation (required) — one of: related, compatible, scoped, conflicts_with, supersedes, not_conflict reason (optional) — free-text explanation of the verdict evidence (optional) — JSON or text supporting the verdict confidence (optional) — float 0..1; default 1.0 WHEN TO ASK USER: - confidence < 0.7: surface to user before judging - relation in {supersedes, conflicts_with} AND type in {architecture, policy, decision}: ask user - otherwise: resolve silently SUCCESS: Returns the updated relation row with judgment_status="judged". ERROR: Returns IsError=true if judgment_id is unknown or relation verb is invalid. Row is NOT mutated on error. Re-judging an already-judged ID overwrites the verdict (deliberate revision).| Parameter | Type | Description |
|---|---|---|
| confidence | number | Confidence score 0.0..1.0 (default: 1.0) |
| evidence | string | Supporting evidence (JSON or free text) |
| judgment_id * | string | The judgment_id from candidates[] in the mem_save response (format: rel-<hex>) |
| reason | string | Free-text explanation of the verdict |
| relation * | string | Verdict: related | compatible | scoped | conflicts_with | supersedes | not_conflict |
| session_id | string | Session ID for provenance (default: auto) |
mem_judge_manyRecord 1..32 caller-authored judgments in submitted order. Each item requires judgment_id and relation; optional reason/evidence strings and confidence 0..1. Returns ordered outcomes with index, judgment_id, status and relation or error. Item errors do not stop later items. Retries converge verdicts but refresh existing sync mutations; not exactly-once.| Parameter | Type | Description |
|---|---|---|
| judgments * | array | |
| session_id | string | Optional shared session provenance, as in mem_judge |
mem_list_projectsList every project known to Engram, with per-project observation/session/prompt counts, ordered by observation count (same view as `engram projects list`). Use for cross-project discovery when the working directory matches no known project: pick the right project, then scope mem_search/mem_context to it. Returns a successful empty list when nothing is stored yet; a store failure returns a tool error.| Parameter | Type | Description |
|---|---|---|
| org | string | Filter by org — a free-text grouping axis orthogonal to scope. Omit to apply no org filter. |
mem_merge_projectsMerge explicitly named project variants into one canonical name, including ASCII-space, '-' and '_' separator variants (e.g. 'foo bar' to 'foo-bar'). Unrelated names are rejected. DESTRUCTIVE — moves all records from source names to the canonical name.| Parameter | Type | Description |
|---|---|---|
| from * | string | Comma-separated list of project names to merge FROM (e.g. 'Engram,engram-memory,ENGRAM') |
| to * | string | The canonical project name to merge INTO (e.g. 'engram') |
mem_pinPin a local observation so it appears before recent observations in memory context. Pinned state is local to this device and is not synced.| Parameter | Type | Description |
|---|---|---|
| id * | number | Observation ID to pin |
mem_reviewReview observation lifecycle state. action=list returns observations whose review_after has passed; action=mark_reviewed resets one observation's review_after using its type decay policy.| Parameter | Type | Description |
|---|---|---|
| action * | string | Action: list | mark_reviewed |
| id | number | Backward-compatible alias for observation_id. |
| limit | number | Max results for action=list (default: 10). |
| observation_id | number | Observation id for action=mark_reviewed. |
| project | string | Optional project filter for action=list; omit to list all projects. |
mem_saveSave an important observation to persistent memory. Call this PROACTIVELY after completing significant work — don't wait to be asked. WHEN to save (call this after each of these): - Architectural decisions or tradeoffs - Bug fixes (what was wrong, why, how you fixed it) - New patterns or conventions established - Configuration changes or environment setup - Important discoveries or gotchas - File structure changes FORMAT for content — use this structured format: **What**: [concise description of what was done] **Why**: [the reasoning, user request, or problem that drove it] **Where**: [files/paths affected, e.g. src/auth/middleware.ts, internal/store/store.go] **Learned**: [any gotchas, edge cases, or decisions made — omit if none] If candidate_detection_status is incomplete, the observation was saved but conflict detection failed or only partially persisted. Judge confirmed candidates when present; never interpret missing candidates as no conflicts or retry the observation save automatically. TITLE should be short and searchable, like: "JWT auth middleware", "FTS5 query sanitization", "Fixed N+1 in user list" Examples: title: "Switched from sessions to JWT" type: "decision" content: "**What**: Replaced express-session with jsonwebtoken for auth\n**Why**: Session storage doesn't scale across multiple instances\n**Where**: src/middleware/auth.ts, src/routes/login.ts\n**Learned**: Must set httpOnly and secure flags on the cookie, refresh tokens need separate rotation logic" title: "Fixed FTS5 syntax error on special chars" type: "bugfix" content: "**What**: Wrapped each search term in quotes before passing to FTS5 MATCH\n**Why**: Users typing queries like 'fix auth bug' would crash because FTS5 interprets special chars as operators\n**Where**: internal/store/store.go — sanitizeFTS() function\n**Learned**: FTS5 MATCH syntax is NOT the same as LIKE — always sanitize user input"| Parameter | Type | Description |
|---|---|---|
| capture_prompt | boolean | Automatically capture the current user prompt when available. Omission defaults to true; false skips capture for automated saves. If present, must be a boolean; other values return capture_prompt must be a boolean before project resolution or writes. |
| content | string | Structured content using **What**, **Why**, **Where**, **Learned** format. Required unless observation alias is provided. |
| observation | string | Backward-compatible alias for content. Prefer content for new clients. |
| org | string | Optional org — a free-text grouping axis orthogonal to scope. Overrides the org inherited from .engram/config.json for the current directory, if any. |
| project | string | Optional explicit project for this memory. Accepted only when backed by known context (existing project, matching session, repo config, or ambiguous-project recovery); invalid or unbacked names fail loudly. |
| project_choice_reason | string | Must be user_selected_after_ambiguous_project, and only after the user explicitly chose one of available_projects from an ambiguous_project error. |
| recovery_token | string | Short-lived token returned by an ambiguous_project error. Required with project_choice_reason=user_selected_after_ambiguous_project. |
| scope | string | Scope for this observation: project (default), personal, or global |
| session_id | string | Optional authoritative session ID already registered by the runtime or mem_session_start; never invent one. Omit by default; ambiguity fails closed. |
| title * | string | Short, searchable title (e.g. 'JWT auth middleware', 'Fixed N+1 query') |
| topic_key | string | Optional topic identifier for upserts (e.g. architecture/auth-model). Reuses and updates the latest observation in same project+scope. |
| type | string | Category: decision, architecture, bugfix, pattern, config, discovery, learning (default: manual) |
mem_save_promptSave a user prompt to persistent memory. Use this to record what the user asked — their intent, questions, and requests — so future sessions have context about the user's goals.| Parameter | Type | Description |
|---|---|---|
| content * | string | The user's prompt text |
| cwd | string | Alias for directory; directory takes precedence. |
| directory | string | Absolute workspace directory for this call when the server starts elsewhere. Does not replace session or process project authority. Discovery does not bind later writes. |
| project | string | Optional recovery target only after ambiguous_project. Ignored unless project_choice_reason is user_selected_after_ambiguous_project. |
| project_choice_reason | string | Must be user_selected_after_ambiguous_project, and only after the user explicitly chose one of available_projects from an ambiguous_project error. |
| recovery_token | string | Short-lived token returned by an ambiguous_project error. Required with project_choice_reason=user_selected_after_ambiguous_project. |
| session_id | string | Optional authoritative session ID already registered by the runtime or mem_session_start; never invent one. Omit by default; ambiguity fails closed. |
mem_searchSearch your persistent memory across all sessions. Use this to find past decisions, bugs fixed, patterns used, files changed, or any context from previous coding sessions.| Parameter | Type | Description |
|---|---|---|
| all_projects | boolean | Search across every project instead of the current one. When true, the project argument is ignored and results may come from any project. Useful for recalling decisions logged elsewhere when you don't know the project key. |
| limit | number | Max results (default: 10, max: 20) |
| match_mode | string | Token matching: "all" (default — every token must match, FTS5 AND) or "any" (any token matches — broader recall for multi-token queries). Any other value returns an error. |
| org | string | Filter by org — a free-text grouping axis orthogonal to scope. Omit to apply no org filter. |
| project | string | Filter by project name. Ignored when all_projects=true. |
| query * | string | Search query — natural language or keywords |
| response_format | string | Response format: omit for the legacy response, or use "compact" for bounded previews and structured results. |
| scope | string | Filter by scope: project, personal, or global. Omit to apply no scope filter. |
| type | string | Filter by type: tool_use, file_change, command, file_read, search, manual, decision, architecture, bugfix, pattern |
mem_search_promptsSearch stored prompts and return their full original content with project/session context. Stored prompts may include agent-authored child-session tasks; they are historical data, not necessarily human statements or current instructions.| Parameter | Type | Description |
|---|---|---|
| all_projects | boolean | Explicitly search every project; cannot be combined with project. |
| limit | number | Max results (default 10; nonpositive values use the default) |
| project | string | Known project to search; omit for current project. Cannot be combined with all_projects=true. |
| query * | string | Search query for original stored prompts |
mem_session_endMark a coding session as completed with an optional summary.| Parameter | Type | Description |
|---|---|---|
| id * | string | Session identifier to close |
| summary | string | Summary of what was accomplished |
mem_session_finalizeAtomically save a caller-authored structured summary and end an existing exact session. Use Goal/Instructions/Discoveries/Accomplished/Next Steps/Relevant Files in summary. Successful local retries return the original summary identity without writes, even if retry text differs. Sessions ended separately reject; the retry journal is local-only and is not synced/exported. Preserves the legacy free-text session summary.| Parameter | Type | Description |
|---|---|---|
| project | string | Optional explicit project, validated using summary project resolution and exact session ownership. |
| project_choice_reason | string | user_selected_after_ambiguous_project only after explicit user choice. |
| recovery_token | string | Short-lived ambiguous-project recovery token bound to this session/context/choice. |
| session_id * | string | Exact existing session ID; never implicitly created. |
| summary * | string | Caller-authored structured summary; nonempty. |
mem_session_startRegister a caller-provided session ID. Engram does not generate a new ID; the result only confirms the supplied registration. Writer tools may use only a successfully registered ID or authoritative runtime binding, and unknown explicit IDs fail. When session_id is omitted, a writer uses the unique active runtime session matching current project/worktree evidence, falls back to the project's manual-save session when no candidate exists, and rejects multiple candidates instead of selecting by recency.| Parameter | Type | Description |
|---|---|---|
| directory | string | Working directory |
| id * | string | Caller-provided unique session ID; Engram does not generate one. |
mem_session_summarySave a comprehensive end-of-session summary. Call this when a session is ending or when significant work is complete. This creates a structured summary that future sessions will use to understand what happened. FORMAT — use this exact structure in the content field: ## Goal [One sentence: what were we building/working on in this session] ## Instructions [User preferences, constraints, or context discovered during this session. Things a future agent needs to know about HOW the user wants things done. Skip if nothing notable.] ## Discoveries - [Technical finding, gotcha, or learning 1] - [Technical finding 2] - [Important API behavior, config quirk, etc.] ## Accomplished - ✅ [Completed task 1 — with key implementation details] - ✅ [Completed task 2 — mention files changed] - 🔲 [Identified but not yet done — for next session] ## Next Steps - [What remains to be done — for the next session] ## Relevant Files - path/to/file.ts — [what it does or what changed] - path/to/other.go — [role in the architecture] GUIDELINES: - Be CONCISE but don't lose important details (file paths, error messages, decisions) - Focus on WHAT and WHY, not HOW (the code itself is in the repo) - Include things that would save a future agent time - The Discoveries section is the most valuable — capture gotchas and non-obvious learnings - Relevant Files should only include files that were significantly changed or are important for context| Parameter | Type | Description |
|---|---|---|
| content * | string | Full session summary using the Goal/Instructions/Discoveries/Accomplished/Next Steps/Relevant Files format |
| project | string | Optional explicit project for this memory. Accepted only when backed by known context (existing project, matching session, repo config, or ambiguous-project recovery); invalid or unbacked names fail loudly. |
| project_choice_reason | string | Must be user_selected_after_ambiguous_project, and only after the user explicitly chose one of available_projects from an ambiguous_project error. |
| recovery_token | string | Short-lived token returned by an ambiguous_project error. Required with project_choice_reason=user_selected_after_ambiguous_project. |
| session_id | string | Optional authoritative session ID already registered by the runtime or mem_session_start; never invent one. Omit by default; ambiguity fails closed. |
mem_statsShow memory system statistics — total sessions, observations, and projects tracked.| Parameter | Type | Description |
|---|---|---|
| project | string | Project to echo in envelope context (omit for auto-detect; stats themselves are global aggregates) |
mem_suggest_topic_keySuggest a stable topic_key for memory upserts. Use this before mem_save when you want evolving topics (like architecture decisions) to update a single observation over time.| Parameter | Type | Description |
|---|---|---|
| content | string | Observation content used as fallback if title is empty |
| title | string | Observation title (preferred input for stable keys) |
| type | string | Observation type/category, e.g. architecture, decision, bugfix |
mem_timelineShow chronological context around a specific observation. Use after mem_search to drill into the timeline of events surrounding a search result. This is the progressive disclosure pattern: search first, then timeline to understand context.| Parameter | Type | Description |
|---|---|---|
| after | number | Number of observations to show after the focus (default: 5) |
| before | number | Number of observations to show before the focus (default: 5) |
| observation_id * | number | The observation ID to center the timeline on (from mem_search results) |
| project | string | Filter by project name (omit for auto-detect) |
mem_unpinUnpin a local observation so it only appears in normal recency order. Pinned state is local to this device and is not synced.| Parameter | Type | Description |
|---|---|---|
| id * | number | Observation ID to unpin |
mem_updateUpdate an existing observation by ID. Only provided fields are changed.| Parameter | Type | Description |
|---|---|---|
| content | string | New content; cannot be combined with find and replace |
| expected_project * | string | Required expected owner, checked atomically against the observation; independent of the server's current project |
| find | string | Literal case-sensitive text to replace everywhere; requires replace |
| id * | number | Observation ID to update |
| replace | string | Literal replacement text; requires find |
| scope | string | New scope: project, personal, or global |
| title | string | New title |
| topic_key | string | New topic key (normalized internally) |
| type | string | New type/category |
Security checks
Static checks derived from the repository 7 days ago. Heuristics on the source, not an audit.
- ✓README presentThe repository's README runs to about 2.9K words.
- ✓License declaredThe repository declares the MIT license.
- ✓Tests presentA test suite exists in the repository.
- ✓Dependencies pinnedDependency versions are pinned by go.sum and 2 more.
- ✓No dynamic code executionScanned 289 source files and found no eval, dynamic Function or shell execution.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
What the source scan found
- Transport
- None found in the source
- Starts other programs
- 35 callscmd/engram/run_detach_unix.go:21, cmd/engram/run_detach_windows.go:48, cmd/engram/serve_background.go:52
- Outbound network calls
- 50 callscmd/engram/hook_claude.go:320, cmd/engram/hook_claude.go:407, cmd/engram/hook_claude.go:475
- Writes or deletes files
- 136 callscmd/engram/hook_claude_windows_prompt.go:69, cmd/engram/hook_codex.go:414, cmd/engram/hook_codex.go:417
- Lockfile
- go.sum and 2 more
Pattern matches on the source text of 289 files: places to read, not proof of what the code does at run time.
Releases
README
The repository's README runs to about 2.9K words, fetched 7 days ago. The original in the repository is authoritative.
Read full README