> ## 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](https://docs.nika.sh/reference/language/overview.md) / `schema`

## Meaning and placement

### infer

JSON Schema · the structured-output contract the model's reply must satisfy, inline or the schema of a project file. 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` |
| \$ref | `"#/$defs/schemaContract"` |

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

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

### agent

JSON Schema · the contract the agent's FINAL message must satisfy, inline or the schema of a project file. 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` |
| \$ref | `"#/$defs/schemaContract"` |

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

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

## In a source template

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

```yaml illustration theme={"system"}
      # the token limit"). Measured — 400 starves qwen3.5:4b on this prompt.
      # a reasoning model needs 16384 here, or a documented run.reasoning.effort: low
      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` | [Line 61](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/agent-loop.nika#L61) |
| `templates/aggregate-by-key.nika` | [Line 32](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/aggregate-by-key.nika#L32) |
| `templates/bounded-batch.nika` | [Line 30](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/bounded-batch.nika#L30) |
| `templates/classify-and-route.nika` | [Line 85](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/classify-and-route.nika#L85) |
| `templates/corpus-qa.nika` | [Line 104](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/corpus-qa.nika#L104) |
| `templates/deduplicate-records.nika` | [Line 32](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/deduplicate-records.nika#L32) |
| `templates/document-to-fields.nika` | [Line 66](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/document-to-fields.nika#L66) |
| `templates/evaluate-and-optimize.nika` | [Line 43](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/evaluate-and-optimize.nika#L43) |
| `templates/media-asset-pack.nika` | [Line 61](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/media-asset-pack.nika#L61) |
| `templates/parallel-review.nika` | [Line 58](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/parallel-review.nika#L58) |
| `templates/project-public-fields.nika` | [Line 33](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/project-public-fields.nika#L33) |
| `templates/recover-optional-file.nika` | [Line 47](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/recover-optional-file.nika#L47) |
| `templates/snapshot-diff.nika` | [Line 33](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/snapshot-diff.nika#L33) |
| `templates/validate-records.nika` | [Line 30](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/validate-records.nika#L30) |
| `templates/website-brief.nika` | [Line 73](https://github.com/supernovae-st/nika-spec/blob/5c40ba456c53a4ab663a949d44003078e161305d/templates/website-brief.nika#L73) |

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

## Contract and implementation

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

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

[How documentation stays connected](https://docs.nika.sh/reference/knowledge-system.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.