Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/xantorres/engram/llms.txt

Use this file to discover all available pages before exploring further.

Every piece of information Engram stores is represented as a single Memory record. A memory is a typed, versioned assertion about you or your environment — things like “I prefer pnpm over npm” or “production deploys require two approvals.” Understanding the shape of a memory helps you reason about what Engram captures, how it ages, and why certain fields drive routing and review decisions.

The Memory struct

Engram uses a Pydantic model (memory.v1) to validate every record at capture time and again on load. All memories are serialised into the YAML frontmatter block of memory.md so they remain human-readable and diff-friendly.

Field reference

FieldTypeDefaultDescription
idstrauto (mem-NNNN)Stable, sequential identifier assigned when the memory is first staged. Never reused.
factstr(required)The assertion text — a single, declarative sentence written in present tense.
kindKindpreferenceSemantic category that controls routing, tier assignment, and grouping in the body output.
sourcestr"manual"Free-form origin label, e.g. tool:remember, harvest:claude, or import:dotfiles.
confidencefloat0.5Score between 0.0 and 1.0. Harvested facts start lower; manually asserted facts can start at 1.0.
learned_byLearnedBymanualHow the memory was created: harvest, remember, manual, or import.
learned_atdate(required)ISO 8601 date the memory was first recorded. Combined with decay to compute staleness.
last_verifieddate | nullnullUpdated whenever the memory is re-confirmed. null means it has never been verified since capture.
decaystr"180d"Staleness horizon as a duration string ("180d", "365d", "30d", etc.).
statusStatuspendingLifecycle state: pending → promoted or pending → rejected. Promoted facts stale into stale.
risk_tierint1Routing tier (1, 2, or 3) derived from kind and conflict detection. Controls whether human review is required.
deststr | nullnullTarget file path within the store. Set by the bridge when routing a memory — e.g. memory-log.md.
id values are assigned sequentially per store and are never reused, even after a memory is rejected. This keeps audit trails unambiguous.

Kind values

The kind field is the primary semantic tag on a memory. It determines which risk tier the memory lands in, how it is grouped in the memory.md body, and whether it can be auto-appended without human review.
KindDescriptionExample fact
preferencePersonal workflow or tooling preferences"I prefer pnpm over npm"
identityNames, handles, email addresses, account IDs"My GitHub handle is @alice"
fiscalBudget constraints, billing accounts, cost limits"Monthly cloud budget is $200"
peopleCollaborators, teams, contacts, reporting lines"Bob owns the payments service"
projectActive repos, milestones, tech-stack facts"The API is written in FastAPI"
constraintRules, policies, approval gates, hard limits"Production deploys require two approvals"
infraHosts, regions, cluster names, environment topology"Staging runs on us-east-1"
toolingCLI tools, editors, package managers, build systems"We use Turborepo for the monorepo"
healthMedical, dietary, or physical context"No shellfish — allergy"
locationOffices, time zones, physical addresses"HQ is UTC+1 / London"
The kinds identity, fiscal, people, constraint, location, and health are curated kinds — they always route to the review queue regardless of any allowlist configuration. See Risk Tiers for details.

Status values

Every memory moves through a simple state machine. Only promoted memories are surfaced during recall.
StatusMeaningTransitions
pendingStaged candidate awaiting routing or reviewpromoted, → rejected
promotedAccepted and active — surfaces during recallstale (time-based)
rejectedExplicitly declined — never surfacesterminal
staleWas promoted but has exceeded its decay horizonre-confirm to reset
Run engram doctor to get a report of all stale memories, low-confidence facts (below 0.5), and unverified auto-captures. You can bulk-promote or bulk-reject stale memories in one pass.

Staleness and decay

The decay field specifies how long a promoted memory remains fresh. Engram computes staleness with:
is_stale = (learned_at + decay_duration) < today
Re-confirming a memory — either by running engram promote <id> --confirm again or via engram doctor --reverify — updates last_verified to today and resets the staleness clock without changing learned_at.
learned_at: 2025-08-01   decay: 180d   →   stale after 2026-01-28
last_verified: 2025-11-01               →   fresh until 2026-04-29
last_verified does not extend learned_at. The original capture date is immutable and preserved in the audit trail.

YAML frontmatter in memory.md

All promoted memories live in the YAML frontmatter block of ~/.local/share/engram/memory.md. The block is machine-written but fully human-editable. The schema: memory.v1 header lets Engram detect and migrate older stores automatically.
---
schema: memory.v1
generated: 2026-01-15
items:
  - id: mem-0001
    fact: "I prefer pnpm over npm"
    kind: tooling
    source: tool:remember
    confidence: 0.6
    learned_by: remember
    learned_at: 2026-01-15
    last_verified: null
    decay: 180d
    status: promoted
    risk_tier: 1
    dest: memory-log.md

  - id: mem-0002
    fact: "Monthly cloud budget is $200"
    kind: fiscal
    source: harvest:claude
    confidence: 0.85
    learned_by: harvest
    learned_at: 2026-01-10
    last_verified: 2026-01-15
    decay: 365d
    status: promoted
    risk_tier: 3
    dest: memory.md
---
Engram deliberately avoids a binary database so the store is portable and version-controllable. You can git diff your memories, restore a snapshot with git checkout, sync them across machines via Dropbox or iCloud, and review them in any text editor. The generated body section below the frontmatter is always re-derived from the frontmatter items — you only need to hand-edit the frontmatter.

The generated body section

Below the YAML frontmatter, Engram writes a human-readable Markdown body grouped by kind. This section is fully regenerated on every sync --apply or doctor --fix run — do not write below the closing --- by hand.
---
# (frontmatter above)
---

## tooling

- I prefer pnpm over npm *(mem-0001 · 2026-01-15)*

## fiscal

- Monthly cloud budget is $200 *(mem-0002 · 2026-01-10, verified 2026-01-15)*
The body format is what Engram injects into AGENTS.md files and exposes as an MCP resource — agents read plain Markdown, not raw YAML.

Build docs developers (and LLMs) love