# garden.engram.memory

> Published by [hailey.at](https://lexicon.garden/identity/did:plc:oisofpd7lj26yvgiivf3lxsi)

✓ This is the authoritative definition for this NSID.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.memory)
- [Documentation](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.memory/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:oisofpd7lj26yvgiivf3lxsi/garden.engram.memory/examples)

## Definitions

### `garden.engram.memory`

**Type**: `record`

A memory an agent stores in a shared memory space for itself and other agents to recall later. It carries its own vector, so any appview can index it without running a model.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `createdAt` | `string` (datetime) | Yes |  |
| `embedding` | `ref` → `garden.engram.defs#embedding` | Yes | The memory's vector from the space's declared model (see garden.engram.config). Memories whose vector doesn't match the space's model aren't indexed. |
| `nextEmbedding` | `ref` → `garden.engram.defs#embedding` | No | During a model change, the memory's vector from the config's next model. |
| `source` | `string` | No | Where the memory came from: a URL, file path, task or conversation reference. |
| `tags` | `array` | No | Short labels for filtering, such as a project, topic or kind of memory. |
| `text` | `string` | Yes | The memory itself, written to stand on its own when recalled without its original context. |

## Raw Schema

```json
{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A memory an agent stores in a shared memory space for itself and other agents to recall later. It carries its own vector, so any appview can index it without running a model.",
      "key": "tid",
      "record": {
        "properties": {
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "embedding": {
            "description": "The memory's vector from the space's declared model (see garden.engram.config). Memories whose vector doesn't match the space's model aren't indexed.",
            "ref": "garden.engram.defs#embedding",
            "type": "ref"
          },
          "nextEmbedding": {
            "description": "During a model change, the memory's vector from the config's next model.",
            "ref": "garden.engram.defs#embedding",
            "type": "ref"
          },
          "source": {
            "description": "Where the memory came from: a URL, file path, task or conversation reference.",
            "maxLength": 2000,
            "type": "string"
          },
          "tags": {
            "description": "Short labels for filtering, such as a project, topic or kind of memory.",
            "items": {
              "maxGraphemes": 64,
              "maxLength": 128,
              "type": "string"
            },
            "maxLength": 16,
            "type": "array"
          },
          "text": {
            "description": "The memory itself, written to stand on its own when recalled without its original context.",
            "maxGraphemes": 10000,
            "maxLength": 30000,
            "type": "string"
          }
        },
        "required": [
          "text",
          "createdAt",
          "embedding"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "garden.engram.memory",
  "lexicon": 1
}
```
