Skip to main content
Some steps take a while. Initialization and generation scale with project complexity; optimization scales with the rollout budget and how long your agent takes to run.
1

Clone the sample

Creates a disposable local sample workspace.
# default location
relai onboarding

# or choose where it lands
relai onboarding --destination ~/relai-onboarding-agent
2

Enter the folder & set keys

Move in, create the local .env, set OPENAI_API_KEY so the agent can make model calls, then export into your shell.
cd ~/relai-onboarding-agent
cp .env.example .env   # then edit OPENAI_API_KEY
export $(xargs < .env)
3

Initialize

Register the sample, write .relai config, and scaffold the simulator.
relai init
4

Create a learning environment from the sample log

The feedback tells RELAI what behavior to preserve; a fixed --name makes the generated sample easy to find.
relai learning-env create \
  --log-file logs/conversation-001.json \
  --feedback "The agent should not answer off-topic questions and clearly state it can only help with finance" \
  --name no-off-topic
5

Simulate

Result JSON stays under .relai/runs/.
relai simulate \
  --learning-envs no-off-topic \
  --result-json .relai/runs/onboarding-simulation.json
6

Optimize

RELAI collects scope, runs improvement attempts, and summarizes proposed changes. Optionally push to a GitHub remote first if you want an optimizer PR.
relai optimize --total-rollouts=10
Uploaded runs appear on the Simulations and Optimizations tabs after you open the sample agent from the Agents page.