Memory#

Author Memory Blueprints that define durable record shapes, retrieval semantics, and declarative lifecycle policy.

Inspect a selected Memory Blueprint release#

The Registry Overview leads with Spaces & record contracts and, when declared, Lifecycle operations. Each space shows its model, scopes, record types and retrieval modes. Capacity, retention and append-only rules are available in the space’s policy disclosure rather than as rows of absent optional values. Large collections expand to show every space and operation.

Record links point to the selected version’s exact space/record-type contract only when that packaged subject is unambiguous. The Record contracts tab prioritizes Blueprint content fields, with their types and required/optional status. The standard record envelope and contract file paths are secondary disclosures. A compact field-governance table shows classification, persistence and sharing annotations; expand a field to inspect its exact JSON Schema path. The complete packaged JSON Schema remains available in a separate disclosure. Missing, conflicting or ambiguous contracts remain unavailable; the page does not generate a replacement or silently select another requested subject.

The Lifecycle tab shows every declared input, output/target, trigger, source-handling, provenance and cascade policy. Inspecting these declarations does not execute an operation or establish that its trigger is scheduled. Interval values such as P14D are shown as “Every 14 days” alongside the original declaration; calendar-dependent or unrecognized durations stay in their original form. A compatible Memory Runtime must provide storage and enforce the declared policies, including persistence, sharing and deletion. A Yes annotation does not override other restrictions. Restricted sharing represents an explicit false annotation, while absent annotations remain Not declared.

Technical details & build metadata keeps scope descriptions, record-schema declarations, recorded build fields/hashes and the packaged contract index inspectable behind one disclosure. Hash copy controls preserve the full value and use the shared copy/checkmark treatment. Build records remain separate from Registry evidence and local readiness. Raw operation declarations, packaged schemas, build metadata and contract-index JSON all start collapsed. Full selected agent.json stays under Source, and author README content stays unchanged.

Get started offers exact-version installation, agentpm memory inspect, and the existing Node/Python Memory loaders. Loading a Blueprint does not provision storage or run lifecycle operations. Legacy interpretation stays qualified; unsupported standards retain source without substituting the current Memory interpretation.

What is a Memory Blueprint?#

A kind: "memory" package is a portable memory contract. It describes:

  • the scopes a host must supply
  • the record types a system may persist
  • the spaces those records live in
  • retrieval semantics, retention hints, and capacity hints
  • declarative lifecycle operations such as consolidate, transform, and delete

Memory Blueprints are not a hosted store, scheduler, or live runtime. AgentPM packages the structure and generated contracts for memory, but it does not yet bind those contracts to a storage backend or execute lifecycle policy for you.

Current boundary

AgentPM validates, builds, publishes, installs, and inspects Memory Blueprints as package artifacts. Connecting a blueprint to a concrete memory store or runtime belongs outside this package contract.

When to use Memory#

Choose Memory when the reusable artifact is:

  • a durable profile contract
  • a conversation-history shape
  • a notes or facts collection shape
  • a consolidation policy you want to version alongside those contracts

Choose Knowledge when the artifact is prepared context or retrieval corpus content.

Choose an Agent when you want to reference installed tools, skills, knowledge packages, and memory blueprints together in one composition package.

Scaffold a Memory Blueprint#

agentpm init --kind memory --name conversation-continuity --description "Describe the durable memory contract this blueprint provides."

Generated skeleton (agent.json):

{
  "$schema": "https://raw.githubusercontent.com/agentpm-dev/cli/refs/tags/apds-v1.0.0/standards/agentpm/1.0.0/manifest.schema.json",
  "standard": {
    "id": "agentpm",
    "version": "1.0.0"
  },
  "kind": "memory",
  "name": "conversation-continuity",
  "version": "0.1.0",
  "description": "Describe the durable memory contract this blueprint provides.",
  "memory": {
    "record_types": {
      "user_preference": {
        "description": "Durable structured preferences for one user.",
        "schema": "schemas/user-preference.schema.json",
        "version": "1.0.0"
      }
    },
    "scopes": {
      "user": {
        "description": "The user whose memory is being retained."
      }
    },
    "spaces": {
      "profile": {
        "description": "The current durable profile for one user.",
        "model": "document",
        "record_types": ["user_preference"],
        "retrieval": {
          "modes": ["key"]
        },
        "scope": ["user"]
      }
    }
  },
  "readme": "README.md"
}

Starter layout:

conversation-continuity/
  agent.json
  README.md
  schemas/
    user-preference.schema.json

Field reference#

FieldTypeRequiredNotes
$schemastringnoOptional schema URI
standardobjectyes for APDSDefinition contract: {"id":"agentpm","version":"1.0.0"}; see standard selection.
kindenumyesMust be "memory"
namestringyesPackage name
versionsemveryesPackage version
descriptionstringyesHuman-readable summary
readmestringnoOptional README path
licenseobjectnoOptional SPDX/license metadata
memory.scopesobjectyesDeclared reusable scope keys
memory.record_typesobjectyesDeclared logical record types and authored content schemas
memory.spacesobjectyesDeclared logical storage shapes and accepted record types
memory.operationsobjectnoDeclarative lifecycle policy

Scopes#

memory.scopes declares the reusable scope dimensions referenced elsewhere in the blueprint.

Example:

{
  "memory": {
    "scopes": {
      "user": { "description": "The end user." },
      "conversation": { "description": "The active conversation." }
    }
  }
}

Each space lists the scope keys it requires:

{
  "scope": ["user", "conversation"]
}

Record types#

memory.record_types maps each logical record type to:

  • a schema-relative JSON Schema file
  • a record schema version
  • an optional description

Example:

{
  "memory": {
    "record_types": {
      "interaction": {
        "version": "1.0.0",
        "description": "One ordered interaction record.",
        "schema": "schemas/interaction.schema.json"
      },
      "user_preference": {
        "version": "1.0.0",
        "description": "Durable user preference profile.",
        "schema": "schemas/user-preference.schema.json"
      }
    }
  }
}

The referenced file must stay inside the package root and compile as JSON Schema Draft 2020-12.

Spaces#

Spaces define the logical storage model and accepted record types.

Supported models#

  • document
  • collection
  • sequence

Example#

{
  "memory": {
    "spaces": {
      "profile": {
        "description": "One durable profile document per user.",
        "model": "document",
        "record_types": ["user_preference"],
        "scope": ["user"],
        "retrieval": {
          "modes": ["key"]
        },
        "retention": {
          "ttl": "P180D",
          "on_expire": "delete"
        }
      },
      "history": {
        "description": "Recent ordered interaction history.",
        "model": "sequence",
        "record_types": ["interaction"],
        "scope": ["user", "conversation"],
        "retrieval": {
          "modes": ["chronological"]
        },
        "capacity": {
          "max_records": 200
        },
        "constraints": {
          "append_only": true
        }
      }
    }
  }
}

Retrieval modes#

The MVP retrieval modes are:

  • key
  • filter
  • chronological
  • semantic
  • full_text

Model rules:

  • document spaces require key
  • sequence spaces require chronological
  • document spaces cannot be append_only

Retention, capacity, and constraints#

  • retention.ttl uses the supported positive ISO 8601 duration subset
  • retention.on_expire declares the intended action such as delete
  • capacity.max_records declares a bounded record count for applicable spaces
  • constraints.append_only marks spaces where records should only be appended

These are part of the package contract and validation surface. AgentPM does not yet enforce them against a live store.

Lifecycle operations#

memory.operations defines declarative lifecycle policy. The MVP operations are:

  • consolidate
  • transform
  • delete

Example:

{
  "memory": {
    "operations": {
      "refresh_profile": {
        "type": "transform",
        "description": "Refresh the durable user profile from the current structured record.",
        "inputs": [{ "space": "profile", "record_type": "user_preference" }],
        "output": {
          "space": "profile",
          "record_type": "user_preference"
        },
        "output_mode": "replace_input",
        "source_handling": "retain",
        "preserve_provenance": true,
        "trigger": {
          "type": "interval",
          "every": "P14D"
        }
      }
    }
  }
}

For transform operations, output_mode controls how the generated output is applied:

  • create records the transform result as a new output record and is the default when omitted.
  • replace_input updates the single input record in place. It requires exactly one input, the output must use the same space and record_type as that input, and source_handling must be retain.

Triggers#

The MVP trigger types are:

  • interval
  • record_count
  • capacity
  • external

These are authored declarations only. AgentPM validates them, but it does not yet run a lifecycle scheduler or host trigger engine.

Governance annotations#

Authored source schemas may include supported x-agentpm-* annotations:

  • x-agentpm-data-class
  • x-agentpm-sensitivity
  • x-agentpm-persist
  • x-agentpm-shareable

Supported semantics:

AnnotationTypeMeaning
x-agentpm-data-classenumProduct-facing data class for the field
x-agentpm-sensitivityenumRelative sensitivity level
x-agentpm-persistbooleanWhether the field is intended to persist
x-agentpm-shareablebooleanWhether the field is intended to be shareable across boundaries

AgentPM validates supported names and values, preserves those annotations into generated contracts, and rejects unknown x-agentpm-* extensions.

Canonical logical record envelope#

agentpm memory build generates one resolved contract per declared space-and-record-type pairing. Each resolved contract wraps the authored content schema in a standard logical envelope.

Required logical envelope fields:

  • id
  • record_type
  • space
  • scope
  • schema_version
  • created_at
  • content

Optional logical envelope fields:

  • updated_at
  • expires_at
  • provenance

Sequence spaces additionally require:

  • ordinal

Example generated contract shape:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": { "type": "string", "minLength": 1 },
    "record_type": { "const": "user_preference" },
    "space": { "const": "profile" },
    "schema_version": { "const": "1.0.0" },
    "created_at": { "type": "string", "format": "date-time" },
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": ["user"],
      "properties": {
        "user": { "type": "string", "minLength": 1 }
      }
    },
    "content": {
      "$id": "content",
      "type": "object"
    }
  },
  "required": [
    "id",
    "record_type",
    "space",
    "scope",
    "schema_version",
    "created_at",
    "content"
  ]
}

Generated outputs#

After a successful build, AgentPM writes:

memory/
  build.json
  contracts/
    index.json
    profile.user_preference.schema.json
  • memory/contracts/index.json inventories resolved contracts
  • each generated contract is self-contained and installed-package-safe
  • memory/build.json records deterministic authored-input and generated-output hashes

Publish readiness#

Memory packages must be built before publish:

agentpm memory build
agentpm publish --dry-run

Publish checks that:

  • authored inputs are still current
  • memory/build.json is supported and consistent
  • memory/contracts/index.json is supported and consistent
  • every indexed generated contract is present and unchanged

If authored inputs changed, rebuild first:

agentpm memory build

Agent and template dependencies#

Agents may declare first-class top-level Memory dependencies:

{
  "memory": [
    "@zack/profile-memory@0.1.0",
    { "name": "@zack/history-memory", "version": "^0.1.0" }
  ]
}

Templates may declare first-class Memory dependencies under template.dependencies.memory.

Memory packages themselves do not declare package dependencies on tools, skills, knowledge, agents, templates, profiles, loops, or other memory packages.