{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://genai-security-project.github.io/agent-control-standard/schema/v0.1.0/hooks/memory-context-retrieval.json",
  "title": "steps/memoryContextRetrieval payload",
  "description": "Payload for the memoryContextRetrieval hook. Fires when the agent reads from persistent memory.",
  "type": "object",
  "required": ["results"],
  "properties": {
    "query": {
      "type": "object",
      "properties": {
        "value": { "type": "string" },
        "provenance": { "$ref": "../provenance.json" }
      }
    },
    "memory_store": {
      "type": "object",
      "properties": {
        "name": { "type": "string" },
        "scope": { "type": "string", "enum": ["session", "user", "tenant", "global"] }
      }
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["value"],
        "properties": {
          "memory_id": { "type": "string" },
          "value": {},
          "stored_at": { "type": "string", "format": "date-time" },
          "provenance": {
            "$ref": "../provenance.json",
            "description": "OPTIONAL in the base schema; REQUIRED on every result under provenance_producer: deterministic (ACS-Provenance). Validate against memory-context-retrieval.acs-provenance.json when the profile is claimed. See Specification section 7."
          }
        }
      }
    }
  }
}
