Memory Grain — Open Memory Specification for Autonomous Systems

3 min read Original article ↗

v1.3 · Standards Track · OWF Final

The Open Memory Specification
for Autonomous Systems

A family of three specifications that give AI agents immutable, portable, and verifiable memory — so they can remember, reason, and collaborate across systems.

How it works

Three specs, one memory.

OMS defines the container, CAL queries it, and SML renders it. Together they give any AI agent a complete, portable memory stack.

In Practice

Any AI agent. One memory. Portable everywhere.

Imagine grains written by different AI systems — and read by others across industries, without any prior arrangement.

Slide 1 of 10: Belief grain by FitCoach

FitCoach

KineticAI

Learned from three months of workout data. Nutrition and scheduling agents use this grain to personalize recovery plans.

Belief · 0x01v1 · COSE Signed

{
  "type": "belief",
  "subject": "user:john-smith",
  "relation": "preferred_activity",
  "object": "morning_run_5k",
  "confidence": 0.94,
  "source_type": "pattern",
  "created_at": 1739980800000,
  "namespace": "fitness:preferences"
}

CalendarBot

schedule optimization

FitCoach

training progression

Built for Enterprise

Trust at every layer.

Immutable by Design

Every grain is SHA-256 content-addressed. Once written, it cannot be altered — only superseded. Tamper evidence is built into the format.

Portable Everywhere

A .mg file is a self-contained container. Store it in S3, stream it through Kafka, carry it on a drive, or push it to Git. No vendor lock-in.

Audit-Ready

COSE Sign1 signatures, DID-scoped consent, and jurisdiction-aware retention. Built for GDPR, HIPAA, and SOX compliance from day one.

Conformance

Implement what you need

Declare your conformance level. Start minimal, add layers as requirements grow.

Level 1

Minimal Reader

Libraries, tools, verification scripts

  • Deserialize and verify grain blobs
  • Compute & verify SHA-256 content addresses
  • Field compaction (short keys ↔ full names)
  • All ten grain types (0x01–0x0A)
  • Ignore unknown fields
  • Constant-time hash comparison

Level 2

Full Implementation

Agent frameworks, edge gateways

  • All Level 1 requirements
  • Serialize (canonical MessagePack)
  • Validate required fields per schema
  • Pass all test vectors
  • Multi-modal content references
  • Store protocol (get/put/delete/list)
  • Enforce invalidation_policy on supersession & contradiction
  • Atomic supersede operation (distinct from raw put)
  • Validate observer_type non-empty; emit oid/otype (v1.1)

Level 3

Production Store

Enterprise deployments, cloud platforms

  • All Level 2 requirements
  • Persistent backend (filesystem, S3, DB)
  • AES-256-GCM per-grain encryption
  • HKDF per-user key derivation
  • Blind-index tokens for encrypted search
  • SPO/POS/OSP index (hexastore) or equivalent
  • Full-text search (FTS5 or equivalent)
  • Hash-chained audit trail
  • Crash recovery and reconciliation
  • Policy engine with compliance presets
  • Partition Observation storage by observer domain (v1.1)

calagent-memory

CAL: The Query Language Your Agent Orchestrator Has Been Missing

How the Context Assembly Language turns a raw memory store into a first-class context pipeline for AI agents — from querying relevant grains to assembling token-budgeted context blocks that drop directly into LLM calls.

14 min read

calsml

Choosing the Right Context Format: SML, TOON, Markdown, and JSON

CAL's FORMAT clause gives you six output options for assembled agent context. Side-by-side token counts, real examples, and a decision guide for when to use SML, TOON, Markdown, or JSON.

10 min read

smlcontext-format

SML: The Context Format That Tells LLMs What to Trust

Semantic Markup Language (SML) uses grain type tag names as epistemic signals — telling an LLM not just what information is, but what kind of information it is. Hands-on examples across all 10 grain types, from customer support to incident response.

12 min read

Implement OMS today.

The specification is open and licensed under OWF Final. Read the spec, run the test vectors, and build interoperable agent memory in any language.

OMS v1.3 · .mg Container Definition · Standards Track · OWF Final