Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Microsoft AI-driven R&D agent for automated data and model development
.claude/skills/brycewang-stanford-rd-agent-guide/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-01 | ✗→✓ | ▲ Improved | 38% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 58% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 65% | 0% |
RD-Agent is an open-source AI-powered research and development automation framework developed by Microsoft Research, with over 12,000 stars on GitHub. It automates key steps in the R&D lifecycle -- including hypothesis generation, experiment design, code implementation, and result analysis -- enabling researchers and data scientists to accelerate their development cycles significantly.
The framework implements a closed-loop R&D automation pipeline where an AI agent iteratively proposes hypotheses, implements experiments, evaluates results, and refines its approach based on feedback. This mirrors the scientific method but operates at machine speed, allowing researchers to explore a much larger space of ideas and configurations than would be feasible manually.
RD-Agent is particularly valuable for researchers working in quantitative finance, data science, and machine learning, where the development process involves iterating on feature engineering, model architectures, and hyperparameter configurations. The framework has demonstrated the ability to autonomously develop competitive machine learning models and trading strategies, achieving results comparable to experienced human practitioners.
bash# Clone the repository git clone https://github.com/microsoft/RD-Agent.git cd RD-Agent # Install dependencies pip install -e . # Or install from PyPI pip install rdagent
bash# LLM configuration (required) export OPENAI_API_KEY=$OPENAI_API_KEY export CHAT_MODEL=gpt-4o # Or use Azure OpenAI export AZURE_OPENAI_API_KEY=$AZURE_OPENAI_API_KEY export AZURE_OPENAI_ENDPOINT=$AZURE_OPENAI_ENDPOINT export AZURE_OPENAI_DEPLOYMENT=$AZURE_OPENAI_DEPLOYMENT # Docker is required for sandboxed code execution # Ensure Docker is installed and running docker --version
RD-Agent uses Docker containers to execute generated code safely, ensuring that automatically generated experiments cannot affect the host system. This sandboxed execution is critical for an autonomous agent that writes and runs arbitrary code.
RD-Agent implements a continuous improvement loop with four phases:
pythonfrom rdagent.core.runner import RDRunner from rdagent.scenarios.data_science import DataScienceScenario # Define the research scenario scenario = DataScienceScenario( task="tabular_classification", dataset_path="path/to/dataset.csv", target_column="label", metric="auc", ) # Create and run the R&D agent runner = RDRunner( scenario=scenario, max_iterations=50, llm_model="gpt-4o", ) # Start the autonomous R&D loop results = runner.run() # Review the best solution found print(f"Best metric: {results.best_score}") print(f"Iterations: {results.total_iterations}") print(f"Solutions explored: {results.num_solutions}")
RD-Agent supports multiple R&D scenarios out of the box:
Automatically engineer features, select models, and tune hyperparameters for tabular data tasks:
pythonfrom rdagent.scenarios.data_science import DataScienceScenario scenario = DataScienceScenario( task="tabular_regression", dataset_path="data/housing.csv", target_column="price", metric="rmse", time_budget_hours=4, )
Develop and backtest trading factors and strategies:
pythonfrom rdagent.scenarios.qlib import QlibScenario scenario = QlibScenario( market="csi300", task="alpha_factor_mining", backtest_start="2020-01-01", backtest_end="2024-12-31", metric="information_coefficient", )
Iterate on model architectures and training procedures:
pythonfrom rdagent.scenarios.model_dev import ModelDevScenario scenario = ModelDevScenario( task="image_classification", base_model="resnet50", dataset="cifar100", optimization_target="accuracy", )
RD-Agent maintains detailed logs of all experiments, enabling post-hoc analysis of the R&D process:
python# Access experiment history for experiment in results.history: print(f"Iteration {experiment.iteration}:") print(f" Hypothesis: {experiment.hypothesis}") print(f" Changes: {experiment.code_changes}") print(f" Metric: {experiment.score}") print(f" Analysis: {experiment.feedback}")
Define custom evaluation metrics for domain-specific research:
pythonfrom rdagent.core.evaluation import EvaluationFunction class CustomMetric(EvaluationFunction): def evaluate(self, predictions, ground_truth, **kwargs): # Your custom metric computation score = compute_domain_specific_metric(predictions, ground_truth) return { "primary_metric": score, "secondary_metrics": { "precision": compute_precision(predictions, ground_truth), "recall": compute_recall(predictions, ground_truth), } } scenario = DataScienceScenario( evaluation_function=CustomMetric(), # ... other config )
Guide the agent with human feedback at key decision points:
pythonrunner = RDRunner( scenario=scenario, human_in_the_loop=True, review_frequency=5, # Review every 5 iterations ) # The agent will pause for human review at specified intervals # You can approve, reject, or modify proposed experiments
Use RD-Agent to systematically explore which components contribute most to model performance:
python# Define ablation study ablation_config = { "base_model": "your_full_model", "components_to_ablate": [ "attention_mechanism", "residual_connections", "layer_normalization", "data_augmentation", ], "metric": "accuracy", "num_seeds": 5, # Run each configuration with 5 seeds }
Let the agent discover and implement novel features for your dataset:
pythonscenario = DataScienceScenario( task="feature_engineering", dataset_path="data/research_data.csv", existing_features=["feature_a", "feature_b", "feature_c"], target="outcome", max_new_features=20, )
Every experiment run by RD-Agent is fully reproducible. The framework saves the complete experiment specification including code, data transformations, random seeds, and environment details, enabling other researchers to reproduce and build upon the results.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | fail→pass | 16,738 | 9,048 | -46% | 1 | 1 | 0% | 3,474 | 3,367 | -3% | 0 | 0 | — |
case-01 | fail→pass | 13,911 | 20,642 | +48% | 1 | 1 | 0% | 2,769 | 3,829 | +38% | 0 | 0 | — |
case-23 | fail→fail | 16,599 | 23,305 | +40% | 1 | 1 | 0% | 3,347 | 5,717 | +71% | 0 | 0 | — |
case-03 | fail→pass | 25,448 | 13,531 | -47% | 1 | 1 | 0% | 4,131 | 3,954 | -4% | 0 | 0 | — |
case-04 | pass→pass | 7,269 | 1,664 | -77% | 1 | 1 | 0% | 1,041 | 2,005 | +93% | 0 | 0 | — |
case-05 | fail→pass | 6,995 | 2,002 | -71% | 1 | 1 | 0% | 1,281 | 2,030 | +58% | 0 | 0 | — |
case-06 | fail→pass | 6,575 | 2,993 | -54% | 1 | 1 | 0% | 1,362 | 2,242 | +65% | 0 | 0 | — |
case-07 | pass→pass | 13,890 | 8,551 | -38% | 1 | 1 | 0% | 1,916 | 2,999 | +57% | 0 | 0 | — |
case-08 | fail→pass | 9,758 | 2,217 | -77% | 1 | 1 | 0% | 1,370 | 2,108 | +54% | 0 | 0 | — |
case-09 | fail→pass | 14,565 | 5,002 | -66% | 1 | 1 | 0% | 2,317 | 2,527 | +9% | 0 | 0 | — |
case-10 | fail→pass | 17,107 | 7,004 | -59% | 1 | 1 | 0% | 3,664 | 2,833 | -23% | 0 | 0 | — |
case-11 | fail→pass | 13,974 | 5,483 | -61% | 1 | 1 | 0% | 3,183 | 2,567 | -19% | 0 | 0 | — |
case-12 | fail→pass | 10,184 | 2,999 | -71% | 1 | 1 | 0% | 1,993 | 2,315 | +16% | 0 | 0 | — |
case-13 | fail→pass | 14,413 | 2,798 | -81% | 1 | 1 | 0% | 2,617 | 2,356 | -10% | 0 | 0 | — |
case-14 | fail→pass | 13,617 | 3,568 | -74% | 1 | 1 | 0% | 2,308 | 2,424 | +5% | 0 | 0 | — |
case-15 | pass→pass | 19,033 | 12,893 | -32% | 1 | 1 | 0% | 2,908 | 3,763 | +29% | 0 | 0 | — |
case-16 | fail→pass | 10,388 | 6,927 | -33% | 1 | 1 | 0% | 1,815 | 2,796 | +54% | 0 | 0 | — |
case-17 | pass→pass | 11,763 | 2,561 | -78% | 1 | 1 | 0% | 2,123 | 2,259 | +6% | 0 | 0 | — |
case-18 | fail→pass | 9,742 | 24,448 | +151% | 1 | 1 | 0% | 1,635 | 2,529 | +55% | 0 | 0 | — |
case-19 | fail→pass | 17,529 | 2,050 | -88% | 1 | 1 | 0% | 2,606 | 2,167 | -17% | 0 | 0 | — |
case-20 | fail→fail | 28,056 | 2,335 | -92% | 1 | 1 | 0% | 3,939 | 2,086 | -47% | 0 | 0 | — |
case-21 | pass→pass | 15,620 | 12,741 | -18% | 1 | 1 | 0% | 2,442 | 3,753 | +54% | 0 | 0 | — |
case-22 | pass→pass | 19,110 | 15,827 | -17% | 1 | 1 | 0% | 4,317 | 5,525 | +28% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +65 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.