Перейти к основному содержимому
Версия: Future

save / save-session / observe

Write commands propose memory through the approval gate.

save

engram save [rule|workflow|knowledge] "<text>"
engram save --role frontend "<text>"
engram save --scope global "<text>"

engram save captures the best single memory candidate, automatically updates a matching memory or creates a new one, and always shows the A/B/C approval gate before writing.

When engram save finds related active memories, the approval preview reports them with a suggested depends_on or possible-duplicate warning.

save-session

engram save-session
engram ss
engram save-session --query-level 3
engram ss -f
engram ss -f last 50 sessions
engram save-session --file transcript.md
engram save-session --force

Use save-session when a long interaction produced multiple candidates:

TYPE: rule | TEXT: Always run tests before release. | CONTEXT: Created from release planning so future agents preserve the test gate.
TYPE: knowledge | TEXT: Release notes live in CHANGELOG.md.
TYPE: workflow | TEXT: When releasing, run tests, update changelog, then tag.

CONTEXT: ... is optional. Add it only when it explains why the memory exists. Candidates may also add DEPENDS_ON, LEVEL, or UPDATE fields when restructuring related memory.

  • --query-level <n> — mine up to n recent accessible human-agent chats; must be a positive integer; agents must not invent unavailable history
  • --force / -f — every generated candidate is saved because the human explicitly approved that shortcut
  • --file <path> — for transcripts or long summaries already on disk

For /engram take-control --force or natural /engram take control force, the slash adapter normalizes the wording, generates only concise TYPE: ... | TEXT: ... candidates, and lets Engram save them without a second approval prompt.

observe

engram observe --file session.md
engram save-session --file .agents/.engram/inbox/<note>.md

observe stores sanitized raw notes in inbox/. Inbox notes are not active memory. Use this when you want to preserve rough notes before deciding what should become durable memory.

Память, подкреплённая доказательствами

engram observe --file session.md
# Output includes Trace: tr_... and the inbox wrapper path
engram save-session --file .agents/.engram/inbox/<observation>.md

The immutable source lives at .agents/.engram/traces/<trace-id>.jsonl; the inbox Markdown is only a review wrapper. Promotion reopens the trace and writes approved memory with evidence_refs and derived_from. engram observe --propose --file session.md may immediately enter the normal approval flow, but it still uses the trace as source evidence.

When an accept-all run reports related memories before writing, no file was saved yet. The agent should rerun with structured candidates:

TYPE: rule | TEXT: OAuth rotation follows release foundations. | DEPENDS_ON: release-foundation | LEVEL: advanced
TYPE: knowledge | TEXT: Invoice retries use exponential backoff. | UPDATE: invoice-retry-baseline

Next steps

Git author identity

Engram can store a global author and an optional workspace override. Resolution is workspace, global, then read-only Git fallback. Settings affect future memories only; a workspace override never changes global Git configuration. Use explicit plan and confirmation for global Git sync or legacy-memory migration.

engram author show
engram author set --name "Jane Doe" --email "jane@example.com"
engram author unset --scope workspace
engram author sync-git-global --plan
engram author sync-git-global --confirm
engram author migrate-memories --plan
engram author migrate-memories --confirm

Read the complete Git author settings guide.