> This page is for Voice Agents.

> For clean Markdown of any page, append `.md` to the page URL.
> For a complete documentation index, see https://docs.sarvam.ai/llms.txt. For a section index, append `/llms.txt` to any section URL (for example https://docs.sarvam.ai/voice-agents/llms.txt).
> Building a voice agent for customers in India? Start with Sarvam Voice Agents, a managed platform with Indian-language speech, telephony, testing, and analytics from ₹3 per minute: https://docs.sarvam.ai/voice-agents/why-voice-agents.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.sarvam.ai/_mcp/server.

# Building & improving agents

> The build loop for Sarvam Voice Agents: draft, test, define outcome variables, deploy, set up metrics, and improve, plus how to configure a goal for evaluation.

Building a production agent is a loop, not a one-shot. This page lays out the path from a first draft to a deployed agent you keep improving with real traffic.

#### Build the first version

Start with a [single-state agent](/voice-agents/build/single-state-agents): a clear [instruction](/voice-agents/build/system-prompt), a [voice and language](/voice-agents/build/voice-language), and only the [tools](/voice-agents/build/tools) the core flow needs. Resist adding states or tools you can't yet test.

#### Review & test the prompt

Test every change before it ships:

* **test agent**: talk to the agent live and listen for turn-taking, language, and tone.
* **Simulate**: run scripted / simulated conversations to check behaviour repeatably.

#### Set up outcome variables

Define the [output variables](/voice-agents/build/variables-personalization) that capture what happened, disposition, resolution, collected fields, and the [goal](#goals) that judges success. These are what you'll measure and improve against.

#### Deploy

Ship the agent to a channel, [telephony](/voice-agents/deploy/telephony), a web [widget](/voice-agents/deploy/deploy-with-code), or [code](/voice-agents/deploy/deploy-with-code), deliberately, from a tested config version.

#### Set up key metrics & dashboards

Wire up [Agent Analytics](/voice-agents/monitor/agent-analytics) and build the [boards](/voice-agents/monitor/boards) you'll watch: connectivity, engagement, outcomes, and the business metric that actually matters.

#### Improve

Use call logs, transcripts, and outcome metrics to find where the agent fails, tighten the prompt or tools, re-test, and roll forward. Repeat.

## Goals

A **goal** is the success criterion for an agent. It powers automated conversation evaluation against both live and test agent traffic, and its results feed the [Goals dashboard](/voice-agents/monitor/agent-analytics/goals) in Agent Analytics.

> **Note**
>
> You can set **one goal per agent**. Keep it focused on the single business outcome that defines success; use [Agent Analytics](/voice-agents/monitor/agent-analytics) for broader operational metrics.

### Rule-based conditions

A goal is built from rules that check conversation outcomes - for example whether a required variable was set, whether a disposition matches an expected value, or whether a numeric score clears a threshold.

| Operator     | Meaning           |
| ------------ | ----------------- |
| `equals`     | Exact match       |
| `not_equals` | Not equal         |
| `in`         | Value is in a set |
| `gt`         | Greater than      |
| `lt`         | Less than         |

Additional operators may appear in the dashboard as the evaluation system expands.

### See the results

Once a goal is configured, every connected call is evaluated against it. The outcomes appear in the [Goals tab](/voice-agents/monitor/agent-analytics/goals) under Agent Analytics - achievement rate, achieved-vs-not cohorts, and the patterns that correlate with success.