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.
- 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
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.
- Orq agent
- OpenAI
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 editablePersona and Scenario objects. Inspect or adjust them before running the simulation.
Python
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
DefinePersona, Scenario, and Criterion objects by hand to set exact traits, goals, and pass/fail rules.
- Orq agent
- OpenAI
Python
Simulation results
Each persona/scenario pair produces oneSimulationResult:
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.