# Examples

Most AI reporting starts with tokens, latency, and provider invoices. That is useful infrastructure telemetry, but it does not answer the business question: did the agent create value?

The hard part of scaling AI agents is closing that gap. A workflow can look healthy technically while still being economically unclear. It may call the right models, use the right tools, and complete the right steps, but finance and operations still need to know what the work produced, what it cost, and where human escalation changed the economics.

These examples show the outcome-based pattern Revenium is designed to support. Each scenario connects model cost, tool cost, trace behavior, and a terminal business outcome so teams can evaluate agent work as unit economics, not just usage.

## The Measurement Pattern

Each scenario follows the same loop:

1. The agent performs a recognizable business workflow.
2. Model calls and tool actions are metered with business context.
3. Related steps are joined into a trace.
4. The workflow reports an outcome for the job.
5. Revenium compares the cost of the work with the value it created or protected.

That pattern is reusable across agentic systems. The examples here focus on outcome-based workflows because they make the value question explicit: revenue generated, engineering work deflected, or support cost avoided.

## The Three Scenarios

| Scenario                      | What It Measures                                                                                           | Source                                                                                                       |
| ----------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **AI Sales Agent**            | Revenue attribution — converted pipeline value vs. enrichment, model, and human review cost.               | [sales.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/sales.py)     |
| **AI Coding Workflow**        | Engineering value — deflected engineering effort across PR review, test gen, RCA, release gates, dep risk. | [coding.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/coding.py)   |
| **AI Customer Support Agent** | Deflection economics — tickets resolved without human handling vs. escalation and upsell value.            | [support.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/support.py) |

Each scenario has its own page in this section:

* [AI Sales Agent Example](/get-started/quickstart/examples/ai-sales-agent.md)
* [AI Coding Workflow Example](/get-started/quickstart/examples/ai-coding-workflow.md)
* [AI Customer Support Agent Example](/get-started/quickstart/examples/ai-customer-support.md)

## Source & Setup

The runnable code lives in the public Revenium Python SDK. Installation, environment variables, exact commands, payload details, and tunables are maintained there:

* **Examples README (canonical):** [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)
* **Shared runtime (used by all three scenarios):** [common.py](https://github.com/revenium/revenium-python-sdk/blob/main/examples/agentic_outcomes/common.py)

```bash
pip install revenium-python-sdk
# then run any scenario, e.g.:
python examples/agentic_outcomes/sales.py --count 5
```

For a first run, use a demo team or clearly named demo data so the sample does not mix with production traffic. Start small, confirm the run appears in the expected Revenium views, then increase volume only if you need a denser dashboard sample.

## What Revenium Should Show

Use the examples to review the same workflow from several angles:

* [**ROI and unit economics**](/track-and-control-costs/analyze-roi-and-unit-economics.md): value generated or avoided cost compared with AI, tool, and human escalation costs.
* [**Logs and traces**](/optimize-performance/debug-logs-and-traces.md): the exact sequence of model calls, tool actions, timings, and outcome linkage for an individual job.
* [**Latency and performance**](/optimize-performance/monitor-latency-and-performance.md): workloads that are unusually slow, expensive, or transaction-heavy.
* [**Agent decision costs**](/instrument-your-agents/analyze-decision-costs.md) and [**tool usage**](/instrument-your-agents/monitor-agent-tool-usage.md): movement of work between agent roles and the economic impact of external tools.

The usual review path is: start in ROI, choose a representative job, then inspect the trace and performance details behind it.

## Related Reading

For current product updates, see the [Revenium changelog](/get-started/changelog.md). For broader writing on AI economics, outcomes, cost control, and agent operations, see the [Revenium blog](https://www.revenium.ai/blog).

## Notes

* Values are illustrative demo values, not performance or ROI guarantees.
* Prompt details in the UI depend on your workspace prompt-capture settings.
* When comparing screenshots, use the in-page date controls to match the demo run window.


---

# 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.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.
