{
  "$defs": {
    "AckExample": {
      "description": "One user-message \u2192 acknowledgement example for the ack prompt section.",
      "properties": {
        "ack": {
          "default": "",
          "title": "Ack",
          "type": "string"
        },
        "user": {
          "default": "",
          "title": "User",
          "type": "string"
        }
      },
      "title": "AckExample",
      "type": "object"
    },
    "AgentIdentityDocument": {
      "additionalProperties": false,
      "description": "The ``agent:`` block: identity, language, persona, and optional voice.",
      "properties": {
        "id": {
          "default": "",
          "title": "Id",
          "type": "string"
        },
        "language": {
          "default": "",
          "title": "Language",
          "type": "string"
        },
        "persona": {
          "title": "Persona",
          "type": "string"
        },
        "voice": {
          "anyOf": [
            {
              "$ref": "#/$defs/AgentVoiceConfig"
            },
            {
              "type": "null"
            }
          ],
          "default": null
        }
      },
      "required": [
        "persona"
      ],
      "title": "AgentIdentityDocument",
      "type": "object"
    },
    "AgentPromptConfig": {
      "description": "Prompt tuning knobs from the ``prompts`` config section.",
      "properties": {
        "ack_enabled": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Ack Enabled"
        },
        "ack_examples": {
          "default": [],
          "items": {
            "$ref": "#/$defs/AckExample"
          },
          "title": "Ack Examples",
          "type": "array"
        },
        "ack_reminder": {
          "default": "",
          "title": "Ack Reminder",
          "type": "string"
        },
        "ack_rule": {
          "default": "",
          "title": "Ack Rule",
          "type": "string"
        },
        "routing_no_active_skill": {
          "default": "",
          "title": "Routing No Active Skill",
          "type": "string"
        },
        "text_rules": {
          "default": "",
          "title": "Text Rules",
          "type": "string"
        },
        "voice_rules": {
          "default": "",
          "title": "Voice Rules",
          "type": "string"
        }
      },
      "title": "AgentPromptConfig",
      "type": "object"
    },
    "AgentVoiceConfig": {
      "description": "Optional voice settings from ``agent.voice`` (stored for forward compat).\n\nParsed and retained on :class:`AgentSpec` so projects can author voice\nsettings before voice runtime lands. No ASR/TTS or channel behaviour is\nwired here.",
      "properties": {
        "asr": {
          "default": "",
          "title": "Asr",
          "type": "string"
        },
        "enabled": {
          "default": false,
          "title": "Enabled",
          "type": "boolean"
        },
        "input_mime_type": {
          "default": "",
          "title": "Input Mime Type",
          "type": "string"
        },
        "output_encoding": {
          "default": "",
          "title": "Output Encoding",
          "type": "string"
        },
        "sample_rate": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Sample Rate"
        },
        "tts": {
          "default": "",
          "title": "Tts",
          "type": "string"
        }
      },
      "title": "AgentVoiceConfig",
      "type": "object"
    },
    "ConversationDocument": {
      "additionalProperties": false,
      "description": "The ``conversation:`` block.",
      "properties": {
        "before_end": {
          "default": [],
          "items": {
            "type": "string"
          },
          "title": "Before End",
          "type": "array"
        }
      },
      "title": "ConversationDocument",
      "type": "object"
    },
    "OrchestratorDocument": {
      "additionalProperties": false,
      "description": "The ``orchestrator:`` block as authored, including precondition bindings.\n\n``model_group`` names the ``model_groups`` entry in ``integrations.yml``\nthat drives the agent; ``max_prompt_tokens`` is an optional prompt budget.",
      "properties": {
        "max_prompt_tokens": {
          "anyOf": [
            {
              "exclusiveMinimum": 0,
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Max Prompt Tokens"
        },
        "model_group": {
          "minLength": 1,
          "title": "Model Group",
          "type": "string"
        },
        "preconditions": {
          "additionalProperties": {
            "$ref": "#/$defs/PreconditionBinding"
          },
          "title": "Preconditions",
          "type": "object"
        }
      },
      "required": [
        "model_group"
      ],
      "title": "OrchestratorDocument",
      "type": "object"
    },
    "PreconditionBinding": {
      "additionalProperties": false,
      "description": "One semantic precondition contract bound to project memory and a resolver.",
      "properties": {
        "resolve_with": {
          "title": "Resolve With",
          "type": "string"
        },
        "satisfied_when": {
          "title": "Satisfied When",
          "type": "string"
        },
        "unmet_utterance": {
          "default": true,
          "title": "Unmet Utterance",
          "type": "boolean"
        }
      },
      "required": [
        "satisfied_when",
        "resolve_with"
      ],
      "title": "PreconditionBinding",
      "type": "object"
    },
    "ReferenceChunkingConfig": {
      "additionalProperties": false,
      "description": "Configure how reference documents are split before embedding.",
      "properties": {
        "chunk_overlap": {
          "default": 20,
          "minimum": 0,
          "title": "Chunk Overlap",
          "type": "integer"
        },
        "chunk_size": {
          "default": 1000,
          "exclusiveMinimum": 0,
          "title": "Chunk Size",
          "type": "integer"
        }
      },
      "title": "ReferenceChunkingConfig",
      "type": "object"
    },
    "ReferencesConfig": {
      "description": "Answering guidance for knowledge questions from the ``references`` section.\n\nAgent-wide house style for how the agent presents answers built from\nretrieved knowledge (tone, length, formatting, fallback wording). A skill\nmay override this with its own ``references.instructions`` (see\n:class:`~rasa.mantle.skills.skill.Skill`). Empty \u2192 built-in default.",
      "properties": {
        "chunking": {
          "$ref": "#/$defs/ReferenceChunkingConfig",
          "default": {
            "chunk_overlap": 20,
            "chunk_size": 1000
          }
        },
        "embeddings": {
          "default": "",
          "title": "Embeddings",
          "type": "string"
        },
        "instructions": {
          "default": "",
          "title": "Instructions",
          "type": "string"
        }
      },
      "title": "ReferencesConfig",
      "type": "object"
    },
    "SessionSpec": {
      "description": "User-authored conversation-session settings from the agent.yml.",
      "properties": {
        "session_expiration_time": {
          "default": 60,
          "title": "Session Expiration Time",
          "type": "number"
        },
        "start_session_after_expiry": {
          "default": true,
          "title": "Start Session After Expiry",
          "type": "boolean"
        }
      },
      "title": "SessionSpec",
      "type": "object"
    },
    "SkillRetrievalConfig": {
      "additionalProperties": false,
      "description": "Configure semantic skill retrieval.",
      "properties": {
        "active": {
          "default": true,
          "title": "Active",
          "type": "boolean"
        },
        "embeddings": {
          "default": "",
          "title": "Embeddings",
          "type": "string"
        },
        "num_skills": {
          "default": 20,
          "minimum": 0,
          "title": "Num Skills",
          "type": "integer"
        },
        "should_embed_memory": {
          "default": true,
          "title": "Should Embed Memory",
          "type": "boolean"
        },
        "turns_to_embed": {
          "default": 1,
          "minimum": 1,
          "title": "Turns To Embed",
          "type": "integer"
        }
      },
      "title": "SkillRetrievalConfig",
      "type": "object"
    }
  },
  "additionalProperties": false,
  "description": "Authoring shape of ``agent.yml``.\n\n``orchestrator`` is required: it names the model group that drives the\nagent, and that name has no default. Preconditions stay under\n``orchestrator.preconditions``. There is no top-level ``preconditions`` key.",
  "properties": {
    "agent": {
      "$ref": "#/$defs/AgentIdentityDocument"
    },
    "conversation": {
      "$ref": "#/$defs/ConversationDocument"
    },
    "orchestrator": {
      "$ref": "#/$defs/OrchestratorDocument"
    },
    "prompts": {
      "$ref": "#/$defs/AgentPromptConfig"
    },
    "references": {
      "$ref": "#/$defs/ReferencesConfig"
    },
    "rules": {
      "default": [],
      "items": {
        "type": "string"
      },
      "title": "Rules",
      "type": "array"
    },
    "session_config": {
      "$ref": "#/$defs/SessionSpec"
    },
    "skill_retrieval": {
      "$ref": "#/$defs/SkillRetrievalConfig"
    },
    "tool_timeout": {
      "anyOf": [
        {
          "exclusiveMinimum": 0,
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tool Timeout"
    }
  },
  "required": [
    "agent",
    "orchestrator"
  ],
  "title": "agent.yml",
  "type": "object"
}
