Skip to content

wafle-anamnesis: autonomous memory pipeline built on Engram - proposal #505

@creandoaldia

Description

@creandoaldia

wafle-anamnesis: autonomous memory pipeline built on top of Engram

I built wafle-anamnesis as an autonomous memory layer on top of Engram, and I believe it could be a valuable addition to the Engram ecosystem.

What it does

wafle-anamnesis closes the loop between AI agents and Engram with zero agent effort:

MCP ERROR -> mcp-launcher.ps1 -> engram save CLI -> .engram DB -> cloud sync
|
NEXT SESSION -> engram-context.ps1 -> loads continuity -> agent knows context

Three components

  1. mcp-launcher.ps1 - MCP server wrapper that:

    • Kills only true orphans by checking parent process (not by name or age)
    • On MCP crash: auto-saves to Engram via CLI (no MCP connection needed)
    • Format: engram save "mcp-error: ..." "**What**..." --type bugfix --project <name>
  2. engram-context.ps1 - Pre-flight loader (~5 lines output at session start)

    • Loads continuity state, cloud sync status
    • Does NOT load past errors (saves context tokens) - queried on-demand
  3. Agent protocol - Instructions for any AI agent:

    • Session start -> load continuity
    • Debugging -> search Engram for past fixes
    • After each task -> save to Engram
    • Session close -> summary to Engram

Why this matters for Engram

Engram provides the infrastructure (save, search, sync, MCP tools), but does not automate when to save or when to search. wafle-anamnesis proves that:

  • Auto-save is possible: using Engram CLI directly from any script (no MCP dependency)
  • Context pre-load is practical: 5-line output at session start for continuity
  • On-demand search is efficient: query Engram only when debugging - no context inflation
  • CLI fallback is essential: when MCP drops, CLI save and search keep working

What Engram could add natively

  1. engram watch or engram webhook - lightweight process that monitors events and auto-saves
  2. engram context command - emit compact context summary in a single call
  3. --attach / --parent flag on save - link memory to parent process for orphan detection

Technical

  • Uses Engram's native CLI: same flags (--type, --project, --scope)
  • Content format matches Engram: "What | Why | Where | Learned"
  • Zero new long-running processes - no conflict with Engram daemon
  • ~14 KB total - minimal footprint
  • Published at: https://github.com/creandoaldia/wafle-anamnesis

The vision

Engram is the database layer for agent memory. wafle-anamnesis is the automation layer that makes agents use it consistently. Together they form a complete stack: database -> automation -> protocol.

I'd love to hear your thoughts on this direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions