---
title: "Agent Simulations"
canonical: "https://livekit.com/products/agent-simulations"
---

# Agent Simulations

Run your real agent against LLM-driven simulated users in text and audio. Test full conversations
before deployment, see where they break, and bring production failures back into your test suite.

## Test every part of your agent before you deploy

- **Automated scenarios** — generate scenarios from your agent code and run them automatically, in
  parallel.
- **Audio simulations** — run scenarios through your full voice pipeline. LiveKit adds real-world
  conditions like background noise and interruptions, then measures latency, transcription
  accuracy, and call quality.
- **Text simulations** — cheaper to run, for extra coverage of more cases. Text simulations focus on
  your agent's logic: how it understands requests, uses tools, and moves through a conversation.
- **Conversation evaluation** — evaluate the full conversation and confirm that the agent completed
  the expected task and reached the right outcome.
- **Production to test** — turn real production failures into reusable test scenarios that keep
  testing for the same issue as your agent changes.
- **CI integration** — add simulations to your main branch pipeline so every commit is tested
  before it reaches production.

## Run a simulation

Install the LiveKit CLI and run this from your agent's directory. With no scenario file, the CLI
generates scenarios from your agent's source:

```shell
lk agent simulate text
```

## Part of LiveKit Cloud

Agent Simulations is part of LiveKit Cloud, the end-to-end platform to build, run, and observe voice
agents. [Explore the agent platform](https://livekit.com/products/agent-platform)

## Resources

- [Testing voice agents with Agent Simulations](https://livekit.com/blog/testing-voice-agents-with-agent-simulations)
- [How Serve AI shipped a better voice agent with Agent Simulations](https://livekit.com/blog/how-serve-ai-shipped-a-better-voice-agent-with-agent-simulations)
- [Step-by-step tutorial (video)](https://youtu.be/ycSxhQTKX7Y)
- [Simulations docs](https://docs.livekit.io/testing/simulations/)

## FAQ

### How do I get started with Simulations?

[Sign up for a LiveKit Cloud account](https://cloud.livekit.io), build an agent with the LiveKit
Agents SDKs, then install the LiveKit CLI and run `lk agent simulate text` from your agent's
directory. With no scenario file, the CLI generates scenarios from your agent's source. See the
[docs](https://docs.livekit.io/testing/simulations/).

### What's the difference between text and audio simulations?

Text simulations exchange text with your agent without using STT or TTS, so they focus on your
agent's logic and are cheap enough to run on every change. Audio simulations run the same scenarios
through your full speech pipeline and measure latency, transcription accuracy, and turn-taking,
including under conditions like background noise and packet loss. Audio turns are metered at a
higher rate than text. See [text mode](https://docs.livekit.io/testing/simulations/#text-mode).

### Do I need to deploy my agent before running a simulation?

No. The CLI starts your agent as a local worker from your working tree and sends simulated calls to
it, so you can test a change before it becomes a build. You can also run against an already-running
agent with the `--agent-name` flag. See
[run a simulation](https://docs.livekit.io/testing/simulations/#run-a-simulation).

### What can Simulations evaluate?

Every simulation returns a pass or fail verdict with a reason, graded against the expectations you
write. Audio runs also measure call quality, including the end-to-end latency the caller heard
broken down by stage, transcription accuracy in both directions, turn-taking, and overall
conversation quality. See
[grade on final state](https://docs.livekit.io/testing/simulations/#grade-on-final-state).

### Can I run Simulations in CI/CD?

Yes. The CLI exits non-zero when a scenario fails, so a failed run breaks your build with no extra
configuration. Text-mode requests are scheduled at low priority and paced into spare capacity in
your inference quota, so they don't compete with live traffic. See
[CI](https://docs.livekit.io/testing/simulations/ci/).

### Can I turn production conversations into test scenarios?

Yes. Select **Turn into a test** on a session in
[Agent Observability](https://livekit.com/products/agent-observability), and LiveKit derives a
scenario from the call, including the outcome that should have happened. Add it to your scenarios
file and it runs with the rest of your suite. Because scenarios are checked into your repo, the
scenario and the fix can ship in the same pull request. See
[derive a scenario](https://docs.livekit.io/testing/simulations/derive-a-scenario/).

## Get started

Read the [Simulations docs](https://docs.livekit.io/testing/simulations/) or sign up at
[LiveKit Cloud](https://cloud.livekit.io).
