# AI Customer Support Agent Example

AI support agents can classify tickets, search knowledge, draft responses, update support systems, and decide when a customer needs a human. The business value is not just ticket volume; it is whether the agent resolves routine work at a lower cost while escalating the cases that still need human judgment.

This example simulates a support queue across three motions — ticket triage, ticket resolution, and escalation handling — with three terminal outcomes per ticket: deflected, escalated, or converted (an upsell or renewal during the support session). The result is a deflection-economics view rather than a deflection-rate count.

For the broader outcome-measurement pattern across these examples, see the [overview page](/get-started/quickstart/examples.md).

## What You'll See

When the run completes, these Revenium views populate with the demo data:

* **ROI dashboard** — support-agent cost vs. deflected human handling cost plus upsell value, with net value.
* **Deflection Rate** — share of tickets resolved without human handling.
* **Outcome Mix** — deflected vs. escalated vs. converted (upsell) tickets.
* **Cost Composition** — AI model spend, tool spend (KB search, CRM lookup, ticket update), and human escalation review cost.
* **Tool Cost ratio** — share of cost driven by support tools vs. the model itself.
* **Traces** — per-ticket sequence of classify → KB search → draft → verify → ticket update.
* **Performance** — transaction count and duration outliers, useful for high-volume support batches.

## Run It

```bash
pip install revenium-python-sdk && python examples/agentic_outcomes/support.py --count 5
```

Set `REVENIUM_API_KEY` and `REVENIUM_TEAM_ID` first. Use `--dry-run` or `--plan` to preview, or `--force-outcome ESCALATED` to drive a specific outcome path.

## View The Source

The runnable scenario lives in the public SDK:

* **support.py** — [github.com/revenium/revenium-python-sdk/blob/main/examples/agentic\_outcomes/support.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/support.py)
* **Shared runtime (common.py)** — [github.com/revenium/revenium-python-sdk/blob/main/examples/agentic\_outcomes/common.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/common.py)
* **Examples README** — [github.com/revenium/revenium-python-sdk/blob/main/examples/agentic\_outcomes/README.md](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/README.md)

## Customize

The top of `support.py` exposes the customization points: `SCENARIOS` (triage / resolution / escalation mix and step sequences), `LLM_STEPS` and `TOOL_STEPS` (reusable step templates), `OUTCOME_WEIGHTS` (deflection / escalation / conversion rates), `UPSELL_VALUE_RANGE`, and the `ESCALATION_TOOL` cost. Tweak to match your support motion. For the full TUNABLES reference, see the [TUNABLES section of the examples README](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/README.md#tunables).

## Why This Matters

Support automation can look successful if you only count resolved tickets, but cost and escalation behavior change the story. A deflected ticket is valuable when the total cost of the agent and tools is lower than the human work it avoided. This example connects the support workflow, the operational cost, and the ticket outcome so teams can reason about deflection as unit economics.

## Related Views

* [ROI and unit economics](/track-and-control-costs/analyze-roi-and-unit-economics.md)
* [Logs and traces](/optimize-performance/debug-logs-and-traces.md)
* [Latency and performance](/optimize-performance/monitor-latency-and-performance.md)
* [Agent decision costs](/instrument-your-agents/analyze-decision-costs.md)
* [Tool usage](/instrument-your-agents/monitor-agent-tool-usage.md)

## Notes

* Values are illustrative demo values, not support benchmark claims.
* Prompt details in the UI depend on your workspace prompt-capture settings.
* Keep first runs small enough that individual ticket traces are easy to inspect.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.revenium.io/get-started/quickstart/examples/ai-customer-support.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
