Getting Started
This guide walks you through implementing the Memory Interchange Format (MIF) in your project.
Prerequisites
Section titled “Prerequisites”- Basic understanding of JSON-LD or YAML
- A text editor or IDE
- (Optional) Python 3.8+ for tooling
Quick Start
Section titled “Quick Start”Step 1: Create Your First Memory
Section titled “Step 1: Create Your First Memory”MIF memories can be written in Markdown or JSON-LD. Start with Markdown:
---id: my-first-memorytype: semanticcreated: 2026-01-26T10:00:00Z---
User prefers dark mode for all applications.Save this as my-first-memory.memory.md.
Step 2: Add Metadata
Section titled “Step 2: Add Metadata”Expand with recommended fields:
---id: a1b2c3d4-5678-90ab-cdef-1234567890abtype: semanticcreated: 2026-01-26T10:00:00Zmodified: 2026-01-26T10:00:00Znamespace: _semantic/preferencestitle: "Dark Mode Preference"tags: - ui - accessibility - preference---
# Dark Mode Preference
User prefers dark mode for all applications including:- IDE and code editors- Terminal emulators- Web applications- Mobile appsStep 3: Declare an Ontology (Optional)
Section titled “Step 3: Declare an Ontology (Optional)”If using a custom ontology, declare it:
---id: a1b2c3d4-5678-90ab-cdef-1234567890abtype: semanticcreated: 2026-01-26T10:00:00Zontology: id: regenerative-agriculture version: "1.0.0"namespace: _semantic/livestock---
Herd of 85 Angus-cross beef cattle managed with adaptive multi-paddock grazing.Memory Types
Section titled “Memory Types”MIF uses three base memory types reflecting how human cognition organizes information:
| Type | Description | Use For |
|---|---|---|
semantic | Facts, concepts, and knowledge | Decisions, preferences, facts, domain knowledge |
episodic | Events and experiences | Incidents, sessions, conversations, timelines |
procedural | How-to processes | Runbooks, patterns, migration guides, workflows |
Specific categorization is expressed through namespaces (e.g., _semantic/decisions, _episodic/incidents).
Conformance Levels
Section titled “Conformance Levels”MIF supports three conformance levels:
Level 1: Core (Minimal)
Section titled “Level 1: Core (Minimal)”Required fields only:
---id: uuid-heretype: semanticcreated: 2026-01-26T10:00:00Z---
Memory content here.Level 2: Standard (Recommended)
Section titled “Level 2: Standard (Recommended)”Add namespaces, entities, and relationships:
---id: uuid-heretype: semanticcreated: 2026-01-26T10:00:00Zmodified: 2026-01-26T10:00:00Znamespace: _semantic/decisionstitle: "Use PostgreSQL for Data Storage"tags: - database - architecture---
# Use PostgreSQL for Data Storage
## Context
We need a relational database for the new service.
## Decision
PostgreSQL for:- Strong JSON support- Excellent performance- Team familiarity
## Relationships
- relates-to [[database-requirements]]- supersedes [[sqlite-investigation]]
## Entities
- @[[PostgreSQL|Technology]]- @[[MySQL|Technology]]Level 3: Full
Section titled “Level 3: Full”Add temporal metadata, provenance, and citations:
---id: uuid-heretype: semanticcreated: 2026-01-26T10:00:00Ztemporal: valid_from: 2026-01-26T00:00:00Z recorded_at: 2026-01-26T10:00:00Z ttl: P365D decay: model: exponential halfLife: P30D strength: 1.0provenance: source_type: user_explicit agent: claude-opus-4 confidence: 0.95 trust_level: user_statedcitations: - type: documentation title: "PostgreSQL Documentation" url: https://www.postgresql.org/docs/ role: background relevance: 0.9---Decay Values: The
halfLife: P30Dmeans memory strength halves every 30 days. Common values: P7D (short-term), P14D (medium-term), P30D (long-term). These are pragmatic defaults inspired by Ebbinghaus’s forgetting curve research. See the Specification for details.
Directory Structure
Section titled “Directory Structure”Organize your MIF vault using the three base types:
my-project/├── .mif/│ ├── config.yaml # Vault configuration│ └── entities/ # Entity definitions├── memories/│ ├── semantic/ # Facts, concepts, knowledge│ │ ├── decisions/│ │ ├── knowledge/│ │ └── entities/│ ├── episodic/ # Events, experiences│ │ ├── incidents/│ │ └── sessions/│ └── procedural/ # Processes, how-to│ ├── runbooks/│ └── patterns/└── ontology.yaml # Custom ontology (optional)Using Custom Ontologies
Section titled “Using Custom Ontologies”Create an Ontology
Section titled “Create an Ontology”ontology: id: my-project version: "1.0.0" description: "Custom ontology for my project"
namespaces: features: description: "Product features" type_hint: semantic sprints: description: "Sprint records" type_hint: episodic
entity_types: - name: feature base: semantic traits: [lifecycle] schema: required: [name, status] properties: name: { type: string } status: { type: string, enum: [planned, active, deprecated] }Reference in Memories
Section titled “Reference in Memories”---id: feature-dark-modetype: semanticcreated: 2026-01-26T10:00:00Zontology: id: my-project version: "1.0.0"namespace: _semantic/features---
# Dark Mode Feature
Status: activePriority: highJSON-LD Format
Section titled “JSON-LD Format”For machine processing, use JSON-LD:
{ "@context": "https://mif-spec.dev/schema/context.jsonld", "@type": "Memory", "@id": "urn:mif:a1b2c3d4-5678-90ab-cdef-1234567890ab", "memoryType": "semantic", "content": "User prefers dark mode for all applications.", "created": "2026-01-26T10:00:00Z", "ontology": { "@type": "OntologyReference", "id": "mif-base", "version": "1.0.0" }, "namespace": "_semantic/preferences", "tags": ["ui", "accessibility"]}Validation
Section titled “Validation”Validate MIF documents using JSON Schema:
# Install ajv-clinpm install -g ajv-cli
# Validate a memorynpx ajv validate -s schema/mif.schema.json -d my-memory.json
# Validate a citationnpx ajv validate -s schema/citation.schema.json -d citation.json
# Validate an ontologynpx ajv validate -s schema/ontology/ontology.schema.json -d ontology.yamlConverting Ontologies
Section titled “Converting Ontologies”Convert YAML ontologies to JSON-LD:
# Single filepython scripts/yaml2jsonld.py ontologies/my-ontology.ontology.yaml
# All ontologiespython scripts/yaml2jsonld.py --allNext Steps
Section titled “Next Steps”- Read the full specification
- Review the Schema Reference
- Check the Migration Guide if converting from other systems