{
"id": "dev.bastienrobert.memory.record",
"defs": {
"main": {
"key": "tid",
"type": "record",
"record": {
"type": "object",
"required": [
"content",
"createdAt"
],
"properties": {
"kind": {
"type": "string",
"description": "Coarse classification. Open vocabulary: an unknown value is legal and must not be dropped by a consumer.",
"knownValues": [
"fact",
"preference",
"decision",
"context"
]
},
"scope": {
"type": "string",
"maxLength": 512,
"description": "Application label within a Space, never an access boundary. Use separate Spaces for different trust boundaries."
},
"content": {
"type": "string",
"maxLength": 10000,
"description": "The memory itself: one self-contained statement that still makes sense months from now.",
"maxGraphemes": 2500
},
"createdAt": {
"type": "string",
"format": "datetime",
"description": "When the memory was first stated."
},
"updatedAt": {
"type": "string",
"format": "datetime",
"description": "When the memory was last revised, if ever."
},
"occurredAt": {
"ref": "#occurrence",
"type": "ref",
"description": "When the remembered event happened, independent of createdAt. Omit when unknown."
},
"provenance": {
"ref": "#provenance",
"type": "ref",
"description": "Where this memory came from. Advisory: consumers must tolerate its absence."
},
"supersedes": {
"type": "array",
"items": {
"type": "string",
"format": "at-uri"
},
"maxLength": 20,
"description": "Older memories replaced by this statement, several when it merges them into one. Keep history; consumers only mask replacements within the same authorized Space and repo."
}
}
},
"description": "A single durable memory belonging to the user. Deliberately one generic type: specialising into fact/preference/project/event types is premature until real requirements demand it. Retrieval-specific state (BM25 scores, vector ids, index cursors, caches) MUST NOT be stored here — it is derived data owned by whichever memory engine indexes this record. Consumers MUST preserve properties they do not recognise: an implementation that rewrites a record after dropping unknown fields destroys data written by a newer one."
},
"occurrence": {
"type": "object",
"required": [
"from"
],
"properties": {
"to": {
"type": "string",
"format": "datetime"
},
"from": {
"type": "string",
"format": "datetime"
},
"precision": {
"enum": [
"year",
"month",
"day",
"instant"
],
"type": "string",
"description": "Precision of the source statement; year and month dates are anchors, not exact event dates."
}
}
},
"provenance": {
"type": "object",
"properties": {
"agent": {
"type": "string",
"maxLength": 256,
"description": "The agent that wrote the memory, e.g. 'claude-code', 'codex'."
},
"client": {
"type": "string",
"format": "uri",
"description": "OAuth client id of the application that wrote it."
},
"sourceUri": {
"type": "string",
"format": "uri",
"description": "What the memory was derived from, if anything."
}
}
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}