Skip to content

Artifact memory

An "artifact" in the agent-platform sense is whatever the conversation is about — a TargetRef plus optional artifact kind. Artifact memory is the cut of the memory store keyed to that artifact: memories saved with target_key set, scoped to instance or finer.

TargetRef shape

From @open-matrix/core (referenced by MemoryActor.ts:8 and runtime/AgentEnvironmentSpec.ts:1):

ts
interface TargetRef {
  authorityRoot: string;       // e.g. COM.NIMBLETEC.RICHARD-SANTOMAURO
  logicalMount: string;        // e.g. flowpad.page-42
  artifactKind?: 'actor' | 'repo' | 'doc' | 'config' | 'mountcomponent' | string;
  classRef?: string;           // optional class identity (Flowpad.Page)
}

A targetKey is the wire-format string derived from a TargetRef (joined with ).

Pinning a memory to an artifact

memory.save accepts:

ts
'memory.save': {
  mount: 'string',
  content: 'string',
  tags: 'string[]?',
  targetKey: 'string?',
  profileKey: 'string?',
  scope: 'string?',
}

When targetKey is set, the memory is queryable as artifact memory:

  • memory.search with targetKey → only artifact memories.
  • memory.searchTier with targetKey → restricted to that artifact.
  • The cascade (see retrieval) treats instance and finer scopes as artifact-scoped.

Two kinds of artifact memory

  1. Per-instance memory (scope: 'instance'). Tied to one concrete actor instance. Two flowpad.page-42 instances on different runtimes are different artifacts.
  2. Per-class memory (scope: 'class'). Tied to a class of artifact (e.g. all Flowpad.Page instances). Useful for "how to handle Flowpad pages" knowledge that should outlive any single instance.

Why this matters

When the model writes a memory like "this page uses German weights for the table column," that memory should attach to the page, not to the agent. Saving with targetKey: <page>, scope: 'instance' gives that pinning. The next session targeting the same page sees the memory; sessions targeting other pages do not.

What artifact memory does NOT cover

  • The artifact itself. Memory is about an artifact. The artifact's own state lives in its actor's record store.
  • Embeddings of the artifact's content. EmbeddingService can embed arbitrary text but is independent of the artifact-memory pinning.
  • Cross-artifact relationships. Memories pinned to artifact A are not auto-linked to artifact B. If a "see also" relationship is needed, save a memory with both targetKey set to A and a tag mentioning B.

See also

Source: projects/matrix-3/packages/agents/src/MemoryActor.ts:79-102 (accepts), projects/matrix-3/packages/agents/src/AgentsStore.ts:211-225 (saveMemory), projects/matrix-3/packages/agents/src/skills/MemoryCascade.ts (scope cascade).