run Command
Execute simulation experiments with your agent.
Usage
fluxloop run experiment [OPTIONS]
Options
| Option | Description | Default |
|---|---|---|
--config, -c | Path to configuration file | configs/simulation.yaml |
--project | Project name under FluxLoop root | Current directory |
--root | FluxLoop root directory | ./fluxloop |
--iterations, -i | Number of runs per input | From config |
--personas, -p | Comma-separated list of personas to use | All personas |
--multi-turn/--no-multi-turn | Enable/disable multi-turn conversations | From config |
--max-turns | Maximum turns per conversation | From config |
--auto-approve-tools/--manual-approve-tools | Tool approval behavior | From config |
--persona-override | Force specific persona ID for multi-turn | None |
--supervisor-provider | Override supervisor provider (openai, anthropic, mock) | From config |
--supervisor-model | Override supervisor model | From config |
--supervisor-temperature | Override supervisor temperature | From config |
--supervisor-api-key | API key for supervisor calls | From env |
--output-dir | Output directory for results | experiments/ |
--experiment-name | Custom experiment name | Auto-generated |
--yes, -y | Skip confirmation prompt (for CI/automation) | false |
Examples
Basic Experiment
Run with default settings:
fluxloop run experiment
Custom Iterations
Override iteration count:
fluxloop run experiment --iterations 20
Named Experiment
Give your experiment a name:
fluxloop run experiment --experiment-name "baseline-test"
Skip Confirmation (CI Mode)
Run without interactive prompt for automation:
fluxloop run experiment --yes
# Or short form
fluxloop run experiment -y
This is ideal for CI/CD pipelines and pytest integration.
How It Works
1. Load Configuration
Reads configs/simulation.yaml:
runner:
target: "examples.my_agent:run"
iterations: 10
output:
directory: "experiments"
format: jsonl
2. Load Inputs
Loads generated inputs from inputs/generated.yaml:
generated_inputs:
- input: "How do I start?"
persona: novice_user
- input: "What are advanced options?"
persona: expert_user
3. Execute Agent
For each input, runs your agent iterations times:
# Your agent (examples/my_agent.py)
import fluxloop
@fluxloop.agent()
def run(input_text: str) -> str:
return process(input_text)
4. Collect Traces
Captures:
- Input/output pairs
- Execution time
- Observations
- Errors (if any)
5. Save Results
Outputs to experiments/exp_YYYYMMDD_HHMMSS/:
experiments/exp_20241101_143022/
├── summary.json # Aggregate stats
├── trace_summary.jsonl # Per-trace summaries
├── traces.jsonl # Detailed traces
├── observations.jsonl # Observation stream
└── config.yaml # Experiment config snapshot
Output Files
summary.json
Aggregate statistics:
{
"experiment_name": "my_agent_experiment",
"total_traces": 100,
"successful": 98,
"failed": 2,
"avg_duration_ms": 250.5,
"started_at": "2024-11-01T14:30:22Z",
"completed_at": "2024-11-01T14:35:10Z",
"config_snapshot": {...}
}
trace_summary.jsonl
One line per trace with summary information:
{"trace_id": "trace_001", "iteration": 0, "persona": "novice_user", "input": "How do I start?", "output": "...", "duration_ms": 245, "success": true}
{"trace_id": "trace_002", "iteration": 1, "persona": "expert_user", "input": "What are options?", "output": "...", "duration_ms": 267, "success": true}
observations.jsonl (optional)
Detailed observation stream with all events:
{"trace_id": "trace_001", "type": "span_start", "timestamp": "...", "name": "agent_run", ...}
{"trace_id": "trace_001", "type": "span_end", "timestamp": "...", "name": "agent_run", ...}