ContextDB · Schema

FormationJob

Artificial IntelligenceMemoryCustomer DataAgent PlatformContext

Properties

Name Type Description
job_id string
status object
mode string
attempt_count integer
provider_attempts integer
max_attempts integer
max_provider_attempts integer
terminal_reason object
error_code stringnull
accepted_count integer
rejected_count integer
provider string
model string
provider_latency_ms integer
provider_cost_usd numbernull
elapsed_ms integer
created_at string
started_at stringnull
completed_at stringnull
attempts array
result object
request_id string
View JSON Schema on GitHub

JSON Schema

contextdb-ai-formation-job-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/contextdb-ai/json-schema/contextdb-ai-formation-job-schema.json",
  "title": "FormationJob",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/contextdb-ai-openapi.yaml#/components/schemas/FormationJob",
  "type": "object",
  "required": [
    "job_id",
    "status",
    "mode",
    "attempt_count",
    "provider_attempts",
    "max_attempts",
    "max_provider_attempts",
    "terminal_reason",
    "error_code",
    "accepted_count",
    "rejected_count",
    "provider",
    "model",
    "provider_latency_ms",
    "provider_cost_usd",
    "elapsed_ms",
    "created_at",
    "started_at",
    "completed_at",
    "attempts",
    "result",
    "request_id"
  ],
  "properties": {
    "job_id": {
      "type": "string",
      "pattern": "^frm_[a-f0-9]{32}$"
    },
    "status": {
      "$ref": "#/$defs/FormationJobStatus"
    },
    "mode": {
      "type": "string",
      "enum": [
        "propose",
        "commit"
      ]
    },
    "attempt_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 4
    },
    "provider_attempts": {
      "type": "integer",
      "minimum": 0,
      "maximum": 3
    },
    "max_attempts": {
      "type": "integer",
      "minimum": 1,
      "maximum": 4
    },
    "max_provider_attempts": {
      "type": "integer",
      "minimum": 1,
      "maximum": 3
    },
    "terminal_reason": {
      "oneOf": [
        {
          "$ref": "#/$defs/FormationTerminalReason"
        },
        {
          "type": "null"
        }
      ]
    },
    "error_code": {
      "type": [
        "string",
        "null"
      ]
    },
    "accepted_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 20
    },
    "rejected_count": {
      "type": "integer",
      "minimum": 0,
      "maximum": 40
    },
    "provider": {
      "type": "string"
    },
    "model": {
      "type": "string"
    },
    "provider_latency_ms": {
      "type": "integer",
      "minimum": 0
    },
    "provider_cost_usd": {
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "elapsed_ms": {
      "type": "integer",
      "minimum": 0
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "started_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "completed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "attempts": {
      "type": "array",
      "maxItems": 4,
      "items": {
        "$ref": "#/$defs/FormationAttempt"
      }
    },
    "result": {
      "oneOf": [
        {
          "$ref": "#/$defs/FormationJobResult"
        },
        {
          "type": "null"
        }
      ]
    },
    "request_id": {
      "type": "string"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "EpistemicSource": {
      "type": "string",
      "enum": [
        "user_stated",
        "agent_inferred",
        "third_party"
      ],
      "description": "Who vouches for the claim. Required on writes."
    },
    "EvolutionOperation": {
      "type": "string",
      "enum": [
        "add",
        "update",
        "delete",
        "noop"
      ]
    },
    "EvolutionOutcome": {
      "type": "string",
      "enum": [
        "added",
        "updated",
        "deleted",
        "noop",
        "contested"
      ]
    },
    "FormationAttempt": {
      "type": "object",
      "required": [
        "attempt",
        "status",
        "provider_called",
        "provider",
        "model",
        "latency_ms",
        "accepted_count",
        "rejected_count",
        "provider_cost_usd",
        "error_code",
        "failure_reason",
        "started_at",
        "finished_at"
      ],
      "properties": {
        "attempt": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4
        },
        "status": {
          "type": "string",
          "enum": [
            "running",
            "succeeded",
            "retry",
            "failed",
            "worker_lost",
            "deadline_exceeded"
          ]
        },
        "provider_called": {
          "type": "boolean"
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "latency_ms": {
          "type": "integer",
          "minimum": 0
        },
        "accepted_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "rejected_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "provider_cost_usd": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "error_code": {
          "type": [
            "string",
            "null"
          ]
        },
        "failure_reason": {
          "type": [
            "string",
            "null"
          ]
        },
        "started_at": {
          "type": "string",
          "format": "date-time"
        },
        "finished_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      },
      "additionalProperties": false
    },
    "FormationCandidateReview": {
      "type": "object",
      "required": [
        "content",
        "quote",
        "turn_indexes",
        "source",
        "confidence",
        "action_relevant",
        "entity",
        "attribute",
        "operation",
        "target_memory_id",
        "noop_reason",
        "candidate_key",
        "accepted",
        "rejection_reason"
      ],
      "properties": {
        "content": {
          "type": [
            "string",
            "null"
          ]
        },
        "quote": {
          "type": [
            "string",
            "null"
          ],
          "description": "Exact PII-processed quote supporting an accepted candidate"
        },
        "turn_indexes": {
          "type": "array",
          "items": {
            "type": "integer",
            "minimum": 0
          }
        },
        "source": {
          "oneOf": [
            {
              "$ref": "#/$defs/EpistemicSource"
            },
            {
              "type": "null"
            }
          ]
        },
        "confidence": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "action_relevant": {
          "type": [
            "boolean",
            "null"
          ]
        },
        "entity": {
          "type": [
            "string",
            "null"
          ]
        },
        "attribute": {
          "type": [
            "string",
            "null"
          ]
        },
        "operation": {
          "oneOf": [
            {
              "$ref": "#/$defs/EvolutionOperation"
            },
            {
              "type": "null"
            }
          ]
        },
        "target_memory_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "noop_reason": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 64
        },
        "candidate_key": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^fmc_[a-f0-9]{40}$"
        },
        "accepted": {
          "type": "boolean"
        },
        "candidate_index": {
          "type": "integer",
          "minimum": -1
        },
        "rejection_reason": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "FormationJobResult": {
      "type": "object",
      "required": [
        "mode",
        "terminal_reason",
        "candidates",
        "memory_ids",
        "operation_results",
        "operation_counts",
        "memory_version",
        "primary_wal_lsn",
        "accepted_count",
        "rejected_count",
        "provider",
        "model",
        "turns",
        "provider_attempts",
        "provider_latency_ms",
        "provider_cost_usd",
        "error_code"
      ],
      "properties": {
        "mode": {
          "type": "string",
          "enum": [
            "propose",
            "commit"
          ]
        },
        "terminal_reason": {
          "$ref": "#/$defs/FormationTerminalReason"
        },
        "candidates": {
          "type": "array",
          "maxItems": 60,
          "items": {
            "$ref": "#/$defs/FormationCandidateReview"
          }
        },
        "memory_ids": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "string"
          }
        },
        "operation_results": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/FormationOperationResult"
          }
        },
        "operation_counts": {
          "$ref": "#/$defs/FormationOperationCounts"
        },
        "memory_version": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0
        },
        "primary_wal_lsn": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[0-9A-Fa-f]+/[0-9A-Fa-f]+$"
        },
        "accepted_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "rejected_count": {
          "type": "integer",
          "minimum": 0,
          "maximum": 40
        },
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "turns": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "provider_attempts": {
          "type": "integer",
          "minimum": 0,
          "maximum": 3
        },
        "provider_latency_ms": {
          "type": "integer",
          "minimum": 0
        },
        "provider_cost_usd": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0
        },
        "error_code": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "FormationJobStatus": {
      "type": "string",
      "enum": [
        "queued",
        "running",
        "retry_wait",
        "succeeded",
        "failed"
      ]
    },
    "FormationOperationCounts": {
      "type": "object",
      "required": [
        "added",
        "updated",
        "deleted",
        "noop"
      ],
      "properties": {
        "added": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "updated": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "deleted": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "noop": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        }
      },
      "additionalProperties": false
    },
    "FormationOperationResult": {
      "type": "object",
      "required": [
        "candidate_key",
        "requested_operation",
        "applied_operation",
        "outcome",
        "memory_id",
        "previous_memory_ids",
        "deleted_memory_ids",
        "target_memory_id",
        "noop_reason"
      ],
      "properties": {
        "candidate_key": {
          "type": "string",
          "pattern": "^(?:fmc_[a-f0-9]{40}|legacy_v1_[0-9]+)$"
        },
        "requested_operation": {
          "$ref": "#/$defs/EvolutionOperation"
        },
        "applied_operation": {
          "$ref": "#/$defs/EvolutionOperation"
        },
        "outcome": {
          "$ref": "#/$defs/EvolutionOutcome"
        },
        "memory_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "previous_memory_ids": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string"
          }
        },
        "deleted_memory_ids": {
          "type": "array",
          "maxItems": 100,
          "items": {
            "type": "string"
          }
        },
        "target_memory_id": {
          "type": [
            "string",
            "null"
          ]
        },
        "noop_reason": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 256
        }
      },
      "additionalProperties": false
    },
    "FormationTerminalReason": {
      "type": "string",
      "enum": [
        "completed",
        "no_memories",
        "input_rejected",
        "pii_rejected",
        "scope_rejected",
        "result_rejected",
        "provider_unavailable",
        "provider_error",
        "deadline_exceeded",
        "max_attempts",
        "worker_lost",
        "commit_rejected",
        "storage_error",
        "internal_error",
        "configuration_changed"
      ]
    }
  }
}

Work with this as data

Every JSON Schema here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for schemas

4 MCP tools reach this
  • find_json_schemasBrowse and filter every JSON Schema in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This JSON Schema
curl "https://apis.io/api/v1/json-schemas/contextdb-ai-formation-job"
All schemas
curl "https://apis.io/api/v1/json-schemas?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.