# dev.bastienrobert.memory.record

> Published by [bastienrobert.spaces-alpha.bsky.network](https://lexicon.garden/identity/did:plc:b3m4nj3hvdeqg5csp7qhlcjs)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:b3m4nj3hvdeqg5csp7qhlcjs/dev.bastienrobert.memory.record)
- [Documentation](https://lexicon.garden/lexicon/did:plc:b3m4nj3hvdeqg5csp7qhlcjs/dev.bastienrobert.memory.record/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:b3m4nj3hvdeqg5csp7qhlcjs/dev.bastienrobert.memory.record/examples)

## Definitions

### `dev.bastienrobert.memory.record`

**Type**: `record`

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.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `kind` | `string` | No | Coarse classification. Open vocabulary: an unknown value is legal and must not be dropped by a consumer. |
| `scope` | `string` | No | Application label within a Space, never an access boundary. Use separate Spaces for different trust boundaries. |
| `content` | `string` | Yes | The memory itself: one self-contained statement that still makes sense months from now. |
| `createdAt` | `string` (datetime) | Yes | When the memory was first stated. |
| `updatedAt` | `string` (datetime) | No | When the memory was last revised, if ever. |
| `occurredAt` | `ref` → `#occurrence` | No | When the remembered event happened, independent of createdAt. Omit when unknown. |
| `provenance` | `ref` → `#provenance` | No | Where this memory came from. Advisory: consumers must tolerate its absence. |
| `supersedes` | `array` | No | 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. |

### `dev.bastienrobert.memory.record#occurrence`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `to` | `string` (datetime) | No |  |
| `from` | `string` (datetime) | Yes |  |
| `precision` | `string` | No | Precision of the source statement; year and month dates are anchors, not exact event dates. |

### `dev.bastienrobert.memory.record#provenance`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `agent` | `string` | No | The agent that wrote the memory, e.g. 'claude-code', 'codex'. |
| `client` | `string` (uri) | No | OAuth client id of the application that wrote it. |
| `sourceUri` | `string` (uri) | No | What the memory was derived from, if anything. |

## Raw Schema

```json
{
  "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
}
```
