> For the complete documentation index, see [llms.txt](https://docs.revenium.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.revenium.io/get-started/quickstart/examples/ai-sales-agent.md).

# AI Sales Agent Example

AI sales agents can research accounts, enrich leads, qualify opportunities, and prepare follow-up before a human ever touches the deal. That work has a real cost: model calls, enrichment tools, contact search, and review time. The business question is whether the agent creates enough qualified pipeline or converted revenue to justify that spend.

This example simulates a sales funnel — prospecting, qualification, and close-prep — and ties model spend, enrichment cost, and human review cost back to a converted revenue outcome. Some jobs convert; the rest complete without revenue, so the funnel economics stay visible.

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** — total agent cost vs. converted revenue, with a value ratio for the sales workflow.
* **Conversion Funnel** — converted vs. unsuccessful jobs across the run.
* **Cost Composition** — split between AI model spend, enrichment tool spend, and human escalation cost.
* **Tool Cost ratio** — share of cost driven by Zoominfo / Apollo / SDR handoff vs. the model itself.
* **Traces** — per-job sequence of prospecting → qualification → close, with parent/child step linkage.
* **Agent decision costs & Tool usage** — role-level attribution for the sales agent and its tools.

## Run It

The example scripts ship in the public SDK repo, not on PyPI. Clone the repo first, then run from inside it:

```bash
git clone https://github.com/revenium/revenium-python-sdk.git
cd revenium-python-sdk
pip install revenium-python-sdk
python examples/agentic_outcomes/sales.py --count 5
```

Set `REVENIUM_API_KEY` (a write-scope key, `rev_sk_…`, generated at [app.revenium.ai → Integrations](https://app.revenium.ai/connections/sdk-setup)) before running. Use `--dry-run` or `--plan` to preview without sending data.

## View The Source

The runnable scenario lives in the public SDK:

* **sales.py** — [examples/agentic\_outcomes/ directory](https://github.com/revenium/revenium-python-sdk/tree/main/examples/agentic_outcomes)
* **Shared runtime (common.py)** — [examples/agentic\_outcomes/ directory](https://github.com/revenium/revenium-python-sdk/tree/main/examples/agentic_outcomes)
* **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 `sales.py` exposes the customization points: `SUBSCRIBER`, `LLM_STEPS`, `TOOL_STEPS`, the conversion rule in `pick_outcome`, and the metadata fields in `build_metadata`. Tweak these to match your sales motion (your model mix, your enrichment vendors, your conversion rate, your average deal size). For the full TUNABLES reference and recipes, 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

Sales teams rarely need another token chart. They need to know whether the agent helped create pipeline, whether expensive enrichment was worth it, and where human review changed the economics. This example connects operational evidence from the trace with the business result reported on the job.

## 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)
* [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 performance or ROI guarantees.
* Use a demo team or clearly named demo data for first runs.
* Prompt details in the UI depend on your workspace prompt-capture settings.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.revenium.io/get-started/quickstart/examples/ai-sales-agent.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
