Engram is a monorepo for an agent memory continuity system. This file provides repo-specific context for agents working on this codebase.
| Package | Description |
|---|---|
packages/core |
Core library — VaultNote, MemoryManager, ContextBuilder, filesystem adapter |
packages/mcp-server |
MCP server exposing Engram tools to harnesses and MCP-compatible agents |
packages/obsidian-plugin |
Obsidian plugin for vault UI integration |
npm run build # Build all packages
npm run test # Run all tests
npm run lint # Lint all packages
npm run clean # Remove build artifacts
npm run setup # Set up the dev vault (runs scripts/setup-dev.sh)
npm run dev # Start dev mode with a local vault
npm run snapshot # Snapshot current engram/ to .snapshots/
npm run snapshot:list # List available snapshots
npm run snapshot:restore # Restore a snapshot (auto-saves current state first)Before any vault-risky operation (setup, schema changes, tests that write memories,
dev:clean), runnpm run snapshotfirst.
Copy .env.example to .env and set ENGRAM_VAULT_PATH to a local vault directory, then run:
npm run setup
npm run devThe setup script scaffolds the vault structure and symlinks build artifacts. The dev script watches for changes and rebuilds.
If you want Claude Code to load the generic Engram bootstrap globally, npm run setup can duplicate templates/engram-bootstrap.tmpl.md into ~/.claude/CLAUDE.md when MCP_CONFIGURE_CLAUDE_CODE=true and the scope is user.
- Memory files are Obsidian-compatible markdown with YAML frontmatter
- Key frontmatter fields:
type,memory_state,confidence,bootstrap_state,agent,platform memory_statecontrols retrieval priority:core>remembered>default>forgottencontextreturns core + remembered + query-relevant memories; soul doc is loaded separately viasoul(action: "get")- Thread docs should prefer a lightweight
## Todosection with- [ ]items over sprawling markdown plans; the active thread summary surfaced duringcontext(action: "load", thread_id=...)now loads ahead of core memories and includes open todos - Inbox is a top-level directory at
engram/inbox/; global items live directly underinbox/, thread-scoped items live underinbox/threads/<thread_id>/as individual notes; both surface duringcontext(action: "load")sorted bycreateddate (FIFO); items must be inside theinbox/directory — a note at pathinboxcreatesinbox.mdwhich is invisible to the scan - Skills are a top-level directory at
engram/skills/, separate from memories - Soul document lives at
engram/memory/soul.md(top of memory directory, not inside reflections) - Working notes under
engram/notesare separate from memories; prefer storing lightweight note references in Thread docs or scratch and loading note contents explicitly with note tools when needed - The MCP server is the primary integration surface; tools map closely to
MemoryManagermethods
agent-instructions.tmpl.mdis the source of truth for repo-level agent instructions- Generate
AGENTS.mdvianpm run agents(for Cursor, Copilot, Windsurf, etc.) - Generate
.claude/CLAUDE.mdvianpm run agents:claude(for Claude Code) - Reusable Engram bootstrap for new agents: templates/engram-bootstrap.tmpl.md
- Global Claude Code bootstrap:
~/.claude/CLAUDE.md(duplicate of the template bootstrap)
- templates/ — setup templates for new Engram users
- CONTRIBUTING.md — contribution guidelines