Skip to content

agent defs: per-agent persistent memory (memory: frontmatter field) #33

Closed

Description

@JAORMX

Context

Claude Code subagents support memory: user | project | local — a persistent per-agent directory whose MEMORY.md head is injected at startup, letting a specialist accumulate domain knowledge across sessions. Factory's Knowledge Droid is the same idea taken further. mecatl agent defs (.mecatl/agents/*.md) have no memory field; every child starts cold. (docs/harnesses/09-agent-primitives-evaluation.md, field-gap #4.)

Shape

  • New frontmatter field on AgentDef: memory: user | project (skip local initially), validated like the other fields.
  • Composition resolves the directory (xdgconfig for user tier; workspace-relative for project tier, trust-gated like other project-tier artifacts) and injects a bounded MEMORY.md excerpt into the def's prompt layer (cache-stable StablePrefix discipline).
  • Write path: either the existing six memory tools scoped to the agent's directory for that child, or read-only v1 (injection only) with writes deferred — decide in design.
  • The memory store cross-process locking lesson applies (gofrs/flock) if children write concurrently.

Why

Specialist defs (reviewers, architects) re-derive the same project facts every invocation; this is the highest-leverage cold-start fix for the def ecosystem.

Activity

  1. added
    enhancement
    on Jun 10, 2026
  2. JAORMX commented on Jun 14, 2026

    @JAORMX
    ContributorAuthor

    Shipped in 31d716e (on main, CI green): per-agent persistent memory via the memory: frontmatter field (read-only v1). Auto-close was missed because the commit used a bare (#33) reference instead of Closes #33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions