Quick Start Guide
This guide will walk you through a minimal "hello world" example to get AIDE ML running in just a few steps. We will use the included House Prices dataset.
Step 1: Install AIDE ML
If you haven't already, install the package from PyPI:
pip install -U aideml
Step 2: Set Your LLM API Key
AIDE ML needs an API key to communicate with a Large Language Model. For this example, we'll use OpenAI. Set your key as an environment variable in your terminal:
export OPENAI_API_KEY=<your-openai-api-key>
Step 3: Run an Optimization Task
Now, you can start your first AIDE ML run. We'll point the agent to the built-in house_prices
example task and give it a goal and an evaluation metric in plain English.
Execute the following command in your terminal:
aide data_dir="example_tasks/house_prices" \
goal="Predict the sales price for each house" \
eval="Use the RMSE metric between the logarithm of the predicted and observed values."
What is this command doing?
aide
: This is the main command-line interface for the AIDE ML agent.data_dir="example_tasks/house_prices"
: This tells the agent where to find the dataset. AIDE ML automatically copies these files into a temporary workspace to work with.goal="Predict the sales price for each house"
: This is the high-level objective you're giving the agent.eval="..."
: This provides specific instructions on how the agent should measure the performance of its generated code.
The agent will now start its agentic tree search process. You will see a rich terminal interface showing the progress, the solution tree being built, and the current status.
Step 4: Inspect the Results
After the run completes (by default, after 20 steps), AIDE ML will save the results in a new directory inside the logs/
folder. The directory will have a unique name for your experiment, like logs/0-experiment-name/
.
Inside this directory, you will find several key files:
best_solution.py
: This file contains the best-performing Python script that the agent generated during its search.tree_plot.html
: This is an interactive HTML file that visualizes the entire solution tree. You can click on each node to see the plan, the generated code, and the execution output for that step.journal.json
: A detailed JSON file containing all information about every step of the agent's process.config.yaml
: The configuration used for this specific run.
Open tree_plot.html
in your web browser to explore how the agent navigated the solution space, corrected bugs, and improved its code over time.