Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Stores

Stores give your agent persistent, typed data storage. Define a schema in stores/ and the runtime auto-generates CRUD tools the agent can use.

Store Definition

Each store is a JSON file in stores/:

{
  "name": "active-alerts",
  "entity": {
    "name": "ClassifiedAlert",
    "key": "{event_id}",
    "schema": {
      "event_id": { "type": "string" },
      "title": { "type": "string" },
      "severity": {
        "type": "enum",
        "values": ["P1", "P2", "P3", "P4"]
      },
      "confidence": {
        "type": "number",
        "min": 0,
        "max": 1
      },
      "timestamp": { "type": "datetime" },
      "metadata": {
        "type": "object",
        "fields": {
          "category": { "type": "string" },
          "tags": { "type": "array", "item": { "type": "string" } }
        }
      },
      "relatedAlert": {
        "type": "ref",
        "store": "active-alerts"
      },
      "notes": {
        "type": "string",
        "nullable": true
      }
    }
  },
  "ttl": 86400,
  "ttl_conditional": {
    "default": 86400,
    "override": [
      { "condition": "severity IN ['P1', 'P2']", "ttl": 300 }
    ]
  },
  "failure": {
    "mode": "partial",
    "retries": 3,
    "backoff": "exponential",
    "deadLetter": true
  },
  "history": { "versions": 3 },
  "trace": true
}

Field Types

TypeDescriptionExtra Fields
stringText
numberNumericmin, max
booleanTrue/false
datetimeISO 8601 timestamp
enumOne of predefined valuesvalues: string[]
arrayList of itemsitem: FieldDefinition
objectNested structurefields: Record<string, FieldDefinition>
refReference to another storestore: string

Any field can set nullable: true.

TTL

Simple TTL (seconds):

{ "ttl": 86400 }

Conditional TTL:

{
  "ttl_conditional": {
    "default": 86400,
    "override": [
      { "condition": "severity IN ['P1', 'P2']", "ttl": 300 }
    ]
  }
}

Failure Handling

ModeBehavior
partialContinue on individual write failures
all-or-nothingRollback entire batch on first failure
skipSkip failed writes silently

Auto-Generated Tools

Store names (kebab-case) become tool names (snake_case with store_ prefix):

  • active-alertsstore_active_alerts
  • deal-healthstore_deal_health

The agent uses these tools to get, put, list, delete, and query history on store documents.

Storage Backend

Configured in amodal.json:

{
  "stores": {
    "backend": "pglite",
    "dataDir": ".amodal/store-data"
  }
}
BackendDescription
pgliteSQLite-compatible, in-memory or file-backed (default)
postgresPostgreSQL via postgresUrl

History & Tracing

  • "history": { "versions": 3 } — retain 3 previous versions of each document
  • "trace": true — store reasoning traces alongside documents