Skip to main content
Glama

livekit-agent-simulator

Platform Python License: MIT CI GitHub release

Dial any LiveKit voice agent with an AI simulated caller — WebRTC room, inbound SIP, or outbound SIP — and keep a full forensic log.
Standalone MCP server + CLI (lks). Black-box testing: no imports from the agent under test, no edits to its code or .env.

curl -fsSL "https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/install.sh" \
  | bash -s -- --verify

Install via coding agent (copy-paste)

Paste into Claude Code, Cursor, Codex, AmpCode, Windsurf, or any coding agent from the repo you want to test:

Install and configure livekit-agent-simulator (CLI: lks) for this project by following the instructions here:
https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/docs/guide/installation.md

Target project root is this workspace. Use absolute --root paths. Install the portable CLI if missing, run lks init, help fill .agent-sim/config.yaml from my local env or ask me for LiveKit + active text-backend key (Gemini or OpenAI) + agent_name, ensure .agent-sim is gitignored, run preflight, and stop before execute if the voice agent worker is not running. Do not edit agent application source outside .agent-sim/.

Same idea, one line:

Install and configure livekit-agent-simulator by following: https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/docs/guide/installation.md

TL;DR

The Problem

Voice agents fail in ways unit tests never see:

Gap

What you miss

No real caller

Scripts that never interrupt, stall, or switch language

Chat-only evals

No room events, audio timing, or tool spans

Manual QA calls

Not CI-reproducible, no structured PassCriteria

Agent-coupled harnesses

Tests break when you refactor the worker

The Solution

livekit-agent-simulator drives an AI simulated caller — text generation per simulator.provider (Gemini / OpenAI), validated by the caller contract, spoken via TTS — from scenario YAML over one of three transport modes (Caller.mode), observes transcripts / tools / flow / room events, and writes a timestamped report you can play back.

Surface

What you get

lks CLI

init → preflight → execute → report → web

MCP server

Same ops for Claude Code, Cursor, Codex, …

Transport modes

webrtc_sim · inbound_sip · outbound_human_pickup · outbound_sim_callee (optional agent_dials)

Reports

events.jsonl, timeline.md, summary.json, optional stereo WAV

Judge

Optional LLM PassCriteria scoring

Why Use lks?

Feature

What it does

Black-box dispatch

Only needs agent_name + LiveKit creds

5 transport modes

WebRTC · inbound SIP · outbound human pickup · outbound sim callee · agent_dials

Scenario JSONL

Persona, Caller, Telephony, Execute, Script, PassCriteria, Dispatch

Forensic log

Per-turn events in SQLite + reports/<run-id>/

Report player

Local web UI: audio + transcript sync

CLI ↔ MCP parity

One ops layer — no duplicate run paths

Portable packs

Download installer; no uv/pip required for users


Quick Example

# Install once
curl -fsSL "https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/install.sh" \
  | bash -s -- --verify

# In the repo you want to test (agent worker must already be running)
lks init --root /path/to/target
# edit /path/to/target/.agent-sim/config.yaml  (LiveKit + active provider keys, agent_name)

lks preflight --root /path/to/target
lks execute smoke-hello --root /path/to/target
lks report <run-id> --root /path/to/target
lks web --root /path/to/target          # Ctrl+C to stop

Related MCP server: Dialfetch MCP

Design Philosophy

  1. The agent under test is a black box.
    We never import or patch target application code. Dispatch metadata is opaque JSON.

  2. Generic core, target-owned config.
    Language, timezone, topics, and business strings belong in the target’s .agent-sim/ — not hardcoded in the package.

  3. One ops layer for CLI and MCP.
    execute_* validates then runs. No “run vs execute” forks.

  4. Forensics over vibes.
    Every run produces structured events you can compare, log, and play back.

  5. CI-friendly gates.
    Hard fails on status / assert / script; optional strict judge for softer LLM scoring. A run the judge could not grade is neither: it reports gate: ungraded, which is not a pass. ok means graded and passed.


How It Works

1. Read <target>/.agent-sim/config.yaml
2. Pick SimLeg from scenario Caller.mode (webrtc_sim | inbound_sip | outbound_human_pickup | outbound_sim_callee | agent_dials)
3. Connect leg → LiveKit room(s) / SIP hairpin as needed; the caller contract path drives speech (see below)
4. Bridge audio; observe transcripts, tools, timing, interruptions
5. Write reports/<run-id>/ + runs.sqlite
6. Optional LLM judge vs PassCriteria
                    Caller.mode (scenario)
         ┌───────────────┬────────────────┬──────────────────┬────────────────────┐
         │  webrtc_sim   │  inbound_sip   │   outbound_human_pickup   │ outbound_sim_callee│
         │  room audio   │  sim dials DID │ human answers → │  Gemini SIP callee │
         │               │                │ Gemini colocated│  (2-room hairpin)  │
         └───────┬───────┴────────┬───────┴────────┬─────────┴─────────┬──────────┘
                 │                │                │                   │
                 └────────────────┼────────────────┼───────────────────┘
                                  ▼
                    ┌──────────────────────────┐
                    │  Contract caller path    │
                    │  (scenario caller_steps  │
                    │   → LiveKit agent)       │
                    └────────────┬─────────────┘
                                 │ observe
                                 ▼
                    reports/<run-id>/ · runs.sqlite · judge

Mode details and config: docs/telephony.md. Templates: inbound-caller-sim, outbound-human-pickup, outbound-callee-sim.

The caller contract path (the only caller execution path)

Every scenario carries caller_steps: — the legacy persona free-generation path is removed, not branched. The AI generates language only; it never decides WHAT happens next, and nothing it produces reaches the agent without passing validation:

Scenario
  │  caller_steps: say / do / wait / dtmf / interrupt / end
  ▼
Behavior Contract ── WHAT is locked (act · target · slots · constraints)
  │
  │  Orchestrator ── WHEN is locked (turn gate · timeouts · staleness · max_turns)
  ▼
AI Language Adapter ── HOW is adaptive (text-only LLM call, no audio session)
  │
  │  Contract Validator ── HARD GATE (claim ≠ evidence: act/target re-derived
  │                         from utterance text; lexical + semantic tiers)
  ▼
VALID ──► wait agent silence ──► TTS (sherpa-onnx, OS fallback) ──► PCM
  │                                                        │
  │                                          BridgePublishSink ──► LiveKit mixer
  │                                                        │        (speech layer;
  │                                                        │         authored beds
  │                                                        ▼         go to noise)
  │                                                      Agent
  │
INVALID ──► retry (bounded, max_retries + 1 attempts)
  │
  └── exhausted ──► CALLER_BEHAVIOR_VIOLATION ──► FAIL (no fallback speech)

Invariants the suite pins (not aspirations — each has a regression test):

  • No unvalidated utterance reaches the agent — test_contract_e2e_hard_boundary.py; mutation-checked (test_contract_live_wiring.py, Audit B). ⚠️ One deliberate carve-out on the routed path — see below.

  • Rejected candidates never reach TTS/PCM/mixer — synthesis happens only after VALID.

  • Authored audio never touches the speech layer — play_audio: beds go to the mixer's noise layer; a mixer without one is refused (TRANSPORT_ERROR), never rerouted.

  • The caller never talks over the agent — both say: and do: wait for agent silence (bounded 6 s) before publishing.

  • script.verify / recovery asserts / ended_by understand both event vocabularies — legacy sim.script.* and contract contract.*.

The routed path (responses:) — opt-in

A scenario may also author a responses: catalog. The two coexist, and when both are present the ROUTER runs — caller_steps still supplies the opening action and stays mandatory, but it does not win precedence. Every existing scenario is untouched because none of them author responses:.

Scenario ─ responses: ─► Decision Router ─ picks ONE responseId (WHAT)
                              │
                              ▼
                         Orchestrator (WHEN) ── unchanged
                              │
                              ▼
                    Language Adapter (HOW, text_planner) ── unchanged
                              │
                              ▼
              Contract Validator ── BYPASSED on this path

The validator is skipped on a routed turn, and that carves out the "no unvalidated utterance reaches the agent" invariant above. It is deliberate: the routed line is authored ground truth, so validating it means the harness grading its own fixture — and it fails closed, turning an agent bug into CALLER_BEHAVIOR_VIOLATION. The routed candidate gets a synthetic ValidationResult(VALID, reason="ROUTED"). Do not "restore" the validator on this path. Rationale in NEW_ARCHITECTURE_FOR_LKS_AND_LKSR.md §27.7.

The catalog requires one system: true entry, which is what makes "the router always returns a valid id" structural rather than aspirational — and makes an agent that goes off-script recorded (off_script) rather than papered over. That verdict means the agent deviated, not the caller.

⚠️ Every other entry is one-shot unless you set reusable: true. A spent entry leaves the router's option set entirely, so an agent that asks for the company name twice cannot be answered with the company name the second time — the router picks something else, which reads as a routing bug when the catalog was simply empty. Set it on anything the agent could plausibly ask about twice.

Details: docs/contract-caller-wiring.md (design), docs/caller-runtime-audit.md (reachability + audio invariant evidence), docs/caller-phase-d-acceptance.md (live-run acceptance checklist).


How lks Compares

Approach

Real room

AI caller

Forensic log

MCP

Black-box

Manual phone QA

✅

❌

❌

❌

✅

Unit / mock STT

❌

❌

Partial

❌

❌

In-repo agent tests

⚠️

⚠️

Varies

❌

Often coupled

lks

✅ LiveKit

✅ contract-validated (Gemini / OpenAI text)

✅ Full

✅

✅

When to use lks:

  • Regression suites for LiveKit voice agents

  • Agent-driven CI / coding-agent workflows (MCP)

  • Debugging turn-taking, tools, and silence without reading agent source

When it might not be ideal:

  • Pure text chatbots with no LiveKit room

  • Offline environments without LiveKit + an active text-backend API key (Gemini or OpenAI)


Installation

Download only — no uv/pip/build on your machine. CI ships a portable pack (embedded Python + deps + report player).

# macOS / Linux
curl -fsSL "https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/install.sh" \
  | bash -s -- --verify
# Windows PowerShell
irm "https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/install.ps1" -OutFile "$env:TEMP\lks-install.ps1"
powershell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\lks-install.ps1" -Verify

Also available from a release asset:

curl -fsSL "https://github.com/quangdang46/livekit_agent_simulator/releases/download/v0.1.0/install.sh" \
  | bash -s -- --verify

Flag

Purpose

--verify

Checksum verification

--ref v0.1.0

Pin release tag

--no-mcp

Skip MCP registration into coding tools

--uninstall

Remove install

By default the installer registers the MCP server livekit-agent-simulator (lks mcp) into detected tools: Claude Code, Cursor, Cline, Windsurf, VS Code Copilot, Gemini CLI, Amazon Q, OpenCode, Codex, Warp.

Agent-oriented install playbook (long form): docs/guide/installation.md
Raw URL for paste into agents:
https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/docs/guide/installation.md

From source (maintainers / contributors)

git clone https://github.com/quangdang46/livekit_agent_simulator.git
cd livekit-agent-simulator
uv sync --extra dev
uv run lks --help

Requires Python 3.10–3.13.

Web UI (maintainers)

Users never build this — CI packs web/dist into the wheel as web_static. Source: web/.

pnpm --dir web install
pnpm --dir web build                    # → web/dist/ (attached by Hatch on uv build)
pnpm --dir web dev                      # HMR; proxy /api + /runs → lks web :8765

See web/README.md.


lksr — experimental Rust binary

lksr is the in-progress Rust full port of lks (single static-ish binary, no Python runtime). Source: src/livekit_agent_simulator_rust/. Same 22 CLI commands + MCP server + report player.

Status: data-plane ops (scenarios/validate/export/cues/plugins/runs/report/compare/optimize) and offline gates are at parity; the live-run path still has known gaps vs Python (script speak cues reach the room via the OpenAI bridge only, judge defaults to skip without judge.base_url, verify plugins need a build with --features python-plugins). For CI-critical runs use the Python lks; try lksr for quick local checks.

⚠️ lksr does not execute routed scenarios. A scenario authoring responses: with a router: block configured is refused at run time with both remedies named. Without a router: block it runs caller_steps normally — lks raises ConfigError for that combination, so the two ports are deliberately complementary, not symmetric: each refuses what the other accepts. lksr is a subset port — it validates less, never differently. Full reasoning and the 2×2 table: AGENTS.md, "The routed path is PYTHON-ONLY".

Python lks stays the default install; pass --rust / -Rust for the Rust binary:

curl -fsSL "https://github.com/quangdang46/livekit_agent_simulator/raw/main/install.sh" | bash -s -- --rust --verify

lksr is Linux/macOS-only. webrtc-sys has no working Windows prebuilt, so there is no lksr.exe release asset. On Windows use Python lks (default install).

cd src/livekit_agent_simulator_rust && cargo build -p lks && cargo test --workspace   # from source

Quick Start

# Agent worker must be running and registered with LiveKit
lks guide
lks init --root /path/to/target
# fill .agent-sim/config.yaml

lks preflight --root /path/to/target
lks scenario-init smoke-hello --root /path/to/target   # if needed
lks validate smoke-hello --root /path/to/target
lks execute smoke-hello --root /path/to/target
lks runs --root /path/to/target
lks report <run-id> --root /path/to/target
lks web --root /path/to/target

Minimal scenario (smoke-hello)

apiVersion: agent-sim/v1
kind: Scenario
metadata:
  id: smoke-hello
  locale: en-US
  tags: [smoke]
persona:
  name: Alex
  brief: First-time caller; confirm you reached the right place, then end politely.
  goals:
  - Hear the agent
  - Say you will call back
  style: polite, brief
execute:
  max_turns: 2
  timeout_s: 90
  first_speaker: user
pass_criteria:
  criteria:
  - The agent responded to the caller
  - The agent responded in the caller's language

Optional multi-judge PassCriteria: judges[] + mode (all | majority | any). Assert highlights (tool_order, constraint_respected, recovery/latency): lks guide.

Full-line # comments in scaffolded YAML are guides — runtime ignores them. Legacy *.jsonl scenarios are still read.


Configuration

Target-only data lives under <target>/.agent-sim/ (gitignored). Created by init.

Section

Required

Purpose

livekit.url

yes

wss://… LiveKit Cloud or self-host

livekit.api_key / api_secret

yes

Server API credentials

livekit.agent_name

yes

Must match worker dispatch name

livekit.dispatch_metadata

no

Default opaque JSON string for all runs

simulator.api_key

yes

Key of the active text backend (google → Gemini, openai → OpenAI)

simulator.provider / mode

no

Caller language backend: google (default) or openai; realtime mode (cascade reserved)

simulator.voice.model / voice / language

no

Provider-neutral voice bag; defaults flash-live, Puck, en-US

simulator.profiles

no

Named caller profiles — switch provider without editing the file

simulator.target_keywords

no

{target: [kw, …]} merged into the semantic verifier. Read this if a do: turn fails with CALLER_BEHAVIOR_VIOLATION — the built-in target table is commercial vocabulary only, so a target outside it can never pass and you find out by paying for a call

simulator.text_temperature

no

Default 0.0 (was fixed at 0.4). Governs the do: opener generator, not text_planner. At 0.4 the validator's verdict flapped between identical runs, because the generator resampled and the retry loop resamples rather than re-reasons

judge.model

no

If set + PassCriteria → post-run LLM judge

router.*

no

Opt-in. Only needed if a scenario authors responses:. Absent is normal; lks init deliberately does not scaffold it

text_planner.*

no

Opt-in. enabled: false publishes routed lines verbatim; true paraphrases them

observe.record_audio

no (default true)

Local stereo WAV (L=sim, R=agent); no Egress

observe.data_topics

no

Empty = all topics

observe.tool_event_patterns

no

Map data payloads → tool start/end/error

See template: templates/config.yaml. Consumer-specific wiring: docs/portability.md.

Switching caller provider with --profile

To A/B test the same scenario against Gemini Live vs OpenAI Realtime (or any set of provider/voice combos) without editing config.yaml between runs, define named profiles under simulator.profiles: and select one with --profile <name> on execute / execute-all / preflight.

simulator:
  # legacy flat block = fallback (used when no --profile flag and no default profile)
  provider: google
  mode: realtime
  api_key: "AQ.Ab8..."                 # Gemini Live key

  # named profiles — switch with --profile <name>
  profiles:
    gemini:
      default: true                    # auto-selected when no --profile flag
      provider: google
      api_key: "AQ.Ab8..."             # Gemini Live key
    openai:
      provider: openai
      api_key: "sk-..."                # OpenAI key
      voice:
        model: "gpt-realtime-2.1-mini"
        voice: "marin"
lks execute smoke-hello                    # `gemini` (marked default: true)
lks execute smoke-hello --profile gemini   # Gemini text backend
lks execute smoke-hello --profile openai   # OpenAI text backend

Selection (--profile absent): if exactly one profile has default: true, it is used; otherwise the legacy flat simulator: block runs. 2+ profiles marked default: true is an error (no "first wins"). If profiles: exist with no default and no flat-block credentials, config loading errors loudly (no silent fallback). --profile <name> always wins regardless of which profile is default. A missing profile name fails loudly (lists available profiles) — no silent fallback. Profile names are case-sensitive.

Precedence: profile field → flat simulator: field → built-in default. A profile inherits unspecified fields (voice, language, mode) from the flat block, so openai above only overrides provider + api_key + voice, and keeps mode: realtime. Presence of profiles: never changes what runs when neither --profile nor a default: true profile is present — that is the flat block (backward compatible).

⚠️ Gemini caller model note (observed 2026-08): gemini-3.1-flash-live-preview — the historical default — is a preview model with known instability as the simulated caller: transient mid-call WebSocket drops (APIError 1006 / 1008, end reason gemini_socket_drop) in ~2/15 real runs, plus LiveKit-documented limits (send_client_content rejected after the first model turn, update_instructions/generate_reply unsupported). If you see calls ending with gemini_socket_drop, switch the caller model to a stable release, e.g.:

simulator:
  voice:
    model: "gemini-2.5-flash-native-audio-preview-12-2025"   # or gemini-live-2.5-flash-native-audio (GA)

Verified: gemini-2.5-flash-native-audio-preview-12-2025 connects and talks as the caller with 0 socket drops across real runs (the -12-2025 date suffix is required — gemini-2.5-flash-native-audio-preview alone returns API_KEY_INVALID).


Commands

CLI and MCP share the same public ops (ops.py). Prefer execute (validate then run).

CLI

MCP tool

Purpose

init

init_project

Scaffold .agent-sim/ + gitignore

guide

guide

Setup/ops guide (markdown)

web

web

Local report player

preflight

preflight

Config + LiveKit connectivity

scenarios

list_scenarios

List scenarios/*.yaml (legacy *.jsonl read)

plugins

list_plugins

Verify plugins

cues

list_cues

Built-in + local PCM cues

validate

validate_scenario

Schema + lint

export

export_scenario

Parsed scenario JSON

scenario-init

init_scenario

Scaffold JSONL with // guides

execute

execute_scenario

Validate then run one scenario

execute-all

execute_scenarios

Batch (ids / tag)

execute-dict

execute_scenario_dict

In-memory scenario dict

status

get_run_status

SQLite run status

log

get_run_log

Filtered events.jsonl

report

get_run_report

Summary + verdict + paths

compare

compare_runs

Diff two runs; --baseline hard-fails on latency/assert / barge-recovery regression

runs

list_runs

Run history

serve

—

REST API (JSON over HTTP; same ops as CLI/MCP)

optimize

optimize_persona

Offline persona-prompt optimizer (live benchmark loop) → .agent-sim/optimized/ artifact

mcp

—

Start MCP server (stdio)

lks execute smoke-hello --root /path/to/target
lks execute-all --tag smoke --root /path/to/target
lks serve --root /path/to/target    # REST API on :8787 (same ops as CLI/MCP)
lks log <run-id> --root /path/to/target
lks compare <run-a> <run-b> --root /path/to/target
lks compare <baseline> <candidate> --baseline --root /path/to/target
lks optimize scen-a,scen-b --held-out scen-c --root /path/to/target   # → optimized/<name>/
lks execute scen-a --optimized <name> --root /path/to/target           # apply the winner
lks web --port 8765 --root /path/to/target

Every MCP tool needs project_root except guide.

Output format

List/table-shaped commands (scenarios, runs, plugins, cues, validate, preflight, execute, execute-all, execute-dict, compare, status, report, log) print a human-readable rich table by default. Add --json to any of them for the raw machine-readable payload — the same bytes the MCP tools return. Single-dict commands (init, export, convert, scenario-init, scenario-from-run, guide, web) always print JSON.

lks scenarios                          # human table
lks scenarios --json                   # raw JSON for scripts / CI / agents
lks execute-all --json | jq '.suite'   # pipe JSON to jq

Agents & CI: use --json — the default table is for humans.

MCP config examples

Installer writes this when tools are detected. Manual Cursor:

{
  "mcpServers": {
    "livekit-agent-simulator": {
      "command": "lks",
      "args": ["mcp"],
      "env": {}
    }
  }
}

Dev checkout (package not installed globally):

{
  "mcpServers": {
    "livekit-agent-simulator": {
      "command": "uv",
      "args": ["run", "--directory", "/abs/path/livekit-agent-simulator", "lks", "mcp"]
    }
  }
}

Equivalent one-shot entry: lks-mcp (same process as lks mcp).


Architecture

src/livekit_agent_simulator/
├── cli.py / mcp_server.py     # thin surfaces
├── ops.py                     # shared public ops
├── run_orchestrator.py        # room lifecycle + run
├── scenario.py                # JSONL parse / validate
├── config.py                  # .agent-sim/config.yaml
├── preflight.py
├── asserts.py / suite.py      # CI gates
├── caller_contract/           # the caller: driver · validator · adapter · planner · DSL
├── callers/                   # LiveKit mic/mixer plumbing (gemini / openai bridges)
├── livekit/                   # room, dispatch, observe
├── audio/ · script/ · plugins/
└── web/                       # report player server

Layer

Role

Target .agent-sim/

Config, scenarios, reports, local plugins/cues

Package templates/

Scaffold defaults + built-in cues

LiveKit

Room, dispatch, data topics, transcription

Text backend (per simulator.provider: Gemini / OpenAI)

Caller language generation — text-only, no audio session

TTS (sherpa-onnx, OS fallback)

Validated text → PCM


CI / Release

Workflow

Trigger

What it does

CI

PR / push → main

web UI build, pytest (3.10 + 3.12), lks --help

Release

tag v*

pytest → wheel → portable packs (win/linux/mac) → GitHub Release

# Local check
uv sync --extra dev
pnpm --dir web build
uv run pytest -q

# Release (pre-1.0 may force-retag a single 0.1.0)
git tag v0.1.0
git push origin v0.1.0

Troubleshooting

preflight fails connectivity

lks preflight --root /path/to/target
# Confirm livekit.url / api_key / api_secret and that the project is reachable.
# Skip API check while editing config:
lks preflight --no-connectivity --root /path/to/target

Agent never joins the room

  • Worker process must be running and registered with the same livekit.agent_name.

  • Increase livekit.agent_join_timeout_ms if cold start is slow.

  • Check dispatch metadata is valid JSON string if your worker requires it.

Simulator / caller-provider auth errors

Set simulator.api_key in .agent-sim/config.yaml for the active simulator.provider (google → Gemini Live, openai → OpenAI Realtime).

No audio in report player

With observe.record_audio enabled (default true): reports/<run-id>/conversation.wav

lks web --root /path/to/target

MCP tools not listed

lks mcp   # must be what the host launches
# or reinstall without --no-mcp
curl -fsSL "https://raw.githubusercontent.com/quangdang46/livekit_agent_simulator/main/install.sh" \
  | bash -s -- --verify

Scenario validation errors

lks validate my-case --root /path/to/target
lks scenario-init my-case --root /path/to/target   # fresh scaffold with // guides

Limitations

What lks Doesn't Do (Yet)

  • Not an agent framework — it tests agents; it does not implement business tools

  • Not offline-first — needs LiveKit + an active text-backend API key (Gemini or OpenAI)

  • Not a load generator — one simulated caller per run (batch via execute-all)

Known Limitations

Capability

Current state

Notes

Black-box dispatch

✅

Opaque metadata only

Multi-caller rooms

❌

Single sim participant

Caller backends

✅

Gemini and OpenAI text backends (per simulator.provider); speech via TTS, not Realtime audio

Pixel-perfect ASR scoring

❌

Use PassCriteria + judge / asserts

Secrets in config

⚠️ Paste in gitignored YAML

Do not commit .agent-sim/


FAQ

Does it modify my agent repo?

Only scaffolds .agent-sim/ (gitignored). It does not edit agent source.

CLI vs MCP — which should I use?

Same ops. Use CLI in terminals/CI; MCP inside coding agents. Prefer execute_* over ad-hoc run paths.

How do I pass project-specific dispatch fields?

livekit.dispatch_metadata or scenario Dispatch.spec.metadata as an opaque JSON string. Core does not parse consumer keys. See docs/portability.md.

Can I assert on tool calls?

Yes — Assert.spec.tools, tool_order (required tool.start subsequence), observe.tool_event_patterns, Script/assert plugins, and/or PassCriteria + judge. See docs/plugins.md and lks guide.

Where are reports stored?

<target>/.agent-sim/reports/<run-id>/ plus runs.sqlite under .agent-sim/.

Is the report player separate?

No — lks web serves the prebuilt player from the install pack. Maintainers build from web/.


Docs

Doc

When

AGENTS.md

Rules for AI agents working on this package

docs/smoke-test.md

First end-to-end run

docs/portability.md

Consumer dispatch / observe setup

docs/plugins.md

Verify plugins + Python API

docs/telephony.md

SIP modes + outbound_sim_callee preflight

docs/interrupt-scenario-matrix.md

Barge / backchannel / noise authoring

lks guide

On-demand setup/ops guide (Assert, compare --baseline, PassCriteria)


About Contributions

Please don't take this the wrong way, but I do not accept outside contributions for any of my projects. I simply don't have the mental bandwidth to review anything, and it's my name on the thing, so I'm responsible for any problems it causes; thus, the risk-reward is highly asymmetric from my perspective. I'd also have to worry about other "stakeholders," which seems unwise for tools I mostly make for myself for free. Feel free to submit issues, and even PRs if you want to illustrate a proposed fix, but know I won't merge them directly. Instead, I'll have Claude or Codex review submissions via gh and independently decide whether and how to address them. Bug reports in particular are welcome. Sorry if this offends, but I want to avoid wasted time and hurt feelings. I understand this isn't in sync with the prevailing open-source ethos that seeks community contributions, but it's the only way I can move at this velocity and keep my sanity.


License

MIT


Black-box LiveKit agent tests. Real rooms. Forensic reports.

Available Tools

12 tools
compare_runsB

Diff two runs: duration, turns, tool errors, turn-taking percentiles, verdicts.

Inputs: run_id_a (required), run_id_b (required), project_root (required). Returns: object

execute_scenarioA

Validate then execute one scenario from .agent-sim/scenarios/*.jsonl. Returns validation + run result.

Inputs: scenario_id (required), project_root (required). Returns: object

execute_scenariosA

Execute multiple scenarios. Omit scenario_ids to run all valid files; optional tag filter (e.g. smoke).

Inputs: project_root (required), tag, scenario_ids. Returns: object

export_scenarioC

Export a parsed scenario (Persona, Execute run params, Dispatch flag, PassCriteria) as JSON.

Inputs: scenario_id (required), project_root (required). Returns: object

get_run_logC

Read events.jsonl with filters. kind supports trailing * prefix match (e.g. tool.*).

Inputs: run_id (required), project_root (required), kind, turn, +3 more. Returns: object

get_run_reportC

Full report: summary, judge verdict, suspicious turns, paths to timeline/events.

Inputs: run_id (required), project_root (required). Returns: object

get_run_statusA

Status of a run from SQLite: running / done / failed, turn count, duration.

Inputs: run_id (required), project_root (required). Returns: object

init_projectA

Scaffold .agent-sim/ (config.yaml + smoke scenario) in the target repo and gitignore it.

Inputs: project_root (required). Returns: object

list_runsC

Run history from SQLite, newest first. Optionally filter by scenario_id.

Inputs: project_root (required), limit, scenario_id. Returns: result

list_scenariosC

List all scenarios in .agent-sim/scenarios/*.jsonl with id, tags, and validity.

Inputs: project_root (required). Returns: result

run_scenarioC

Run a simulation (alias: prefer execute_scenario for validate-then-run).

Inputs: scenario_id (required), project_root (required). Returns: object

validate_scenarioC

Validate a scenario file: schema, required Persona brief, PassCriteria lint.

Inputs: scenario_id (required), project_root (required). Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 12 tools

    Disambiguation4/5

    Most tools have distinct purposes (scaffolding, scenario management, execution, analysis). However, 'run_scenario' is an alias for 'execute_scenario', creating redundancy and potential confusion. Otherwise, boundaries are clear.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case (e.g., 'list_scenarios', 'validate_scenario', 'compare_runs'). No mixing of conventions.

    Tool Count5/5

    12 tools is well-scoped for a simulation framework: covering project initialization, scenario management, execution, validation, and results analysis. Each tool serves a clear purpose.

    Completeness4/5

    The tool surface covers the core workflow (init, validate, execute, analyze). Minor gaps: no direct tool for creating/editing scenarios (only export) and no deletion management. The redundant alias is a slight detraction.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to make real-world phone calls with AI voice technology and provides tools to track call status, transcripts, and summaries. It supports automated communication with both live numbers and simulated businesses for testing and demonstration purposes.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to place real phone calls, navigate IVR trees, and retrieve structured answers with transcripts and recordings.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to initiate and control outbound telephone calls and answer inbound calls through Telnyx and LiveKit, with realtime voice conversations powered by Gemini Live or OpenAI Realtime.
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLM agents to initiate real-time outbound WebRTC/SIP calls, execute operational actions mid-call, escalate to human operators, and access live call telemetry through MCP, with zero data-at-rest and TTL-bounded memory.
      MIT