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

# AI Steps

> Let AI write the reply — a quick one-shot answer, or a knowledge-grounded answer from one of your AI agents.

## What is this?

**AI** steps let your automation write a reply with AI instead of you typing every answer. There are two, and the difference is simple:

* **AI Response (Basic)** — like asking a helpful stranger. You give it a personality (a "system prompt"), and it replies using only that and the chat so far.
* **AI Response (Advanced)** — like asking your trained team member. It uses one of your [AI agents](/workspace/ai-agents/overview), so it can look things up in your **knowledge** (prices, policies, FAQs) before answering.

Both use the AI settings you've already set up — you don't enter a new key here.

\[SCREENSHOT: automation-steps-ai-config — The AI Response (Advanced) step settings showing Mode, Agent, Input, and Reply Action]

## What can I do here?

| Step                                            | Best for                               |
| ----------------------------------------------- | -------------------------------------- |
| [AI Response (Basic)](#ai-response-basic)       | Simple, friendly replies and rewriting |
| [AI Response (Advanced)](#ai-response-advanced) | Answers based on your own knowledge    |

<Info>
  You need an active AI setting first (**Settings → AI Setting**). For the Advanced step you also need at least one [AI agent](/workspace/ai-agents/create-your-first-agent).
</Info>

## How to use it

### AI Response (Basic)

**What it does:** sends the AI your instructions and, optionally, the conversation so far, and gets a reply.
**When to use it:** small jobs — a friendly answer to an open question, or summarizing what the customer said.

* **System Prompt** (required) — tells the AI who it is and how to answer, like "You are a polite assistant for a bakery. Keep replies under 2 sentences."
* **Include Conversation History** — when on, the AI can see earlier messages so its reply makes sense in context.
* **Save Response To Field** (optional) — stores the reply in a custom field for later steps.

### AI Response (Advanced)

**What it does:** asks a chosen AI agent to reply using its instructions and, if you want, its knowledge. This step **only writes a reply** — it doesn't run the agent's actions, like handing off or updating contacts.
**When to use it:** questions about your business — prices, hours, policies — where the answer should come from your own facts.

1. **Mode** — **Use selected agent**, or **Auto choose agent** to let the platform pick the best-fitting agent for the question.
2. **Agent** — pick one (when using a selected agent).
3. **Input** — **Latest message** (what the customer just wrote) or **Custom input** (write your own prompt). Optionally turn on **Include custom fields** to give the AI more context about the contact.
4. **Knowledge Usage** — **Use agent instructions + knowledge base**, or **Use agent instructions only**.
5. **Reply Action** — **Send reply only**, **Save reply to field only**, or **Send reply and save to field**.
6. **On AI failure** — what to do if the AI can't answer (no agent found, empty result, or an error): **Send fallback message**, **Continue flow silently**, or **Assign to team member**.

### Which one should I use?

| I want…                                            | Use                                                                                |
| -------------------------------------------------- | ---------------------------------------------------------------------------------- |
| A quick, general reply                             | AI Response (Basic)                                                                |
| Answers from my own price list or FAQ              | AI Response (Advanced)                                                             |
| The AI to handle the whole conversation on its own | An [AI agent](/workspace/ai-agents/overview) with Agentic Mode, rather than a step |

## Troubleshooting / Technical Notes

* **The step doesn't reply.** Check that an AI setting is active in **Settings → AI Setting**, and that the Advanced step has a matching agent.
* **The AI makes things up.** Use the Advanced step with **Use agent instructions + knowledge base**, and add the missing facts to the agent's knowledge.
* **The AI fails for some customers.** Set **On AI failure** to **Assign to team member** so a human picks up.
* **I want the agent to take actions (like a hand-off).** This step is reply-only. Use the agent itself with **Agentic Mode**.

## Related docs

* [Builder Steps overview](/workspace/automation/steps/overview)
* [AI Agents overview](/workspace/ai-agents/overview)
* [Create Your First AI Agent](/workspace/ai-agents/create-your-first-agent)
* [Settings](/workspace/settings)
