JSON Schema

https://compozy.dev/schemas/memory.json
{
  "type": "object",
  "required": ["id", "vector"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the memory"
    },
    "storage": {
      "type": "object",
      "properties": {
        "use": {
          "type": "string",
          "description": "Storage implementation reference"
        },
        "config": {
          "type": "object",
          "description": "Storage-specific configuration"
        }
      },
      "required": ["use", "config"]
    },
    "vector": {
      "type": "object",
      "properties": {
        "use": {
          "type": "string",
          "description": "Vector store implementation reference"
        },
        "dimensions": {
          "type": "number",
          "description": "Vector dimensions for embeddings"
        },
        "config": {
          "type": "object",
          "description": "Vector store configuration"
        }
      },
      "required": ["use", "dimensions", "config"]
    },
    "embedder": {
      "type": "object",
      "properties": {
        "use": {
          "type": "string",
          "description": "Embedder implementation reference"
        },
        "config": {
          "type": "object",
          "description": "Embedder-specific configuration"
        }
      },
      "required": ["use", "config"]
    },
    "options": {
      "type": "object",
      "properties": {
        "lastMessages": {
          "type": "number",
          "description": "Number of recent messages to include"
        },
        "semanticRecall": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true
            },
            "maxResults": {
              "type": "number",
              "default": 5
            }
          }
        },
        "workingMemory": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": false
            },
            "template": {
              "type": "string",
              "description": "XML template for structured memory"
            }
          }
        }
      }
    }
  }
}

Parameters

memory
object
required
Memory configuration for the workflow.
memory.id
string
required
Unique identifier for the memory.
memory.storage
object
Storage backend configuration. Defaults to in-memory if not specified. See Storage Types for available options.
memory.vector
object
required
Vector storage configuration for semantic search. See Vector Types for available options.
memory.embedder
object
Embedder configuration for vector search. See Embedder Types for available options.
memory.options
object
Memory behavior configuration.

Memory References

memory.<id>.current_thread
object
Current conversation thread data. Example:
{
  "thread_id": "thread_123",
  "messages": [
    {
      "role": "user",
      "content": "Hello!",
      "timestamp": "2024-03-20T10:30:00Z"
    }
  ],
  "metadata": {
    "created_at": "2024-03-20T10:30:00Z",
    "updated_at": "2024-03-20T10:30:00Z"
  }
}
memory.<id>.last_messages
array
Recent message history based on lastMessages configuration. Example:
[
  {
    "role": "user",
    "content": "What's the weather?",
    "timestamp": "2024-03-20T10:29:00Z"
  },
  {
    "role": "assistant",
    "content": "It's sunny today.",
    "timestamp": "2024-03-20T10:29:30Z"
  }
]
Semantic search results. Example:
[
  {
    "content": "Previous relevant conversation",
    "similarity": 0.92,
    "timestamp": "2024-03-19T15:45:00Z",
    "metadata": {
      "thread_id": "thread_122"
    }
  }
]