langwatch-scenario
The end-to-end agent testing library
What it is and what it does
Langwatch-scenario is an agent testing framework designed to validate LLM-based agent behavior through automated simulation. It runs multi-turn conversations between your agent implementation and simulated users (powered by LLMs), optionally with judge agents that evaluate outcomes against predefined criteria. You integrate your agent by implementing a single `call()` method, then define scenarios as pytest tests or standalone scripts that describe the context and expected behavior.
The framework handles the conversation loop, message passing, and evaluation. It supports both scripted control (where you define exact turn sequences) and autopilot mode (where the user simulator drives the conversation until success or max turns). Runtime dependencies include pytest, litellm, openai, pydantic, fastapi, and opentelemetry-sdk, reflecting its design for LLM integration, async execution, and observability. The package is actively maintained and available in Python, TypeScript, and Go.
Use it for:
- Test that a customer support agent asks follow-up questions and provides accurate information before resolving tickets.
- Validate a recipe recommendation agent generates vegetarian options and includes ingredient lists and cooking instructions.
- Verify a weather agent calls the correct tool and handles edge cases like missing location data.
- Evaluate a coding assistant's ability to explain code changes and respond to clarification requests.
- Benchmark agent behavior across different LLM models to compare response quality and tool usage.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Langwatch-scenario is an agent testing framework that simulates multi-turn conversations between your agent and LLM-powered user simulators, with optional judge agents to evaluate behavior against criteria.
Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive Apache-2.0 license, and solves a real problem—testing agent behavior in realistic multi-turn scenarios. Low install friction and a large dependency set (28 runtime packages) are typical for LLM testing frameworks. Install if you need to validate agent behavior beyond unit tests or if you're building agents that must handle complex, multi-turn interactions reliably.
Install
langwatch-scenario on PyPI
pip
pip install langwatch-scenariouv
uv add langwatch-scenariopoetry
poetry add langwatch-scenarioInstalling langwatch-scenario
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (1 day old) and 951 GitHub stars. Requires Python 3.10 or later.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; you must include a copy of the license and state significant changes.
Quickstart
pip install langwatch-scenario pytest
import scenario
import pytest
@pytest.mark.asyncio
async def test_agent():
class MyAgent(scenario.AgentAdapter):
async def call(self, input: scenario.AgentInput):
return {"role": "assistant", "content": "response"}
result = await scenario.run(
name="test",
description="Test scenario",
agents=[MyAgent(), scenario.UserSimulatorAgent()]
)
assert result.success
Requires Python 3.10 or later. Depends on 28 runtime packages including litellm, openai, fastapi, and opentelemetry-sdk; ensure your environment can resolve all transitive dependencies.
Verify before relying
- Whether the framework supports custom evaluation metrics beyond the built-in judge agent criteria.
- Performance characteristics when running many concurrent simulations or long multi-turn conversations.
- Compatibility with non-OpenAI LLM providers beyond what litellm abstracts.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 28 — pytest, pytest-rerunfailures, litellm, openai, python-dotenv, termcolor, pydantic, joblib, wrapt, pytest-asyncio, rich, pksuid, httpx, rx, python-dateutil, pydantic-settings, langwatch, opentelemetry-sdk, imageio-ffmpeg, numpy, webrtcvad-wheels, websockets, twilio, fastapi, uvicorn, audioop-lts, google-genai, elevenlabs |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 97,271/month — #13,159 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: langwatch_scenario-1.1.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
agentevalsProvides evaluators and utilities to assess…
permissive · top 15,000 on PyPI
dreadnodeDreadnode is an SDK for building, testing, and…
unclear · top 15,000 on PyPI
deepevalDeepEval is an LLM evaluation framework that…
permissive · top 5,000 on PyPI
llama-index-agent-openaiIntegrates OpenAI language models with…
permissive · top 5,000 on PyPI
agentopsAgentOps provides observability and monitoring…
permissive · top 15,000 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
judgevalJudgeval is an SDK for tracing and evaluating…
permissive · top 15,000 on PyPI
openevalsOpenEvals provides a framework for writing and…
permissive · top 5,000 on PyPI
openai-agentsA framework for building multi-agent LLM…
permissive · top 1,000 on PyPI
policyengine-corePolicyEngine Core provides a microsimulation…
agpl · top 15,000 on PyPI