Skip to content

Schema Reference

This document provides a complete reference for all MIF JSON Schemas.

MIF provides three JSON Schemas for validation:

SchemaPurposeLocation
mif.schema.jsonComplete MIF document validationschema/mif.schema.json
citation.schema.jsonStandalone citation validationschema/citation.schema.json
ontology.schema.jsonOntology definition validationschema/ontology/ontology.schema.json

All schemas use JSON Schema Draft 2020-12.


File: schema/mif.schema.json ID: https://mif-spec.dev/schema/mif.schema.json

FieldTypeDescription
@contextstring/array/objectJSON-LD context
@type"Memory" or array containing "Memory"Document type
@idstring (pattern: ^urn:mif:)Unique identifier
memoryTypeenumMemory classification
contentstring (minLength: 1)Memory content
createdstring (date-time)Creation timestamp

MIF uses three base memory types:

"memoryType": {
"enum": [
"semantic", // Facts, concepts, decisions, preferences, knowledge
"episodic", // Events, experiences, sessions, incidents
"procedural" // Processes, runbooks, patterns, how-to guides
]
}
TypeDescriptionUse For
semanticDeclarative knowledgeFacts, decisions, preferences, concepts
episodicTime-bound experiencesIncidents, sessions, conversations
proceduralHow-to knowledgeRunbooks, patterns, migration guides

Ontologies can define extended types that map to these base types via namespace conventions (e.g., _semantic/decisions, _episodic/incidents).

FieldTypeDescription
titlestringHuman-readable title
modifieddate-timeLast modification timestamp
namespacestring (pattern)Hierarchical scope
tagsarray of stringsClassification tags
aliasesarray of stringsAlternative names
"ontology": {
"@type": "OntologyReference",
"id": "ontology-identifier",
"version": "1.0.0",
"uri": "https://example.com/ontology.yaml"
}
FieldRequiredDescription
idYesOntology identifier (pattern: ^[a-z][a-z0-9-]*$)
versionNoSemantic version (pattern: ^\d+\.\d+\.\d+.*$)
uriNoURL to ontology definition
"entities": [
{
"@type": "EntityReference",
"entity": { "@id": "urn:mif:entity:person:jane-doe" },
"entityType": "Person",
"name": "Jane Doe",
"role": "author"
}
]
FieldRequiredDescription
@typeYesMust be "EntityReference"
entityYesObject with @id (pattern: ^urn:mif:entity:)
entityTypeNoPerson, Organization, Technology, Concept, File
nameNoDisplay name
roleNoRole in memory context
"relationships": [
{
"@type": "Relationship",
"relationshipType": "DerivedFrom",
"target": { "@id": "urn:mif:memory:source-id" },
"strength": 0.9,
"metadata": { "reason": "Extracted insight" }
}
]
FieldRequiredDescription
@typeYesMust be "Relationship"
relationshipTypeYesSee relationship types below
targetYesObject with @id (pattern: ^urn:mif:)
strengthNo0.0-1.0 relationship strength
metadataNoAdditional properties

Relationship Types:

TypeDescription
RelatesToGeneral relationship
DerivedFromCreated based on source
SupersedesReplaces older memory
ConflictsWithContradicts another memory
PartOfComponent of larger whole
ImplementsRealizes a concept/pattern
UsesUtilizes a technology/tool
CreatedAuthored by entity
MentionedInReferenced in memory
"temporal": {
"@type": "TemporalMetadata",
"validFrom": "2026-01-26T00:00:00Z",
"validUntil": null,
"recordedAt": "2026-01-26T10:00:00Z",
"ttl": "P90D",
"decay": {
"model": "exponential",
"halfLife": "P7D",
"currentStrength": 0.85
},
"accessCount": 5,
"lastAccessed": "2026-01-26T14:00:00Z"
}
FieldTypeDescription
validFromdate-time or nullWhen fact becomes valid
validUntildate-time or nullWhen fact expires
recordedAtdate-timeTransaction time
ttlISO 8601 durationTime-to-live
decay.modelenumnone, linear, exponential, step
decay.halfLifeISO 8601 durationDecay half-life
decay.currentStrength0.0-1.0Current strength
accessCountintegerTimes accessed
lastAccesseddate-timeLast access time

Recommended Half-Life Values:

DurationUse Case
P7DShort-term context, episodic memories
P14DMedium-term project context
P30DLong-term knowledge, semantic memories

These values are pragmatic defaults inspired by Ebbinghaus’s forgetting curve research, adapted for AI memory systems. See the Specification for detailed rationale and scientific background.

"provenance": {
"@type": "prov:Entity",
"sourceType": "user_explicit",
"confidence": 0.95,
"trustLevel": "user_stated"
}
FieldValuesDescription
sourceTypeuser_explicit, user_implicit, agent_inferred, external_import, system_generatedHow memory was created
confidence0.0-1.0Confidence score
trustLevelverified, user_stated, high_confidence, moderate_confidence, low_confidence, uncertainTrust classification
"embedding": {
"@type": "EmbeddingReference",
"model": "text-embedding-3-small",
"modelVersion": "2024-01",
"dimensions": 1536,
"sourceText": "The text that was embedded",
"vectorUri": "urn:mif:vector:memory-id",
"normalized": true
}
"citations": [
{
"@type": "Citation",
"citationType": "article",
"citationRole": "supports",
"title": "Research Paper Title",
"url": "https://example.com/paper",
"author": "Jane Smith et al.",
"date": "2024-06-15",
"accessed": "2026-01-20",
"relevance": 0.95,
"note": "Key supporting evidence"
}
]

See Citation Schema for full details.

FieldTypeDescription
summarystring (max 500 chars)Compressed content summary
compressedAtdate-timeWhen compression was applied
"extensions": {
"subcog": {
"domain": "user",
"hash": "sha256:abc123..."
},
"custom_provider": {
"custom_field": "value"
}
}

File: schema/citation.schema.json ID: https://mif-spec.dev/schema/citation.schema.json

FieldTypeDescription
@type"Citation"Must be Citation
citationTypeenum or namespacedSource category
citationRoleenum or namespacedRelationship to memory
titlestring (minLength: 1)Citation title
urlURICitation URL
TypeDescription
articleJournal article, blog post
bookPublished book
paperConference/research paper
websiteGeneral website
documentationTechnical documentation
repositoryCode repository
videoVideo content
podcastPodcast episode
specificationTechnical specification
datasetData source
toolSoftware tool or service
otherMiscellaneous

Custom types use namespace prefix: acme:memo, research:lab-notes

RoleDescription
supportsProvides supporting evidence
refutesContradicts or disputes
backgroundGeneral context/reference
methodologyMethod or approach source
contradictsConflicts with claims
extendsBuilds upon cited work
derivedDirect derivation source
sourcePrimary source material
exampleIllustrative example
reviewCritical review/analysis

Custom roles use namespace prefix: legal:precedent, research:replicates

FieldTypeDescription
authorEntityReference, array, or stringAuthor(s)
datedate (YYYY-MM-DD)Publication date
accesseddate (YYYY-MM-DD)Access date
relevance0.0-1.0Relevance score
notestring (max 1000 chars)Annotation
{
"@type": "Citation",
"citationType": "article",
"citationRole": "supports",
"title": "Memory Systems in AI Agents",
"url": "https://arxiv.org/abs/2024.12345",
"author": {
"@type": "EntityReference",
"entity": { "@id": "urn:mif:entity:person:jane-smith" },
"entityType": "Person",
"name": "Jane Smith"
},
"date": "2024-06-15",
"accessed": "2026-01-20",
"relevance": 0.95,
"note": "Foundational paper on semantic memory"
}

File: schema/ontology/ontology.schema.json ID: https://mif-spec.dev/schema/ontology/ontology.schema.json

ontology:
id: my-ontology
version: "1.0.0"
description: "Description"
schema_url: https://example.com/schema
namespaces:
semantic:
description: "Facts and concepts"
type_hint: semantic
children:
decisions: {}
knowledge: {}
entity_types:
- name: component
base: semantic
traits: [versioned, documented]
schema:
required: [name]
properties:
name: { type: string }
traits:
versioned:
description: "Supports versioning"
fields:
version: { type: string }
relationships:
implements:
description: "Realizes a concept"
from: [component]
to: [concept]
symmetric: false
discovery:
enabled: true
confidence_threshold: 0.8
patterns:
- content_pattern: "\\b(PostgreSQL|MySQL)\\b"
suggest_entity: technology
suggest_namespace: _semantic/entities
FieldRequiredDescription
idYesIdentifier (pattern: ^[a-z][a-z0-9-]*$)
versionYesSemantic version
descriptionNoHuman description
schema_urlNoExternal schema URL
FieldDescription
descriptionNamespace description
type_hintDefault memory type: semantic, episodic, procedural
replacesBase namespace this replaces
childrenChild namespaces (recursive)
FieldRequiredDescription
nameYesType name (pattern: ^[a-z][a-z0-9-]*$)
baseYesBase type: semantic, episodic, procedural
descriptionNoType description
traitsNoArray of trait names
schemaNoJSON Schema for entity fields
FieldDescription
descriptionTrait description
fieldsField definitions (JSON Schema)
requiresRequired MIF fields
FieldDescription
descriptionRelationship description
fromSource entity types
toTarget entity types
symmetricWhether bidirectional
FieldRequiredDescription
content_patternNoRegex to match content
file_patternNoGlob to match files
suggest_entityYesEntity type to suggest
suggest_namespaceNoNamespace to suggest

Terminal window
# Install
npm install -g ajv-cli
# Validate MIF document
npx ajv validate -s schema/mif.schema.json -d memory.json
# Validate with verbose output
npx ajv validate -s schema/mif.schema.json -d memory.json --verbose
# Validate multiple files
npx ajv validate -s schema/mif.schema.json -d "memories/*.json"
import json
import jsonschema
# Load schema
with open('schema/mif.schema.json') as f:
schema = json.load(f)
# Load document
with open('memory.json') as f:
document = json.load(f)
# Validate
jsonschema.validate(document, schema)
ErrorCauseFix
@id must match patternInvalid URN formatUse urn:mif: prefix
memoryType must be equal to one ofInvalid typeUse valid memory type
created must match format date-timeBad timestampUse ISO 8601 format
namespace must match patternInvalid namespaceUse alphanumeric with / separators

Production schemas will be available at:

  • https://mif-spec.dev/schema/mif.schema.json
  • https://mif-spec.dev/schema/citation.schema.json
  • https://mif-spec.dev/schema/context.jsonld (JSON-LD context)

During development, reference local files or GitHub raw URLs.