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.
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.jsonField reference#
| Field | Type | Required | Notes |
|---|---|---|---|
$schema | string | no | Optional schema URI |
standard | object | yes for APDS | Definition contract: {"id":"agentpm","version":"1.0.0"}; see standard selection. |
kind | enum | yes | Must be "memory" |
name | string | yes | Package name |
version | semver | yes | Package version |
description | string | yes | Human-readable summary |
readme | string | no | Optional README path |
license | object | no | Optional SPDX/license metadata |
memory.scopes | object | yes | Declared reusable scope keys |
memory.record_types | object | yes | Declared logical record types and authored content schemas |
memory.spaces | object | yes | Declared logical storage shapes and accepted record types |
memory.operations | object | no | Declarative 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#
documentcollectionsequence
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:
keyfilterchronologicalsemanticfull_text
Model rules:
documentspaces requirekeysequencespaces requirechronologicaldocumentspaces cannot beappend_only
Retention, capacity, and constraints#
retention.ttluses the supported positive ISO 8601 duration subsetretention.on_expiredeclares the intended action such asdeletecapacity.max_recordsdeclares a bounded record count for applicable spacesconstraints.append_onlymarks 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:
consolidatetransformdelete
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:
createrecords the transform result as a new output record and is the default when omitted.replace_inputupdates the single input record in place. It requires exactly one input, the output must use the samespaceandrecord_typeas that input, andsource_handlingmust beretain.
Triggers#
The MVP trigger types are:
intervalrecord_countcapacityexternal
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-classx-agentpm-sensitivityx-agentpm-persistx-agentpm-shareable
Supported semantics:
| Annotation | Type | Meaning |
|---|---|---|
x-agentpm-data-class | enum | Product-facing data class for the field |
x-agentpm-sensitivity | enum | Relative sensitivity level |
x-agentpm-persist | boolean | Whether the field is intended to persist |
x-agentpm-shareable | boolean | Whether 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:
idrecord_typespacescopeschema_versioncreated_atcontent
Optional logical envelope fields:
updated_atexpires_atprovenance
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.jsonmemory/contracts/index.jsoninventories resolved contracts- each generated contract is self-contained and installed-package-safe
memory/build.jsonrecords deterministic authored-input and generated-output hashes
Publish readiness#
Memory packages must be built before publish:
agentpm memory build
agentpm publish --dry-runPublish checks that:
- authored inputs are still current
memory/build.jsonis supported and consistentmemory/contracts/index.jsonis supported and consistent- every indexed generated contract is present and unchanged
If authored inputs changed, rebuild first:
agentpm memory buildAgent 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.