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

# Training scenarios

> Write behavioral rules and question-specific answers the AI honors, with draft, publish, versioning, and channel or segment targeting.

A **training scenario** is a single instruction you write for the AI. Every scenario is either **behavioral** (the AI applies it on every message) or **scenario-specific** (the AI applies it when the customer asks a matching question). Scenarios are the fastest way to teach the AI something without connecting a source or writing an article.

<Tip>
  Add a scenario from [**AI Instructions**](https://platform.open.cx/ai-instructions) — click the **+** next to a directory in the sidebar.
</Tip>

## Behavioral vs. scenario-specific

Pick the type that matches the job. You can change a scenario's type later, but the draft/published state resets when you do.

|                      | Behavioral                                                                                        | Scenario-specific                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| **When it applies**  | Every conversation, on every message                                                              | When the customer's question matches the scenario's trigger question                                  |
| **How it's matched** | Always on — injected before retrieval                                                             | Semantic search against the trigger question; top matches are injected                                |
| **Good fit for**     | Tone, formatting rules, policy reminders, things that must hold on every reply                    | "When customer asks X, say Y" — refund policy, business hours, known product limitation               |
| **Example trigger**  | *(none)*                                                                                          | "How do I cancel my subscription?"                                                                    |
| **Example content**  | "Always confirm the order ID before discussing shipping. Never share another customer's details." | "Cancel from Account → Billing. Your access continues through the end of the current billing period." |

<Note>
  Scenario-specific instructions match on **meaning**, not exact text. "Can I cancel?" and "How do I end my subscription?" hit the same scenario as long as the trigger question covers the intent.
</Note>

## Write a scenario

<Steps>
  <Step title="Open AI Instructions">
    Go to [**AI Instructions**](https://platform.open.cx/ai-instructions). Pick the directory where the scenario should live — or click **New directory** first if you want to organize it separately.
  </Step>

  <Step title="Add a new scenario">
    Click **+ New scenario** in the sidebar. Give it a clear title (this is only shown inside the dashboard — the AI doesn't see it).
  </Step>

  <Step title="Pick the type and write the content">
    Set the type to **Behavioral** or **Scenario-specific**. For scenario-specific, fill the trigger question with the way a customer would actually phrase it. Write the answer or rule in the content editor — plain language is fine; the AI will rephrase it in its own voice unless you tell it not to.
  </Step>

  <Step title="Optional — restrict to channels or segments">
    Under **Visibility**, pick channels (Chat, Email, SMS, WhatsApp, Phone, etc.) and contact segments the scenario should apply to. Leave both empty to apply everywhere.
  </Step>

  <Step title="Publish">
    Click **Publish**. The scenario takes effect on the next message across every channel you selected. Your draft is preserved — if you keep editing, you'll see a pending draft badge until you publish again.
  </Step>
</Steps>

## Common patterns

Three canonical scenario-specific examples you can adapt. Each is written as the trigger question + the answer you want the AI to give.

```
Trigger: Can I get a refund? / Cancel my order / Money back
Answer:  We don't issue refunds directly, but I can help resolve the issue.
         Could you tell me what's not working so I can look into it?
```

```
Trigger: What are your hours? / When are you open? / Business hours
Answer:  Support is available Monday–Friday, 9am–5pm EST. Outside those
         hours, leave a message and we'll reply on the next business day.
```

```
Trigger: How much does it cost? / Pricing / Subscription fee
Answer:  Plans start at $49/month for Basic. Full pricing breakdown is at
         example.com/pricing — want me to walk through which plan fits your use case?
```

Keep answers in the voice you want the customer to hear — the AI will follow your phrasing closely on scenario-specific matches.

## Channel and segment targeting

Leave the targeting fields empty unless you need the scope. When you set them:

* **Channels** — comma-separated list. Valid values: Chat Widget, Email, SMS, WhatsApp, Phone, Slack, Instagram, Messenger, API. A scenario with channels set only fires on those channels.
* **Segments** — OpenCX contact segments. A scenario restricted to segments only fires if the contact is a member of at least one listed segment. Anonymous conversations (no contact) never match segment-restricted scenarios.

Setting **both** requires **both** to match. Use directory-level visibility to apply the same rule to a whole folder at once.

## Version history

Every publish writes an immutable version you can review or roll back to.

* **See versions** — open a scenario and click **History**. Each row shows the version number, who published it, and when.
* **Roll back** — pick a version and click **Restore**. The content loads into your draft; nothing changes for customers until you publish.
* **Drafts are not versioned.** Only published versions are kept. Save aggressively and publish when you're ready.

## Good to know

<AccordionGroup>
  <Accordion title="Drafts are never shown to customers" icon="eye-slash">
    Only the published version of a scenario is served at answer time. Drafts, including new unpublished scenarios, are invisible to the AI until you publish them.
  </Accordion>

  <Accordion title="Move scenarios between directories" icon="folder-tree">
    Drag a scenario in the sidebar to move it. Visibility settings on a directory (channels, segments) can be applied to every scenario inside with one action.
  </Accordion>

  <Accordion title="Scenarios don't replace knowledge sources" icon="brain">
    A directory of 500 refund scenarios is harder to maintain than one Help Center article or a synced Zendesk category. Use scenarios for the things that would be lost in a long article — edge cases, policy carve-outs, overrides.
  </Accordion>

  <Accordion title="Session learnings create scenario drafts" icon="wand-magic-sparkles">
    When you mark an agent reply as "teach the AI" from a resolved session, OpenCX drafts a scenario-specific instruction pre-filled from the conversation. It lands as a draft — review and publish it the same way you would any other scenario.
  </Accordion>
</AccordionGroup>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="AI Instructions overview" icon="sliders" href="/ai-instructions/overview">
    AI Profile, directories, and how direct training fits alongside the rest.
  </Card>

  <Card title="Autopilot topics" icon="compass" href="/handoff/topics">
    Topic gating for when the AI should hand off instead of answer.
  </Card>

  <Card title="Help Center articles" icon="file-lines" href="/help-center/articles">
    Long-form content the AI cites in customer replies.
  </Card>

  <Card title="Connect a knowledge source" icon="brain" href="/knowledge/sources/overview">
    Sync existing docs instead of rewriting them as scenarios.
  </Card>
</CardGroup>
