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

# Triage

> AI drafts a reply for every new customer message. You approve, edit, or discard. The customer never sees a draft until you press Send.

Triage is Forepost's first move into the inbox — an AI co-pilot that sits next to your agents while they work in Intercom. It's not a replacement helpdesk. Your team keeps replying in Intercom; Forepost just gives them a credible first draft for every new customer message.

<Note>
  Triage is in beta. Intercom only in v1. Front, Plain, and Zendesk are on the roadmap.
</Note>

## How it works, end to end

<Steps>
  <Step title="A customer messages your support inbox">
    Nothing changes for the customer. They send a message to Intercom the way they always have.
  </Step>

  <Step title="Forepost polls Intercom every ~10 minutes">
    The cron asks Intercom for every open conversation updated in the last 48 hours and finds the latest customer message in each thread.
  </Step>

  <Step title="Claude drafts a reply">
    The customer's message, your help-doc snippets, and your tone hint go into a Sonnet 4.6 prompt. The system prompt tells it to open with the answer, no greetings, no emojis, ask a clarifying question when unsure.
  </Step>

  <Step title="The draft appears on your Triage page">
    Nothing has been sent to the customer yet. The conversation card shows their message, the draft reply, and three buttons.
  </Step>

  <Step title="An agent decides what to do">
    **Send** ships the draft as-is via Intercom's reply API. **Edit then Send** sends an edited version. **Redraft** regenerates from scratch. **Discard** drops the conversation from Triage.
  </Step>

  <Step title="Forepost records the outcome">
    Every decision is logged as `sent_unedited`, `sent_edited`, or `discarded`. The 30-day stats strip turns those into an acceptance rate so you can tell, in weeks not months, whether draft quality is climbing.
  </Step>
</Steps>

## What v1 does

<CardGroup cols={2}>
  <Card title="Drafts every new message" icon="pen-line">
    Sonnet 4.6 against the customer's latest message, your help docs, and your tone hint.
  </Card>

  <Card title="Sends through Intercom" icon="paper-plane">
    The approved reply lands in Intercom as your connected admin. The customer sees a normal agent reply.
  </Card>

  <Card title="Tracks outcomes" icon="chart-line">
    30-day rolling stats: sent unedited, sent edited, discarded. Acceptance rate is the signal.
  </Card>

  <Card title="Polls automatically" icon="rotate">
    Every 10 minutes per workspace. You can also force a poll from the page.
  </Card>
</CardGroup>

## What v1 explicitly doesn't do

The point of v1 is to validate demand, not ship a full helpdesk.

<CardGroup cols={2}>
  <Card title="No autonomous send" icon="hand">
    Every reply is human-approved. No auto-resolve, no confidence-gated send.
  </Card>

  <Card title="No new inbox UI" icon="browser">
    Agents still triage, tag, and escalate in Intercom. Triage is a co-pilot, not a replacement.
  </Card>

  <Card title="No threading or attachments" icon="paperclip">
    Only the latest customer message feeds the draft. Prior history retrieval is a follow-up.
  </Card>

  <Card title="No multi-helpdesk" icon="plug">
    Intercom only. Front, Plain, Zendesk are deferred until the demand signal is real.
  </Card>
</CardGroup>

## Setup

<Steps>
  <Step title="Connect Intercom">
    In **Settings → Integrations → Helpdesk integrations**, click **Connect Intercom**. The same OAuth flow used for metric ingestion. Triage reuses the existing token.
  </Step>

  <Step title="Enable Triage">
    In **Settings → Integrations → Triage**, flip the toggle. The **Triage** nav item appears in the sidebar under *Console*.
  </Step>

  <Step title="Add a tone hint (optional)">
    One line, fed into every draft prompt: *"warm but concise; British English; never use the word 'reach out'"*. Saves you from re-editing every draft for voice.
  </Step>

  <Step title="Paste help-doc snippets">
    Same Settings page. Each snippet is a title plus plain-text body. Think one billing-tier policy, one refund script, one known workaround per snippet. Up to \~8000 chars of doc context fit per draft.
  </Step>

  <Step title="Wait or trigger a poll">
    The cron runs every 10 minutes. Or click **Poll Intercom** at the top of the Triage page to force one immediately.
  </Step>
</Steps>

## Working through the queue

The Triage page is built to work like an inbox. A few affordances:

### Keyboard shortcuts

Available when the **Open** filter is active and no input has focus. The currently-focused card carries a thin blue outline.

| Key     | Action                                                      |
| ------- | ----------------------------------------------------------- |
| `j`     | Focus the next card                                         |
| `k`     | Focus the previous card                                     |
| `Enter` | Send the focused card's draft                               |
| `e`     | Drop focus into the draft textarea (so you can edit)        |
| `r`     | Redraft the focused card's reply                            |
| `d`     | Discard the focused card                                    |
| `Esc`   | When the textarea has focus, return to card-level shortcuts |

The hint strip above the cards shows the live mapping.

### Sort the queue

Above the cards, a sort dropdown:

* **Oldest first** (default) — work the queue back-to-front, so nothing ages out
* **Newest first** — useful for live-shift work where you want the freshest customer message
* **At-risk accounts first** — surfaces conversations where the customer's company is flagged on the [Accounts](/help/accounts) view

### Send-and-next

After Send (or Discard), focus auto-advances to the next pending card and lands inside its draft textarea, ready to edit. Lets a leader work through 10–15 drafts without ever touching the mouse.

### Optimistic redraft

Click **Redraft** and the textarea immediately swaps to a skeleton with a small loading indicator while Claude regenerates. When the new draft lands, the textarea returns with the fresh content. No frozen UI during the round-trip.

## Reading the stats strip

The strip at the top of the Triage page rolls up the last 30 days of outcomes.

| Stat                 | What it means                                    | What to watch for                   |
| -------------------- | ------------------------------------------------ | ----------------------------------- |
| **Drafts**           | Total conversations with a logged outcome        | Volume signal                       |
| **Sent unedited**    | Agent pressed Send without changing the draft    | The gold-standard signal            |
| **Sent edited**      | Agent edited then sent                           | Healthy, but watch the edit pattern |
| **Discarded**        | Agent dismissed the draft                        | Drafts missing the mark             |
| **Acceptance**       | (sent\_unedited + sent\_edited) / total          | Should climb week-over-week         |
| **Unedited of sent** | sent\_unedited / (sent\_unedited + sent\_edited) | Crossing 50% is the product signal  |

<Tip>
  If discarded climbs past 30%, your tone hint or help-doc snippets need attention — the model isn't getting enough context to draft credibly. If unedited-of-sent climbs past 50%, you've earned the right to think about Triage as a standalone product.
</Tip>

## Settings

<AccordionGroup>
  <Accordion title="Triage enabled" icon="toggle-on">
    Boolean. When off, the cron skips your workspace and the Triage nav item is hidden. Toggling off does not delete prior drafts or conversation rows.
  </Accordion>

  <Accordion title="Tone hint" icon="quote-left">
    One optional line, max 240 characters. Fed into every draft prompt as a voice constraint. Useful for accent ("British English"), tone ("warm but concise"), or banned phrases ("never use 'reach out'").
  </Accordion>

  <Accordion title="Help-doc snippets" icon="file-lines">
    Workspace-scoped library. Owners and admins can add, edit (blur to save), and archive. Total context cap is \~8000 characters across all snippets per draft. Older snippets fall off the prompt context first if the total exceeds the cap — keep entries concise and on-topic.
  </Accordion>
</AccordionGroup>

## API

```bash theme={null}
GET    /triage?status=open|sent|discarded|resolved
POST   /triage/poll                       # owner/admin: force a poll (rate-limited 20/hr)
GET    /triage/stats                      # 30-day outcome rollup
POST   /triage/:id/redraft                # regenerate the draft (rate-limited 60/hr)
POST   /triage/:id/send                   # body { draftId, body }
POST   /triage/:id/discard
GET    /triage/docs                       # list help-doc snippets
POST   /triage/docs                       # body { title, body }
PATCH  /triage/docs/:id                   # body { title?, body? }
DELETE /triage/docs/:id                   # soft-archive
```

## Costs

Each draft is one Claude Sonnet 4.6 call. Roughly 1.5k input tokens (system prompt + customer message + doc context) and \~400 output tokens. At Anthropic's current pricing that works out to \~\$0.01-0.03 per draft.

A team handling 30 customer messages a day spends roughly **\$1/day per workspace**.

<Note>
  Sonnet 4.6 is the deliberate choice over Haiku for v1. Customer-facing tone matters more than structured-output speed. If volume scales, the next move would be Haiku for routine drafts and Sonnet for tier-2 categories — not in v1.
</Note>

## Frequently asked

<AccordionGroup>
  <Accordion title="Does the customer see anything before I press Send?">
    No. The draft lives only in Forepost until you click **Send via Intercom**. Until then, nothing has touched the customer's conversation in Intercom beyond reading it.
  </Accordion>

  <Accordion title="What if I want to reply in Intercom directly, not through Triage?">
    Click **Discard** on the Forepost card and reply in Intercom as normal. The conversation drops out of the open Triage list and the discard is logged so your stats stay honest.
  </Accordion>

  <Accordion title="Does Triage retrieve prior messages in the thread?">
    Not in v1. Only the latest customer message goes into the draft prompt. This is a known limitation; thread-history retrieval is the first follow-up feature once v1 demand is validated.
  </Accordion>

  <Accordion title="Can I use Triage with Zendesk, Front, or Plain?">
    Not yet. OAuth scaffolding for those providers exists, but the metric and draft paths are Intercom-only in v1. Each new provider is its own discrete piece of work.
  </Accordion>

  <Accordion title="What model is used?">
    Claude Sonnet 4.6. Configurable in the worker's `MODELS.triage` constant if you self-host.
  </Accordion>

  <Accordion title="Who can use Triage in my workspace?">
    Anyone with a workspace seat sees the Triage page when Triage is enabled. Sending and discarding requires owner or admin role. Members can read drafts but can't send them in v1 — this will likely loosen once the role model for inbox actions is clearer.
  </Accordion>
</AccordionGroup>

## Privacy

Customer messages and Forepost-generated drafts live in your workspace's D1 scope. The customer's body is stored long enough to render in the Triage view; on Send, only the final agent-approved body is written to Intercom and stored on `triage_drafts.final_body`. Nothing is shared cross-workspace.

When you discard or resolve a conversation, the rows stay for the 30-day stats rollup. They can be wiped from `/admin/clear-demo-data` if needed in development; production rows are retained by default for trend analysis.

## What's next, out of v1 scope

* Autonomous send for high-confidence categories
* Embedding-based RAG over help docs (today: simple concatenation)
* Front, Plain, Zendesk OAuth and draft paths
* Thread-history retrieval to ground drafts on prior agent replies
* A separate "Console" brand surface, priced independently
* Saved replies and macros
* Multi-language draft hints beyond model defaults

Each of these is a discrete piece of work. Triage v1 stays small on purpose — the point is to learn whether AI-assisted drafting is worth paying for, not to ship a helpdesk.
