All contracts

Workspace Intelligence / JSON Schema

Workspai Bounded Knowledge Graph Search

A deterministic, bounded, proof-carrying retrieval projection intended for agents, MCP clients, IDEs, and CI consumers.

Schema version
workspace-knowledge-search.v1
Contract path
contracts/workspace-intelligence/workspace-knowledge-search.v1.json
Publication
json-schema
Defined fields
34
Artifact bindings
0

Why this contract exists

Architecture role

Defines a versioned interoperability boundary used by Workspai and contract-aware consumers.

Consumption boundary

  • Workspai CLI
  • Workspace Intelligence consumers
  • IDEs and agents

Related commands

Commands are linked only when the runtime contract identifies a direct production relationship. Supporting contracts may be consumed without having a single producer command.

This is a supporting, capability, cache, compatibility, or consumer contract. It has no single direct producer command in the canonical Workspace Intelligence execution registry.

Produced artifacts

These durable files are emitted by registered commands and validated against this contract.

No canonical file artifact is registered for this contract. It may describe capabilities, embedded data, runtime exchange, or supporting state instead of a standalone report.

Field reference

Every declared schema property or published capability path is listed here. Required means the contract declares or publishes that field at the shown boundary.

Field pathTypeRequiredMeaningConstraints
budgetobjectNoPresent for the agent projection. Reports every hard payload limit and omission without changing the v1 full projection contract.additionalProperties: false
budget.limitsobjectYesDefines the limits value at this contract boundary.additionalProperties: false
budget.limits.aliasesPerEntityintegerYesDefines the aliasesperentity value at this contract boundary.minimum: 1 · maximum: 8
budget.limits.attributeArrayItemsintegerYesDefines the attributearrayitems value at this contract boundary.minimum: 1 · maximum: 8
budget.limits.attributeStringCharactersintegerYesDefines the attributestringcharacters value at this contract boundary.minimum: 1 · maximum: 256
budget.limits.proofIdsPerItemintegerYesDefines the proofidsperitem value at this contract boundary.minimum: 1 · maximum: 4
budget.limits.proofsintegerYesDefines the proofs value at this contract boundary.minimum: 1 · maximum: 16
budget.limits.relatedEntitiesintegerYesDefines the relatedentities value at this contract boundary.minimum: 1 · maximum: 24
budget.limits.relationsintegerYesDefines the relations value at this contract boundary.minimum: 1 · maximum: 24
budget.modestringYesDefines the mode value at this contract boundary.const: "agent"
budget.omittedobjectYesDefines the omitted value at this contract boundary.additionalProperties: false
budget.omitted.aliasesintegerYesDefines the aliases value at this contract boundary.minimum: 0
budget.omitted.attributeValuesintegerYesDefines the attributevalues value at this contract boundary.minimum: 0
budget.omitted.entitiesintegerYesDefines the entities value at this contract boundary.minimum: 0
budget.omitted.proofReferencesintegerYesDefines the proofreferences value at this contract boundary.minimum: 0
budget.omitted.proofsintegerYesDefines the proofs value at this contract boundary.minimum: 0
budget.omitted.relatedEntitiesintegerYesDefines the relatedentities value at this contract boundary.minimum: 0
budget.omitted.relationsintegerYesDefines the relations value at this contract boundary.minimum: 0
entitiesarrayYesDefines the entities value at this contract boundary.maxItems: 100
graphSourceHashstringNoDefines the graphsourcehash value at this contract boundary.pattern: ^[a-f0-9]{64}$
kindanyYesDefines the kind value at this contract boundary.
limitintegerYesDefines the limit value at this contract boundary.minimum: 1 · maximum: 100
projectIdstringNoDefines the projectid value at this contract boundary.minLength: 1
proofsarrayYesDefines the proofs value at this contract boundary.
querystringYesDefines the query value at this contract boundary.minLength: 1
relatedEntitiesarrayYesDefines the relatedentities value at this contract boundary.
relatedEntities[].idstringYesDefines the id value at this contract boundary.minLength: 1
relatedEntities[].kindreferenceYesDefines the kind value at this contract boundary.ref: workspace-knowledge-graph.v1.json#/properties/entities/items/properties/kind
relatedEntities[].labelstringYesDefines the label value at this contract boundary.minLength: 1
relatedEntities[].projectIdstringNoDefines the projectid value at this contract boundary.minLength: 1
relationsarrayYesDefines the relations value at this contract boundary.
schemaVersionstringYesDefines the schemaversion value at this contract boundary.const: "workspace-knowledge-search.v1"
totalMatchesintegerYesDefines the totalmatches value at this contract boundary.minimum: 0
truncatedbooleanYesDefines the truncated value at this contract boundary.

Canonical machine-readable definition

The raw synchronized contract remains authoritative. The educational sections above are projections of this definition.

Show raw JSON
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/workspace-intelligence/workspace-knowledge-search.v1.json",
  "title": "Workspai Bounded Knowledge Graph Search",
  "description": "A deterministic, bounded, proof-carrying retrieval projection intended for agents, MCP clients, IDEs, and CI consumers.",
  "type": "object",
  "required": [
    "schemaVersion",
    "query",
    "kind",
    "limit",
    "totalMatches",
    "truncated",
    "entities",
    "relatedEntities",
    "relations",
    "proofs"
  ],
  "properties": {
    "schemaVersion": {
      "const": "workspace-knowledge-search.v1"
    },
    "graphSourceHash": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "query": {
      "type": "string",
      "minLength": 1
    },
    "kind": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items/properties/kind"
        }
      ]
    },
    "projectId": {
      "type": "string",
      "minLength": 1
    },
    "limit": {
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "totalMatches": {
      "type": "integer",
      "minimum": 0
    },
    "truncated": {
      "type": "boolean"
    },
    "entities": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items"
      }
    },
    "relatedEntities": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "label"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "$ref": "workspace-knowledge-graph.v1.json#/properties/entities/items/properties/kind"
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "projectId": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    },
    "relations": {
      "type": "array",
      "items": {
        "$ref": "workspace-knowledge-graph.v1.json#/properties/relations/items"
      }
    },
    "proofs": {
      "type": "array",
      "items": {
        "$ref": "workspace-knowledge-graph.v1.json#/properties/proofs/items"
      }
    },
    "budget": {
      "description": "Present for the agent projection. Reports every hard payload limit and omission without changing the v1 full projection contract.",
      "type": "object",
      "required": [
        "mode",
        "limits",
        "omitted"
      ],
      "properties": {
        "mode": {
          "const": "agent"
        },
        "limits": {
          "type": "object",
          "required": [
            "relations",
            "relatedEntities",
            "proofs",
            "proofIdsPerItem",
            "aliasesPerEntity",
            "attributeArrayItems",
            "attributeStringCharacters"
          ],
          "properties": {
            "relations": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24
            },
            "relatedEntities": {
              "type": "integer",
              "minimum": 1,
              "maximum": 24
            },
            "proofs": {
              "type": "integer",
              "minimum": 1,
              "maximum": 16
            },
            "proofIdsPerItem": {
              "type": "integer",
              "minimum": 1,
              "maximum": 4
            },
            "aliasesPerEntity": {
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            },
            "attributeArrayItems": {
              "type": "integer",
              "minimum": 1,
              "maximum": 8
            },
            "attributeStringCharacters": {
              "type": "integer",
              "minimum": 1,
              "maximum": 256
            }
          },
          "additionalProperties": false
        },
        "omitted": {
          "type": "object",
          "required": [
            "entities",
            "relations",
            "relatedEntities",
            "proofs",
            "proofReferences",
            "aliases",
            "attributeValues"
          ],
          "properties": {
            "entities": {
              "type": "integer",
              "minimum": 0
            },
            "relations": {
              "type": "integer",
              "minimum": 0
            },
            "relatedEntities": {
              "type": "integer",
              "minimum": 0
            },
            "proofs": {
              "type": "integer",
              "minimum": 0
            },
            "proofReferences": {
              "type": "integer",
              "minimum": 0
            },
            "aliases": {
              "type": "integer",
              "minimum": 0
            },
            "attributeValues": {
              "type": "integer",
              "minimum": 0
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}