# xyz.quasigod.lab.letta.compiledPrompt

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

## Description

Sidecar record caching a conversation's compiled system prompt. Shares the rkey (TID) of its conversation; different collection (the atproto sidecar pattern). Conversations are stable records, so future strongRefs to them keep working while this record mutates.

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:7pezv7mb4agwyktraauhl26g/xyz.quasigod.lab.letta.compiledPrompt)
- [Documentation](https://lexicon.garden/lexicon/did:plc:7pezv7mb4agwyktraauhl26g/xyz.quasigod.lab.letta.compiledPrompt/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:7pezv7mb4agwyktraauhl26g/xyz.quasigod.lab.letta.compiledPrompt/examples)

## Definitions

### `xyz.quasigod.lab.letta.compiledPrompt`

**Type**: `record`

Compiled system prompt for one conversation, stored at the conversation's rkey. Recompile overwrites in place (same rkey, new cid): at most one record per conversation, stable identity.

**Key**: `tid`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `agent` | `string` (at-uri) | Yes | The agent whose system template was compiled. |
| `content` | `string` | Yes | Full compiled system prompt: the agent's template with core memory injected. |
| `compiledAt` | `string` (datetime) | Yes |  |
| `coreMemory` | `string` | Yes | The rendered core-memory portion only. Kept separate from content because it is re-injected mid-conversation as a memory update when memfs changes; it is a substring of content. |
| `conversation` | `string` (at-uri) | Yes | The conversation this prompt belongs to. Matches the record key; kept explicit so the graph is traversable from the conversation. |
| `memfsRevision` | `string` | No | Memfs git revision the core memory was rendered from. Used to detect staleness when memory files change. |
| `rawSystemHash` | `string` | Yes | Hash of the raw system template. Used to detect staleness when the agent's template changes. |

## Raw Schema

```json
{
  "id": "xyz.quasigod.lab.letta.compiledPrompt",
  "defs": {
    "main": {
      "key": "tid",
      "type": "record",
      "record": {
        "type": "object",
        "required": [
          "agent",
          "conversation",
          "content",
          "coreMemory",
          "rawSystemHash",
          "compiledAt"
        ],
        "properties": {
          "agent": {
            "type": "string",
            "format": "at-uri",
            "description": "The agent whose system template was compiled."
          },
          "content": {
            "type": "string",
            "maxLength": 200000,
            "description": "Full compiled system prompt: the agent's template with core memory injected."
          },
          "compiledAt": {
            "type": "string",
            "format": "datetime"
          },
          "coreMemory": {
            "type": "string",
            "maxLength": 200000,
            "description": "The rendered core-memory portion only. Kept separate from content because it is re-injected mid-conversation as a memory update when memfs changes; it is a substring of content."
          },
          "conversation": {
            "type": "string",
            "format": "at-uri",
            "description": "The conversation this prompt belongs to. Matches the record key; kept explicit so the graph is traversable from the conversation."
          },
          "memfsRevision": {
            "type": "string",
            "maxLength": 128,
            "description": "Memfs git revision the core memory was rendered from. Used to detect staleness when memory files change."
          },
          "rawSystemHash": {
            "type": "string",
            "maxLength": 128,
            "description": "Hash of the raw system template. Used to detect staleness when the agent's template changes."
          }
        }
      },
      "description": "Compiled system prompt for one conversation, stored at the conversation's rkey. Recompile overwrites in place (same rkey, new cid): at most one record per conversation, stable identity."
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1,
  "description": "Sidecar record caching a conversation's compiled system prompt. Shares the rkey (TID) of its conversation; different collection (the atproto sidecar pattern). Conversations are stable records, so future strongRefs to them keep working while this record mutates."
}
```
