Skip to main content

What is Agent Simulation?

Agent Simulation is a feature of the evaluatorq library that drives agents through realistic multi-turn conversations.
Agent Simulation is available in the Python version of evaluatorq only. The TypeScript version does not support it.
Three LLMs work together:
  • Target agent: the system under test (an Orq Agent or any async callback)
  • User simulator: plays a persona pursuing scenario goals turn-by-turn
  • Judge: scores goal achievement and rule compliance after each simulation
Results are returned as SimulationResult objects and, for Orq deployments, are automatically uploaded to AI Studio as Experiments.

Install

Approach 1: Generate from a description

generate_and_simulate() creates personas, scenarios, and opening messages from a brief agent description. Use this for a quick first pass.
num_personas × num_scenarios simulations run in parallel. Results are uploaded to AI Studio automatically.
Python

Approach 2: Seed by archetype

Name an archetype to get back editable Persona and Scenario objects. Inspect or adjust them before running the simulation.
Python
Use generate_personas([...]) and generate_scenarios([...]) (also from evaluatorq.simulation) to generate multiple objects in one call.
Replace target with target_callback=<my_async_fn>, add sim_model="gpt-4o-mini" to set the simulator/judge provider, and set upload_results=False to keep results local.

Approach 3: Full control

Define Persona, Scenario, and Criterion objects by hand to set exact traits, goals, and pass/fail rules.
Python

Simulation results

Each persona/scenario pair produces one SimulationResult: evaluator_names accepts any of the built-in evaluatorq scorers: "goal_achieved" and "criteria_met" are used by default when evaluator_names is omitted.

Red Teaming LLMs with evaluatorq

Probe deployments and agents for security vulnerabilities using the evaluatorq red teaming CLI.