> ## 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](/ai/agents) for the available versions and what every agent does.

Turn [results classification](/reliability/failure-analysis) 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](/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">
  <Warning>
    Classification's on/off toggle and exit-code override were previously
    controlled by the cloud dashboard's **Classify on fail** and **Override CI
    exit code** settings. Those cloud toggles are deprecated and will be removed
    in a future release - set `enabled` and `overrideExitCode` here in
    `momentic.config.yaml` instead, so they live alongside your tests and apply
    to local and CI runs. Failure categories and their actions stay
    cloud-managed.
  </Warning>

  Default: `false`. Enable [results classification](/reliability/failure-analysis)
  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`](/cli-reference/momentic/commands/run).

  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](/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](/reliability/failure-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>
