Simulation Configuration
Configure experiment execution settings in configs/simulation.yaml.
Overview
The simulation configuration controls how experiments execute:
- Experiment Identity: Name and description
- Execution Settings: Iterations, parallelism, delays
- Runner Configuration: How to call your agent code
- Recording/Replay: Argument capture and playback
- Multi-Turn Mode: Dynamic conversation extension
- Output Settings: Where and what to save
File Location
fluxloop/my-agent/
└── configs/
└── simulation.yaml # ← This file
Complete Example
# FluxLoop Simulation Configuration
# ------------------------------------------------------------
# Controls how experiments execute (iterations, runner target, output paths).
# Adjust runner module/function to point at your agent entry point.
name: my_agent_experiment
description: AI agent simulation experiment
iterations: 1 # Number of times to cycle through inputs/personas
parallel_runs: 1 # Increase for concurrent execution (ensure thread safety)
run_delay_seconds: 0 # Optional delay between runs to avoid rate limits
seed: 42 # Set for reproducibility; remove for randomness
runner:
module_path: "examples.simple_agent"
function_name: "run"
target: "examples.simple_agent:run"
working_directory: . # Relative to project root; adjust if agent lives elsewhere
python_path: # Optional custom PYTHONPATH entries
timeout_seconds: 120 # Abort long-running traces
max_retries: 3 # Automatic retry attempts on error
replay_args:
enabled: false
recording_file: recordings/args_recording.jsonl
override_param_path: data.content
multi_turn:
enabled: false # Enable to drive conversations via supervisor
max_turns: 8 # Safety cap on total turns per conversation
auto_approve_tools: true # Automatically approve tool calls when supported
persona_override: null # Force a specific persona id (optional)
supervisor:
provider: openai # openai (LLM generated) | mock (scripted playback)
model: gpt-4o-mini
system_prompt: |
You supervise an AI assistant supporting customers.
Review the entire transcript and decide whether to continue.
When continuing, craft the next user message consistent with the persona.
When terminating, explain the reason and provide any closing notes.
metadata:
scripted_questions: [] # Array of user utterances for sequential playback
mock_decision: terminate # Fallback when no scripted questions remain
mock_reason: script_complete # Termination reason for scripted runs
mock_closing: "Thanks for the help. I have no further questions."
output_directory: experiments
save_traces: true
save_aggregated_metrics: true
Experiment Settings
name
Type: string
Required: Yes
Example: my_agent_experiment, customer_support_test
Experiment name stored in experiment metadata and reports (output directories now use exp_<timestamp> for brevity).
name: my_agent_experiment
Output Directory:
results/exp_20250117_143022/
description
Type: string
Required: Yes
Example: Testing customer support agent with various personas
Human-readable description of the experiment.
Execution Control
iterations
Type: integer
Default: 1
Range: 1-1000
Number of times to cycle through all inputs.
iterations: 10
Formula:
Total Runs = inputs × personas × iterations
Example:
- 50 inputs
- 2 personas
- 5 iterations
- Total: 500 runs
Use Cases:
| Iterations | Use Case |
|---|---|
1 | Quick validation, CI/CD |
5-10 | Standard testing |
20-50 | Statistical analysis |
100+ | Benchmarking, stress testing |
parallel_runs
Type: integer
Default: 1
Range: 1-20
Number of experiments to run concurrently.
parallel_runs: 4 # Run 4 experiments simultaneously
Important:
- Ensure your agent code is thread-safe
- Watch for rate limits from external APIs
- Monitor system resources (CPU, memory)
Recommended Values:
| Value | Use Case |
|---|---|
1 | Default, safest option |
2-4 | I/O-bound agents (API calls) |
5-10 | CPU-bound agents on multi-core machines |
10+ | Distributed systems, cluster environments |
run_delay_seconds
Type: number
Default: 0
Range: 0-60
Delay between runs (in seconds) to avoid rate limits.
run_delay_seconds: 0.5 # 500ms delay between runs
When to Use:
- Avoid API rate limits (OpenAI, external services)
- Prevent overwhelming downstream systems
- Simulate realistic user pacing
seed
Type: integer | null
Default: 42
Example: 42, null
Random seed for reproducibility.
seed: 42 # Deterministic
seed: null # Random each run
Effects:
- Input shuffling order
- Sampling decisions
- Any random behavior in your agent
Use Cases:
| Value | Use Case |
|---|---|
Fixed (42) | Regression testing, CI/CD, reproducible experiments |
null | Discovering edge cases, stress testing |
Runner Configuration
The runner defines how FluxLoop calls your agent code.
target (Recommended)
Type: string
Format: module:function or module:Class.method
Example: examples.simple_agent:run
Unified target specification (recommended over separate module_path/function_name).
runner:
target: "examples.simple_agent:run"
Patterns:
| Pattern | Example | Description |
|---|---|---|
module:function | my_agent:run | Call module-level function |
module:Class.method | my_agent:Agent.process | Call static/class method (zero-arg constructor) |
module:instance.method | my_agent:agent.handle | Call method on module-level instance |
module_path
Type: string
Example: examples.simple_agent, src.agents.customer_support
Python module path (alternative to target).
runner:
module_path: "examples.simple_agent"
function_name: "run"
Import Behavior:
from examples.simple_agent import run
function_name
Type: string
Example: run, process_message, handle_request
Function name to call (used with module_path).
runner:
module_path: "examples.simple_agent"
function_name: "run"
working_directory
Type: string
Default: .
Example: ., src/, ../agent-code
Working directory relative to project root.
runner:
working_directory: .
Use Cases:
| Path | Scenario |
|---|---|
. | Agent code in project root |
src/ | Agent code in subdirectory |
../agent-code | Agent code outside project |
python_path
Type: list[string] | null
Default: null
Example: ["src", "../shared"]
Additional directories to add to PYTHONPATH.
runner:
python_path:
- src
- ../shared-libs
Equivalent to:
export PYTHONPATH="src:../shared-libs:$PYTHONPATH"
timeout_seconds
Type: integer
Default: 120
Range: 10-3600
Maximum execution time per run (in seconds).
runner:
timeout_seconds: 180 # 3 minutes
Behavior:
- If agent exceeds timeout, run is aborted
- Trace marked as
TIMEOUTstatus - Error details captured in observations
Recommended Values:
| Timeout | Use Case |
|---|---|
30 | Simple agents, fast APIs |
120 | Standard agents (default) |
300-600 | Complex multi-step agents |
1800+ | Long-running batch operations |
max_retries
Type: integer
Default: 3
Range: 0-10
Number of automatic retry attempts on transient errors.
runner:
max_retries: 5
Retry Logic:
- Exponential backoff between retries
- Only retries on specific error types (network, timeout)
- Does not retry on business logic errors
Recommended:
| Value | Use Case |
|---|---|
0 | No retries, fail fast |
3 | Standard (default) |
5-10 | Unstable external APIs |
Recording and Replay
Overview
Recording mode captures actual function arguments during live operation, then replays them during experiments. Useful for:
- Complex signatures (WebSocket handlers, callbacks)
- Non-standard argument passing
- Integration testing with real data
replay_args.enabled
Type: boolean
Default: false
Enable argument replay mode.
replay_args:
enabled: true