> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nika.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# schema

> Contract, placement, related fields and source examples for this Nika YAML field.

[Language reference](/reference/language/overview) / `schema`

## Meaning and placement

### infer

JSON Schema · the structured-output contract the model's reply must satisfy. The out-of-core hatch; the typed door is task-level `returns:` (both on one task is NIKA-TYPE-003).

| Property        | Declaration                      |
| --------------- | -------------------------------- |
| Requirement     | Optional in this object          |
| Schema location | `/$defs/infer/properties/schema` |
| type            | "object"                         |

**In the same object:** [max\_tokens](/reference/language/words/max_tokens) · [model](/reference/language/words/model) · [prompt](/reference/language/words/prompt) · [system](/reference/language/words/system) · [temperature](/reference/language/words/temperature) · [thinking](/reference/language/words/thinking) · [vision](/reference/language/words/vision)

[Schema source (use the pointer above)](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/schemas/workflow.schema.json)

### agent

JSON Schema · the contract the agent's FINAL message must satisfy. The out-of-core hatch; the typed door is task-level `returns:` (both on one task is NIKA-TYPE-003).

| Property        | Declaration                      |
| --------------- | -------------------------------- |
| Requirement     | Optional in this object          |
| Schema location | `/$defs/agent/properties/schema` |
| type            | "object"                         |

**In the same object:** [max\_tokens\_total](/reference/language/words/max_tokens_total) · [max\_turns](/reference/language/words/max_turns) · [model](/reference/language/words/model) · [prompt](/reference/language/words/prompt) · [skills](/reference/language/words/skills) · [system](/reference/language/words/system) · [temperature](/reference/language/words/temperature) · [tools](/reference/language/words/tools)

[Schema source (use the pointer above)](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/schemas/workflow.schema.json)

## In a source template

Excerpt from `templates/agent-loop.nika.yaml`, source lines 62–71. This is a fragment, not a runnable workflow.

```yaml illustration theme={"system"}
      # fails NIKA-INFER-002 ("no JSON value found · the reply was cut off at
      # the token limit"). Measured — 400 starves qwen3.5:4b on this prompt.
      max_tokens: 2000
      schema:
        type: object
        additionalProperties: false
        required: [steps]
        properties:
          steps: { type: array, items: { type: string } }

```

### Templates containing this field

| Template                                    | Source                                                                                                                                            |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `templates/agent-loop.nika.yaml`            | [Line 65](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/agent-loop.nika.yaml#L65)            |
| `templates/classify-and-route.nika.yaml`    | [Line 85](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/classify-and-route.nika.yaml#L85)    |
| `templates/corpus-qa.nika.yaml`             | [Line 104](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/corpus-qa.nika.yaml#L104)           |
| `templates/document-to-fields.nika.yaml`    | [Line 66](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/document-to-fields.nika.yaml#L66)    |
| `templates/evaluate-and-optimize.nika.yaml` | [Line 43](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/evaluate-and-optimize.nika.yaml#L43) |
| `templates/media-asset-pack.nika.yaml`      | [Line 62](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/media-asset-pack.nika.yaml#L62)      |
| `templates/website-brief.nika.yaml`         | [Line 74](https://github.com/supernovae-st/nika-spec/blob/c5ebbb7b862b68bc6cf7235efba61173b844afc6/templates/website-brief.nika.yaml#L74)         |

These are literal key occurrences in the source files, not an execution or conformance claim. [How to instantiate a template](/guides/templates).

## Contract and implementation

This page projects the named specification revision. Check [released engine status](/reference/status) and [the validation workflow](/guides/agent-authoring) before running a file. An optional field is not evidence that every engine supports every value.

Canonical identity: `language:word:schema`. Spec revision: [`c5ebbb7b862b`](https://github.com/supernovae-st/nika-spec/tree/c5ebbb7b862b68bc6cf7235efba61173b844afc6).

[How documentation stays connected](/reference/knowledge-system).
