Skip to content

Relationship Types

MIF provides an extensible relationship type system. Implementations SHOULD support the core types for interoperability, but MAY define custom relationship types for domain-specific needs.

Relationship types are not hard-coded. They are defined in bundle configuration and can be extended per-project:

.mif/config.yaml
relationship_types:
# Core types (RECOMMENDED for interoperability)
- name: relates-to
description: General semantic relationship
symmetric: true
- name: derived-from
description: Memory created based on source
inverse: derives
- name: supersedes
description: Replaces an older memory
inverse: superseded-by
- name: conflicts-with
description: Contradicts another memory
symmetric: true
- name: part-of
description: Component of a larger whole
inverse: contains
- name: implements
description: Realizes a concept or pattern
inverse: implemented-by
- name: uses
description: Utilizes a technology or tool
inverse: used-by
- name: created-by
description: Authored by an entity
inverse: creates
- name: mentioned-in
description: Referenced within a memory
inverse: mentions
# Custom types (domain-specific)
- name: reinforces
namespace: subcog
description: Strengthens confidence in another memory
inverse: reinforced-by
- name: contradicts
namespace: subcog
description: Provides evidence against another memory
inverse: contradicted-by
- name: breeds-with
namespace: farm
description: Animal breeding relationship
symmetric: false
properties:
- name: breeding_date
type: date
- name: success
type: boolean

For maximum interoperability, implementations SHOULD recognize these nine core types:

Type Description Inverse Symmetric
relates-to General relationship relates-to Yes
derived-from Created based on source derives No
supersedes Replaces older memory superseded-by No
conflicts-with Contradicts another memory conflicts-with Yes
part-of Component of larger whole contains No
implements Realizes a concept/pattern implemented-by No
uses Utilizes a technology/tool used-by No
created-by Authored by entity creates No
mentioned-in Referenced in memory mentions No

Providers MAY define additional relationship types using namespaced URIs:

# Custom relationship type definition
relationship_types:
- name: contradicts
namespace: farm # Results in type token: farm:contradicts
description: Provides conflicting evidence
inverse: contradicted-by
properties:
- name: contradiction_type
type: string
enum: [direct, indirect, partial]
- name: severity
type: decimal
range: [0.0, 1.0]

JSON-LD representation of custom relationship types:

{
"@context": [
"https://mif-spec.dev/schema/context.jsonld",
{"farm": "https://example.org/farm/"}
],
"relationships": [
{
"type": "farm:breeds-with",
"target": "urn:mif:entity:animal:ram-001",
"strength": 1.0,
"metadata": {
"farm:breeding_date": "2025-10-15",
"farm:success": true
}
}
]
}

Markdown syntax:

Relationships are authoritative in frontmatter relationships[] and mirrored as OKF-legible markdown links in a dedicated body section, using the form - <type> [Text](/path/target.md):

## Relationships
- relates-to [Other Concept](/semantic/other-concept.md)
- derived-from [Source Concept](/episodic/source-concept.md)
- supersedes [Old Concept](/semantic/old-concept.md)
- conflicts-with [Contradicting Concept](/semantic/contradicting-concept.md)
- part-of [Parent Concept](/semantic/parent-concept.md)

The relationship type name is converted to kebab-case in Markdown. The link target is a bundle-relative path to the target concept’s .md file, so a generic OKF consumer sees every edge. The matching frontmatter (one entry per body link):

relationships:
- type: relates-to
target: /semantic/other-concept.md
- type: derived-from
target: /episodic/source-concept.md
- type: supersedes
target: /semantic/old-concept.md
- type: conflicts-with
target: /semantic/contradicting-concept.md
- type: part-of
target: /semantic/parent-concept.md

JSON-LD schema:

"relationships": [
{
"type": "derived-from",
"target": "urn:mif:memory:source-memory",
"strength": 0.9,
"metadata": {
"reason": "Extracted key insight",
"extractedAt": "2026-01-15T10:30:00Z"
}
}
]
Property Type Required Description
type String Yes Relationship type in kebab-case (e.g. derived-from)
target String Yes Target memory or entity path/URN
strength Decimal No Relationship strength (0.0-1.0)
metadata Object No Additional relationship metadata