Skip to main content

What is Simulation?

Simulation is the process where ArkSim runs your pre-built scenarios as live conversations against your agent. Each scenario acts as a simulated user with a defined persona, goal, and prior knowledge who drives a multi-turn interaction with the agent until the user’s goal is achieved or the turn limit is reached. The output is a set of conversation transcripts you can inspect directly or pass into Evaluation.
ArkSim Simulation Workflow

Inputs

Before running a simulation, you need three things in place:

Configuration

The default num_workers is 50. Set num_workers: auto to automatically parallelize across all conversations, or specify a fixed number to control load on your agent endpoint.

Advanced: Custom simulated user prompt

By default, ArkSim uses a built-in system prompt to drive the simulated user. You can override it by setting simulated_user_prompt_template in your config to a Jinja2 template string. The template is rendered per conversation with these variables: From the scenario file
  • scenario.agent_context: A description of the agent being simulated against (e.g., its role, domain, or business purpose).
  • scenario.goal: The specific task or objective the simulated user is trying to accomplish during the conversation (e.g., “file an insurance claim”).
  • scenario.knowledge: Reference content (e.g., product details, policy documents) that the simulated user can draw on when answering or asking questions.
  • scenario.user_profile: A second-person natural language persona description for the simulated user, used as-is in the prompt.
Use them in your template with {{ scenario.goal }}, {{ scenario.user_profile }}, and so on. If you omit simulated_user_prompt_template, the default prompt is used.

Agent configuration

Provide agent connection by defining agent_config inline in your config YAML.

Configuration fields

Connection types

ArkSim supports three ways to connect your agent:
Type: chat_completionsConnects to any OpenAI-compatible chat completions endpoint.Required fields: endpoint (API URL), headers (e.g. Content-Type; Authorization optional), body (must include a messages array).Placeholders: ${ENV_VAR} is supported in header values for secrets.Example (YAML):

Environment variable support

Both types support ${ENV_VAR} substitution in header values (and in the endpoint URL for chat completions where applicable). At runtime the value is replaced; if unset, it becomes an empty string. You can mix static text and variables (e.g. "Bearer ${API_KEY}").
Security: Keep credentials in environment variables and out of committed config files.

Running a Simulation

1

Set up your config file

Create a config.yaml file with your agent config and simulation parameters:
2

Run the simulation

Run a simulation with the default configuration:
You can override config values with CLI flags:
3

Inspect your output

Simulation writes to the path set by output_file_path (default ./simulation.json). The file contains the full transcript of every conversation, ready to inspect or pass into Evaluation.

Output

Simulation writes one file: the path set by output_file_path (default ./simulation.json). It contains the full transcript of every conversation: message history, scenario ID, simulated user prompt (template and variables), and all agent and simulated user messages. For the full structure and field order, see the Schema Reference.

Example output


Next Steps

Once your conversations are simulated, you’re ready to evaluate how well your agent performed.

Evaluation →

Score your agent’s responses against the simulated user’s goals and knowledge.