Skip to main content

Memory Interchange (MIF & Vault-LD)

Export your agent memory to portable, standards-aligned formats and import it back — so your memory is yours, git-backable, and free of lock-in.

  • MIF (Memory Interchange Format) — markdown + linked-data (JSON-LD) frontmatter projected into a knowledge-graph ontology.
  • Vault-LD — a git / Obsidian-friendly vault-note dialect over the same model.

Both round-trip losslessly within a conformance level, so you can move memory into ZeroMemory (from Mem0 / Zep / Letta) and out (to files you control).

Base URL: https://api.ainative.studio/api/v1/public/memory/v2 · Authorization: Bearer <token>

Formats & conformance levels

Formatformat=Media type
MIF JSON-LDmif-jsonapplication/ld+json
MIF Markdownmif-mdtext/markdown
Vault-LDvault-ldtext/markdown

Levels (level=1..3):

  • L1/L2 — id, content, title, conceptType, namespace, created, tags, properties.
  • L3 — adds relationships, temporal (bi-temporal validity), provenance, embedding (portable {model, dims, source_text}), and summary.

GET /{memory_id}/export

Export a single memory. Owner-scoped (404 if not yours).

curl -H "Authorization: Bearer $TOKEN" \
"https://api.ainative.studio/api/v1/public/memory/v2/$MEMORY_ID/export?format=mif-json&level=3"

format=mif-json returns a MIF JSON-LD document; mif-md returns Markdown with YAML frontmatter; vault-ld returns a Vault-LD note.

Example (MIF JSON-LD, L3):

{
"@context": "https://mif.ainative.studio/context/v1",
"@type": "Memory",
"@id": "urn:mif:memory:...",
"mifVersion": "1.0",
"level": 3,
"content": "Alice is the CTO of AINative.",
"conceptType": "semantic",
"namespace": "project:acme",
"tags": ["team"],
"relationships": [{"type": "Supersedes", "target": "urn:mif:memory:..."}],
"temporal": {"validFrom": "2026-01-01T00:00:00+00:00", "validUntil": null},
"provenance": {"sourceType": "graph_edge", "trustLevel": 0.9},
"embedding": {"model": "bge-m3", "dims": 1024, "source_text": "..."}
}

GET /export — bulk export a namespace

Stream every memory in a namespace as NDJSON (one JSON line per memory). Scoped by user and namespace — no cross-namespace leakage.

curl -H "Authorization: Bearer $TOKEN" \
"https://api.ainative.studio/api/v1/public/memory/v2/export?namespace=project:acme&format=mif-json&level=3"

Each line: {"id": "...", "format": "mif-json", "document": { ... }}.

POST /import

Import one or many MIF / Vault-LD documents through the standard remember() write path — so imported memories get embeddings, entity extraction, and the security scan automatically. namespace is required.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
"https://api.ainative.studio/api/v1/public/memory/v2/import" -d '{
"format": "mif-json",
"namespace": "project:acme",
"documents": [ { "@context": "https://mif.ainative.studio/context/v1", "@type": "Memory", "@id": "urn:mif:memory:1", "content": "..." } ]
}'

Response: {"imported": N, "failed": M, "results": [{"ok": true, "memory_id": "...", "source_id": "..."}]}

FieldTypeDescription
formatstringmif-json | mif-md | vault-ld
namespacestringrequiredglobal | project:<id> | session:<id>
documentsarrayone or more docs (JSON objects or strings)

Malformed or injection-bearing documents are rejected/sanitized per-document.


Migrating from Mem0 / Zep / Letta

The pattern is the same for every source: map the provider's export to MIF documents, then POST them to /import.

import requests
BASE = "https://api.ainative.studio/api/v1/public/memory/v2"

def mem0_to_mif(rec): # Mem0: {id, memory, metadata, created_at}
return {
"@context": "https://mif.ainative.studio/context/v1",
"@type": "Memory",
"@id": f"urn:mif:memory:{rec['id']}",
"content": rec["memory"],
"conceptType": "semantic",
"created": rec.get("created_at"),
"properties": rec.get("metadata") or {},
}

docs = [mem0_to_mif(r) for r in your_mem0_records]
requests.post(f"{BASE}/import",
headers={"Authorization": f"Bearer {TOKEN}"},
json={"format": "mif-json", "namespace": "project:acme", "documents": docs})

Full walkthroughs (Mem0, Zep, Letta) and the conformance reference:

Round-trip guarantee

Export → import is lossless within a conformance level. Export a memory as MIF, re-import it into a new namespace, and it recalls identically — so you can trust your memory is portable, not trapped.