Skip to content
/ MIF Public

Open standard for portable AI memory interchange. JSON-LD + Markdown dual format with bi-temporal tracking, entity relationships, and W3C PROV provenance.

License

Notifications You must be signed in to change notification settings

zircote/MIF

Repository files navigation

Memory Interchange Format (MIF)

License: MIT Spec Version JSON-LD W3C PROV

An open standard for portable AI memory representation.

Overview

MIF is a proposed standard that aims to enable interoperability between AI memory providers by defining a common data model with dual representations:

  • Markdown (.memory.md) - Human-readable, Obsidian-compatible
  • JSON-LD (.memory.json) - Machine-processable, semantically linked

Why MIF?

How MIF Works

The AI memory ecosystem is fragmented. Mem0, Zep, Letta, LangMem, Subcog, and others all use proprietary schemas. MIF solves:

  • Vendor lock-in - Move memories between providers
  • Data ownership - Local-first, plain text files
  • Interoperability - Common vocabulary for relationships and entities
  • Future-proofing - Standard formats survive provider discontinuation

Quick Start

Minimal Memory (Markdown)

---
id: 550e8400-e29b-41d4-a716-446655440000
type: semantic
created: 2026-01-15T10:30:00Z
namespace: _semantic/preferences
---

User prefers dark mode for all applications.

Minimal Memory (JSON-LD)

{
  "@context": "https://raw.githubusercontent.com/zircote/MIF/main/schema/context.jsonld",
  "@type": "Memory",
  "@id": "urn:mif:550e8400-e29b-41d4-a716-446655440000",
  "memoryType": "semantic",
  "namespace": "_semantic/preferences",
  "content": "User prefers dark mode for all applications.",
  "created": "2026-01-15T10:30:00Z"
}

Key Features

Feature Description
Dual Format Markdown AND JSON-LD representations
Obsidian Native Valid Obsidian notes with wiki-links
Typed Relationships 9 core relationship types (RelatesTo, DerivedFrom, Supersedes, etc.)
Entity Types Person, Organization, Technology, Concept, File
Bi-Temporal Track when recorded AND when facts are valid
Flexible Namespaces _public, _shared, {org}/{scope}+ with reserved prefixes
Model-Agnostic Embeddings Store model + source text for re-embedding
Citations Structured references with type/role taxonomy (Level 3)
W3C PROV Standard provenance tracking
JSON Schema Automated validation for MIF documents
Ontology System Three-type hierarchy with domain extensions

Ontology System

MIF includes an ontology system for organizing memories into three base types:

semantic/              # Facts, concepts, relationships
├── decisions/         # Architectural choices, rationale
├── knowledge/         # APIs, context, learnings, security
└── entities/          # Entity definitions

episodic/              # Events, experiences, timelines
├── incidents/         # Production issues, postmortems
├── sessions/          # Debug sessions, work sessions
└── blockers/          # Impediments, issues

procedural/            # Step-by-step processes
├── runbooks/          # Operational procedures
├── patterns/          # Code conventions, testing
└── migrations/        # Migration steps, upgrades

Features

  • Hierarchical namespaces - Cognitive memory types with sub-namespaces
  • Entity types - Define custom entities with traits and schemas
  • Discovery patterns - Auto-detect capture opportunities from content
  • JSON-LD export - Semantic web compatibility via yaml2jsonld.py
  • Extensible - Domain-specific ontologies extend the base

See ontologies/ for base ontology and examples.

Specification

See SPECIFICATION.md for the complete technical specification.

Validation

JSON Schema files are available for automated validation:

# Validate a MIF document
npx ajv validate -s schema/mif.schema.json -d your-memory.json

# Validate citations only
npx ajv validate -s schema/citation.schema.json -d citation.json

# Validate ontology definitions
npx ajv validate -s schema/ontology/ontology.schema.json -d ontology.yaml

Ontology Conversion

Convert YAML ontologies to JSON-LD for semantic web compatibility:

python scripts/yaml2jsonld.py ontologies/mif-base.ontology.yaml
python scripts/yaml2jsonld.py --all  # Convert all ontologies

Examples

See the examples/ directory for:

  • Minimal memories (Level 1)
  • Standard memories with relationships (Level 2)
  • Full-featured memories with temporal, provenance, and citations (Level 3)

Conformance Levels

Level Requirements
Level 1: Core id, type, content, created
Level 2: Standard + namespace, entities, relationships, timestamps
Level 3: Full + bi-temporal, decay, provenance, embeddings, citations

Migration

MIF includes migration guides for:

  • Mem0
  • Zep
  • Letta (Agent File)
  • Subcog
  • Basic Memory

Contributing

This specification is open source. Contributions welcome:

  1. Open an issue for discussion
  2. Submit PRs for specification changes
  3. Implement and share converters

Related

  • Subcog - AI memory system implementing MIF
  • Mnemonic - Claude Code plugin using MIF ontologies
  • Issue #82 - Original proposal

License

MIT

About

Open standard for portable AI memory interchange. JSON-LD + Markdown dual format with bi-temporal tracking, entity relationships, and W3C PROV provenance.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages