> Every page of the Heythere docs is listed in https://heythere.io/docs/llms.txt: fetch it to find a page instead of guessing its URL.

# AI: let models answer and sort WhatsApp conversations

> Use AI models in an automation to talk with a customer, sort a conversation, check a condition or write a value, within what Meta allows on WhatsApp.

Camille asks her repair shop on WhatsApp whether it can fit a new chain this week. In the shop's automation, an `ai_agent` step answers her, saves the day she wants, and takes the exit that leads to the next step.

An automation uses AI only where its author put it or left a default on, for the purpose they gave. Heythere offers no assistant that chats about anything.

| Where                     | Does                                                                    |
| ------------------------- | ----------------------------------------------------------------------- |
| `ai_agent` step           | Converses with the contact, saves what it learns, and takes an exit.    |
| `classify` step           | Takes the category of the conversation, such as billing or delivery.    |
| `ai` condition            | Holds when a statement, such as "The contact is upset", is likely true. |
| `generate` in `set_value` | Writes a value from instructions, such as a summary to `run.summary`.   |
| A question, by default    | Reads a reply in the contact's own words.                               |
| A voice note, by default  | Becomes a transcript every step reads.                                  |

Each reads its instructions and the run's recent messages. An agent step also reads photos, PDFs, and, on demand, earlier messages and runs. The [workspace log](https://heythere.io/docs/concepts/workspace-log) records each request, its cost, and what an agent did, after the summary of why its model gave.

## What does an agent step hold?

- **Instructions**: who the business is, what the step is for, how it writes, what it knows of the contact. In an automation that answers in several languages, it writes in the one it answers the contact in.
- **Values** it saves to the run or contact: text, email, number, yes or no, date, list, or choices.
- **Exits**, each with what it requires. The model takes one whose `when` is settled, and one without `when` once its values are known.
- **Tools**: `web_search`, when its model's `searchesWeb` is true, limited to `allowedDomains`; `http_request` calls, saving what they return; [MCP server](https://heythere.io/docs/concepts/mcp-servers) tools.
- **A model** from `listAiModels` and its **reasoning effort**. More effort handles harder requests, slower and dearer.

A turn may send several messages, with buttons, a list, or a link, and close with an exit. The step texts in short messages and reads voice notes past their transcript's slips. Camille sees it typing, and what she adds meanwhile reaches it before it answers. It may leave a thanks unanswered.

It takes every message the business sent as its own, and may write as soon as its step starts, so put an `ask_text` before it to let the contact answer first. The step ends at an exit, its timeout, or the 50th reply, and runs only in the reply window.

## What is a decision model?

A model that answers how likely each category or statement is, instead of writing text. A `classify` step names a `decisionModels` entry of `listAiModels` and takes `onUncertain` when no category stands out. `ai` conditions use Jev. Neither writes to the contact, so both run outside the reply window.

## How does `set_value` generate?

The step asks its model once for every `generate` value, each typed as its target, from the values before the step. An unusable answer writes none and fails the [run](https://heythere.io/docs/concepts/runs).

## What does Meta allow?

Since 15 January 2026, Meta's WhatsApp terms forbid offering AI as the service itself. They allow AI that serves a business's own purpose, such as support, sales, or onboarding. Keep each step's instructions on that purpose.

## In the API

Every operation is a REST endpoint and, unless marked REST only, an MCP tool of the same name. [The OpenAPI document](https://app.heythere.io/api/openapi.json) describes their parameters, payloads, and errors.


- `listAiModels`: List AI models. `GET /api/ai-models`
