This document provides a complete reference for all MIF JSON Schemas.
Overview
MIF provides three JSON Schemas for validation:
Schema Purpose Location mif.schema.jsonComplete MIF document validation https://mif-spec.dev/schema/mif.schema.jsoncitation.schema.jsonStandalone citation validation https://mif-spec.dev/schema/citation.schema.jsonontology.schema.jsonOntology definition validation https://mif-spec.dev/schema/ontology/ontology.schema.json
All schemas use JSON Schema Draft 2020-12.
MIF Document Schema
ID: https://mif-spec.dev/schema/mif.schema.json
Required Fields
Field Type Description @contextstring/array/object JSON-LD context @type"Memory" or array containing "Memory"Document type @idstring (pattern: ^urn:mif:) Unique identifier memoryTypeenum Memory classification contentstring (minLength: 1) Memory content createdstring (date-time) Creation timestamp
Memory Types
MIF uses three base memory types:
" semantic " , // Facts, concepts, decisions, preferences, knowledge
" episodic " , // Events, experiences, sessions, incidents
" procedural " // Processes, runbooks, patterns, how-to guides
Type Description Use For semanticDeclarative knowledge Facts, decisions, preferences, concepts episodicTime-bound experiences Incidents, sessions, conversations proceduralHow-to knowledge Runbooks, patterns, migration guides
Ontologies can define extended types that map to these base types via namespace conventions (e.g., _semantic/decisions, _episodic/incidents).
Optional Fields
Field Type Description titlestring Human-readable title modifieddate-time Last modification timestamp namespacestring (pattern) Hierarchical scope tagsarray of strings Classification tags aliasesarray of strings Alternative names
Ontology Reference
"@type" : " OntologyReference " ,
"id" : " ontology-identifier " ,
"uri" : " https://example.com/ontology.yaml "
Field Required Description idYes Ontology identifier (pattern: ^[a-z][a-z0-9-]*$) versionNo Semantic version (pattern: ^\d+\.\d+\.\d+.*$) uriNo URL to ontology definition
Entities
"@type" : " EntityReference " ,
"entity" : { "@id" : " urn:mif:entity:person:jane-doe " },
Field Required Description @typeYes Must be "EntityReference" entityYes Object with @id (pattern: ^urn:mif:entity:) entityTypeNo Person, Organization, Technology, Concept, FilenameNo Display name roleNo Role in memory context
Relationships
"relationshipType" : " DerivedFrom " ,
"target" : { "@id" : " urn:mif:memory:source-id " },
"metadata" : { "reason" : " Extracted insight " }
Field Required Description @typeYes Must be "Relationship" relationshipTypeYes See relationship types below targetYes Object with @id (pattern: ^urn:mif:) strengthNo 0.0-1.0 relationship strength metadataNo Additional properties
Relationship Types:
Type Description 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
"@type" : " TemporalMetadata " ,
"validFrom" : " 2026-01-26T00:00:00Z " ,
"recordedAt" : " 2026-01-26T10:00:00Z " ,
"lastAccessed" : " 2026-01-26T14:00:00Z "
Field Type Description validFromdate-time or null When fact becomes valid validUntildate-time or null When fact expires recordedAtdate-time Transaction time ttlISO 8601 duration Time-to-live decay.modelenum none, linear, exponential, stepdecay.halfLifeISO 8601 duration Decay half-life decay.currentStrength0.0-1.0 Current strength accessCountinteger Times accessed lastAccesseddate-time Last access time
Recommended Half-Life Values:
Duration Use Case P7DShort-term context, episodic memories P14DMedium-term project context P30DLong-term knowledge, semantic memories
These values are pragmatic validity/freshness defaults. The cognitive-memory rationale for tuning them lives in the AI Memory profile. See the Specification for detailed rationale.
Provenance
"sourceType" : " user_explicit " ,
"trustLevel" : " user_stated "
Field Values Description sourceTypeuser_explicit, user_implicit, agent_inferred, external_import, system_generatedHow memory was created confidence0.0-1.0 Confidence score trustLevelverified, user_stated, high_confidence, moderate_confidence, low_confidence, uncertainTrust classification
Embedding Reference
"@type" : " EmbeddingReference " ,
"model" : " text-embedding-3-small " ,
"modelVersion" : " 2024-01 " ,
"sourceText" : " The text that was embedded " ,
"vectorUri" : " urn:mif:vector:memory-id " ,
Citations
"citationType" : " article " ,
"citationRole" : " supports " ,
"title" : " Research Paper Title " ,
"url" : " https://example.com/paper " ,
"author" : " Jane Smith et al. " ,
"accessed" : " 2026-01-20 " ,
"note" : " Key supporting evidence "
See Citation Schema for full details.
Compression (Level 3)
Field Type Description summarystring (max 500 chars) Compressed content summary compressedAtdate-time When compression was applied
Extensions
"hash" : " sha256:abc123... "
Citation Schema
ID: https://mif-spec.dev/schema/citation.schema.json
Required Fields
Field Type Description @type"Citation"Must be Citation citationTypeenum or namespaced Source category citationRoleenum or namespaced Relationship to memory titlestring (minLength: 1) Citation title urlURI Citation URL
Citation Types
Type Description 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
Citation Roles
Role Description 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
Optional Fields
Field Type Description authorEntityReference, array, or string Author(s) datedate (YYYY-MM-DD) Publication date accesseddate (YYYY-MM-DD) Access date relevance0.0-1.0 Relevance score notestring (max 1000 chars) Annotation
Example
"citationType" : " article " ,
"citationRole" : " supports " ,
"title" : " Memory Systems in AI Agents " ,
"url" : " https://arxiv.org/abs/2024.12345 " ,
"@type" : " EntityReference " ,
"entity" : { "@id" : " urn:mif:entity:person:jane-smith " },
"accessed" : " 2026-01-20 " ,
"note" : " Foundational paper on semantic memory "
Ontology Schema
ID: https://mif-spec.dev/schema/ontology/ontology.schema.json
Structure
description : " Description "
schema_url : https://example.com/schema
description : " Facts and concepts "
traits : [ versioned , documented ]
description : " Supports versioning "
version : { type : string }
description : " Realizes a concept "
confidence_threshold : 0.8
- content_pattern : " \\ b(PostgreSQL|MySQL) \\ b "
suggest_entity : technology
suggest_namespace : _semantic/entities
Field Required Description idYes Identifier (pattern: ^[a-z][a-z0-9-]*$) versionYes Semantic version descriptionNo Human description schema_urlNo External schema URL
Namespace Definition
Field Description descriptionNamespace description type_hintDefault memory type: semantic, episodic, procedural replacesBase namespace this replaces childrenChild namespaces (recursive)
Entity Type Definition
Field Required Description nameYes Type name (pattern: ^[a-z][a-z0-9-]*$) baseYes Base type: semantic, episodic, procedural descriptionNo Type description traitsNo Array of trait names schemaNo JSON Schema for entity fields
Trait Definition
Field Description descriptionTrait description fieldsField definitions (JSON Schema) requiresRequired MIF fields
Relationship Definition
Field Description descriptionRelationship description fromSource entity types toTarget entity types symmetricWhether bidirectional
Discovery Pattern
Field Required Description content_patternNo Regex to match content file_patternNo Glob to match files suggest_entityYes Entity type to suggest suggest_namespaceNo Namespace to suggest
Validation
Using ajv-cli
npx ajv validate -s https://mif-spec.dev/schema/mif.schema.json -d memory.json
# Validate with verbose output
npx ajv validate -s https://mif-spec.dev/schema/mif.schema.json -d memory.json --verbose
# Validate multiple files
npx ajv validate -s https://mif-spec.dev/schema/mif.schema.json -d " memories/*.json "
Using Python
with open ( ' schema/mif.schema.json ' ) as f:
with open ( ' memory.json ' ) as f:
jsonschema. validate ( document , schema )
Common Validation Errors
Error Cause Fix @id must match patternInvalid URN format Use urn:mif: prefix memoryType must be equal to one ofInvalid type Use valid memory type created must match format date-timeBad timestamp Use ISO 8601 format namespace must match patternInvalid namespace Use alphanumeric with / separators
Schema URLs
Schemas are 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)
https://mif-spec.dev/schema/ontology/ontology.schema.json