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

# Prompt Practices

> Prompt practices for single-state agents in Sarvam Voice Agents: one goal per agent, speakable turns, unhappy paths, and declarative over scripted prompts.

Most agents should start as a **single-state agent**: one prompt, one set of tools, no explicit state machine. It's the fastest thing to build, the easiest to test, and it's enough for the majority of use cases. Reach for [multi-state](/voice-agents/build/states-conversation-flow) design only when the conversation genuinely branches into distinct phases.

## Prompt practices

* **One goal per agent.** If you're describing two unrelated jobs, that's two agents (or a multi-state flow).
* **Front-load the important rules.** State the goal, the guardrails, and the "done" condition early.
* **Keep turns short and speakable.** Write the way you want the agent to talk.
* **Be explicit about collection.** Say exactly what to ask for, in what order, and what to confirm.
* **Handle the unhappy path.** Say what to do on refusal, silence, wrong number, or missing data.
* **Reference tools by purpose.** Tell the agent *when* to use a [tool](/voice-agents/build/tools), not just that it exists.

## Declarative style of prompting

Prefer describing the **outcome and the rules** over writing a rigid, line-by-line script. A declarative prompt adapts to what the customer actually says; a scripted prompt breaks the moment the conversation goes off the expected path.

| Scripted (avoid)                                  | Declarative (prefer)                                                                              |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| "Say: 'Hello, am I speaking to X?' Then say: '…'" | Greet the caller, confirm you're speaking to the account holder, then explain why you're calling. |
| A fixed decision tree in prose                    | The rules that decide each branch, and the goal each branch serves                                |

The agent still needs specifics (what to collect, what to confirm), declarative doesn't mean vague. It means expressing intent and constraints, and letting the model handle phrasing and ordering within them.

> **Tip**
>
> Use the [prompt checker / AI review](/voice-agents/build/system-prompt#prompt-checker) and [test agent](/voice-agents/deploy/overview) to iterate on a single-state agent before adding complexity.