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

# AI configuration

> Reference for the `ai` block in `momentic.config.yaml`. Per-agent version controls and local AI feature toggles.

Momentic uses several specialized AI agents, each versioned independently. See
[Agents](/docs/ai/agents) for the available versions and what every agent does.

Turn [results classification](/docs/reliability/auto-maintenance#permanent-healing)
on or off in `momentic.config.yaml` with `ai.classification`. The failure
categories and their actions, along with post-classification healing behavior,
stay cloud-managed in
[Settings > Classification](https://app.momentic.ai/settings/classification).

## Options

<ParamField path="ai.agentConfig" type="Record<agent, version>">
  Choose which version of prompts and models to use for each AI task. The
  latest version is recommended for new projects. Omit an agent to inherit the
  organization default. See [Agents](/docs/ai/agents) for available versions per
  agent.

  ```yaml momentic.config.yaml theme={null}
  ai:
    agentConfig:
      locator: v4
      assertion: v4
      visual-assertion: v4
      text-extraction: v3
      failure-recovery: v2
  ```
</ParamField>

<ParamField path="ai.classification" type="boolean | object">
  <Note>
    Classification's on/off toggle and exit-code override are configured here in
    `momentic.config.yaml`, so they live alongside your tests and apply to local
    and CI runs. Failure categories and their actions stay cloud-managed. The
    previous cloud dashboard **Classify on fail** and **Override CI exit code**
    toggles have been removed.
  </Note>

  Default: `false`. Enable
  [results classification](/docs/reliability/auto-maintenance#permanent-healing) for
  failed CLI runs. Use the `true` shorthand to enable with defaults, or an object
  for finer control:

  ```yaml momentic.config.yaml theme={null}
  ai:
    classification:
      enabled: true
      overrideExitCode: true
  ```

  * `enabled` (boolean, default `false`): run the classifier on failed runs.
  * `overrideExitCode` (boolean, default `false`): let the classification verdict
    decide the exit code. Override is opt-in: by default the classifier runs and
    records a category, but every failed test still fails CI. Set it to `true` so
    failures routed to `heal` or `warn` exit `0`. Opt in per run with
    [`--classify-override-exit-code`](/docs/cli-reference/momentic/commands/run).

  We recommend enabling classification. Beyond triaging failed runs, it also
  affects [transient recovery](/docs/reliability/auto-maintenance#transient-recovery):
  when recovery is eligible (its config is on and the run is in CI), the
  classifier runs while the run is still executing and decides whether a failed
  step is recovered. Only failures whose category action is **Heal** and that the
  classifier judges recoverable are retried. With classification off, a built-in
  recovery planner makes that decision instead.

  Failure categories and their actions remain cloud-managed in
  [Settings > Classification](https://app.momentic.ai/settings/classification).
</ParamField>

<ParamField path="ai.useMemory" type="boolean">
  Default: `true`. Allow AI agents to use data from past test runs to keep
  element locators and assertions consistent across runs. Sets the org-wide
  default; can be overridden per test. See
  [Memory](/docs/ai/memory) for details.

  ```yaml momentic.config.yaml theme={null}
  ai:
    useMemory: true
  ```
</ParamField>

<ParamField path="ai.failureRecovery" type="boolean">
  <Warning>Failure recovery is in beta and may change.</Warning>

  Default: `false`. Enable
  [Failure recovery](/docs/reliability/auto-maintenance#transient-recovery). Momentic
  proposes and executes step changes to recover from certain test failures.

  ```yaml momentic.config.yaml theme={null}
  ai:
    failureRecovery: true
  ```
</ParamField>

<ParamField path="ai.aiPageFiltering" type="boolean">
  <Warning>
    Deprecated and kept only for backwards compatibility. Page filtering is
    always enabled for large browser pages and cannot be customized after CLI
    version 2.94.0. Safe to remove from existing config files.
  </Warning>

  Default: `true`.
</ParamField>
