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

# Multi-Branch Logic: Route Comments by Intent and Sentiment

> Use multi-branch routing to send buying questions to a reply with a link, move complaints to DMs, and hide toxic comments — all in one automated flow.

A single rule can only do one thing. Multi-branch logic does everything at once. Instead of setting a fixed action for each rule, multi-branch logic lets the agent read the intent and sentiment behind every comment and route it to the right outcome automatically — a buying question gets a reply with a link, a complaint gets moved to a private DM, and toxic or spammy content gets hidden before any buyer sees it. One flow, three branches, zero manual sorting.

## The routing flow

Each comment that enters the multi-branch flow is read by the agent and assigned to one of three branches:

| Branch                              | Trigger                                                                                         | Action                                                                                                             |
| ----------------------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **Buying intent**                   | Comment signals purchase interest — asking about price, availability, shipping, or how to order | Agent replies with a natural, on-brand answer and a direct link; optionally follows up with a DM to close the sale |
| **Complaint or negative sentiment** | Comment expresses frustration, a bad experience, or a support need                              | Moved to a private DM for personal support; kept visible unless the language is also toxic                         |
| **Toxic or spam**                   | Comment contains abuse, scam links, competitor spam, or bot-generated content                   | Hidden immediately, before buyers can scroll past it                                                               |

## How intent is detected

The agent reads the full text of each comment, the commenter's history on your page, and the context of the post it appeared on. From that, it assigns an intent category — Buying, Complaint, or Toxic/Spam — along with a confidence score.

* **High-confidence spam** is hidden instantly with no delay.
* **High-confidence buying questions** get a reply within seconds.
* **Lower-confidence comments** can be held for review or routed to your moderation queue depending on your threshold settings.

The agent improves over time as it processes more comments from your audience, becoming more accurate at distinguishing a genuine complaint from a casual negative reaction, or a curious question from a competitor probe.

## Setting up multi-branch routing

<Steps>
  <Step title="Open your agent's settings">
    In the Exerta dashboard, go to your agent and open **Settings**.
  </Step>

  <Step title="Enable Multi-Branch Logic">
    Toggle on **Multi-Branch Logic** under the Moderation section.
  </Step>

  <Step title="Configure each branch">
    For each of the three branches — **Buying**, **Complaint**, and **Spam** — choose the action:

    * Buying: select or write a reply template and optionally enable DM follow-up
    * Complaint: write the DM message your agent will send to open a private conversation
    * Spam/Toxic: confirm the Hide action (enabled by default)
  </Step>

  <Step title="Set confidence thresholds">
    Optionally adjust the confidence threshold for each branch. The default settings are recommended for most accounts — only change these if you're seeing too many false positives or missed catches.
  </Step>

  <Step title="Save and activate">
    Click **Save**. The agent begins routing comments through the multi-branch flow immediately on all assigned placements.
  </Step>
</Steps>

<Tip>
  The complaint branch is especially powerful — moving a complaint to a DM removes it from public view while still giving the customer personal, direct attention. You defuse the situation privately instead of letting it escalate in front of potential buyers.
</Tip>

<Note>
  Multi-branch logic uses AI credits from your monthly plan. Each comment routed through the flow counts as one AI action.
</Note>


## Related topics

- [Comment Moderation: Protect Your Ads Automatically](/moderation/overview.md)
- [AI Replies: Context-Aware Responses for Every Conversation](/agents/ai-replies.md)
- [What Is Exerta? AI Engagement Agents for Social Ads](/introduction.md)
- [Facebook Integration: Automate Comments and DMs on Ads](/channels/facebook.md)
- [Instagram Integration: AI Replies for Comments and DMs](/channels/instagram.md)
