Skip to content

Latest commit

 

History

History
69 lines (51 loc) · 4.12 KB

agent-instructions.tmpl.md

File metadata and controls

69 lines (51 loc) · 4.12 KB

Engram — Contributor Instructions

Engram is a monorepo for an agent memory continuity system. This file provides repo-specific context for agents working on this codebase.

Packages

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

Common commands

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), run npm run snapshot first.

Dev environment

Copy .env.example to .env and set ENGRAM_VAULT_PATH to a local vault directory, then run:

npm run setup
npm run dev

The 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.

Architecture notes

  • Memory files are Obsidian-compatible markdown with YAML frontmatter
  • Key frontmatter fields: type, memory_state, confidence, bootstrap_state, agent, platform
  • memory_state controls retrieval priority: core > remembered > default > forgotten
  • context returns core + remembered + query-relevant memories; soul doc is loaded separately via soul(action: "get")
  • Thread docs should prefer a lightweight ## Todo section with - [ ] items over sprawling markdown plans; the active thread summary surfaced during context(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 under inbox/, thread-scoped items live under inbox/threads/<thread_id>/ as individual notes; both surface during context(action: "load") sorted by created date (FIFO); items must be inside the inbox/ directory — a note at path inbox creates inbox.md which 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/notes are 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 MemoryManager methods

Bootstrapping

  • agent-instructions.tmpl.md is the source of truth for repo-level agent instructions
  • Generate AGENTS.md via npm run agents (for Cursor, Copilot, Windsurf, etc.)
  • Generate .claude/CLAUDE.md via npm 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)

See also