# google-research/era architecture

> Architecture diagram of the GitHub repository google-research/era, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/google-research/era
- Repository: https://github.com/google-research/era

## Overview

ERA’s example workflow prepares a regression task, uses FUTS to select and expand candidate solutions, generates code through Gemini, executes candidates in a sandbox, and scores them by RMSE before returning the best. The graph also preserves the repository’s documented scientific-application branch. The sampled sandbox implementation is only an interface stub; the README’s alternative notebook workflow and application details were not inspected beyond documentation.

Main entry points: [`implementation/playground_s3e1.py`](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py) (Experiment runner), [`implementation/futs.py`](https://github.com/google-research/era/blob/main/implementation/futs.py) (FUTS search), [`implementation/llm.py`](https://github.com/google-research/era/blob/main/implementation/llm.py) (Gemini adapter), [`implementation/data/playground-series-s3e1`](https://github.com/google-research/era/tree/main/implementation/data/playground-series-s3e1) (Housing data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Experiment workflow"]
  node_experiment["Experiment runner<br/>[playground_s3e1.py]"]
  node_data_prep["Data preparation<br/>[playground_s3e1.py]"]
  node_task_data[("Housing data")]
  node_generator["Candidate generator<br/>[playground_s3e1.py]"]
  node_llm_adapter["Gemini adapter<br/>[llm.py]"]
  node_executor["Candidate executor<br/>[playground_s3e1.py]"]
  node_sandbox["Sandbox interface<br/>[sandbox.py]"]
  node_candidate["Generated program<br/>[playground_s3e1.py]"]
  node_scorer["RMSE scoring<br/>[playground_s3e1.py]"]
  node_progress["Search progress<br/>[playground_s3e1.py]"]
end

subgraph group_search["FUTS search"]
  node_search_engine["FUTS search<br/>[futs.py]"]
  node_tree_policy["PUCT selection<br/>[futs.py]"]
end

subgraph group_extensions["Scientific extensions"]
  node_applications["Research applications"]
end

node_scientist(("Scientist"))
node_gemini["Gemini API"]

node_scientist -->|"runs"| node_experiment
node_experiment -->|"prepares data"| node_data_prep
node_data_prep -->|"reads and splits"| node_task_data
node_experiment -->|"configures"| node_generator
node_generator -->|"requests code"| node_llm_adapter
node_llm_adapter -->|"generates content"| node_gemini
node_experiment -->|"starts search"| node_search_engine
node_search_engine -->|"selects by PUCT"| node_tree_policy
node_search_engine -->|"expands candidate"| node_generator
node_search_engine -->|"evaluates candidate"| node_executor
node_executor -->|"runs program"| node_sandbox
node_executor -->|"loads split files"| node_task_data
node_executor -->|"scores predictions"| node_scorer
node_generator -->|"returns code"| node_candidate
node_experiment -->|"records history"| node_progress
node_scientist -->|"explores research"| node_applications

click node_experiment "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_data_prep "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_task_data "https://github.com/google-research/era/tree/main/implementation/data/playground-series-s3e1"
click node_generator "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_llm_adapter "https://github.com/google-research/era/blob/main/implementation/llm.py"
click node_search_engine "https://github.com/google-research/era/blob/main/implementation/futs.py"
click node_tree_policy "https://github.com/google-research/era/blob/main/implementation/futs.py"
click node_executor "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_sandbox "https://github.com/google-research/era/blob/main/implementation/sandbox.py"
click node_candidate "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_scorer "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_progress "https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py"
click node_applications "https://github.com/google-research/era/tree/main/era_applications"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_experiment,node_data_prep,node_task_data,node_generator,node_llm_adapter,node_executor,node_sandbox,node_candidate,node_scorer,node_progress toneBlue
class node_search_engine,node_tree_policy toneAmber
class node_applications,node_gemini toneMint
class node_scientist toneIndigo
```

## Components

### Experiment workflow

- [Experiment runner](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [Data preparation](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [Housing data](https://github.com/google-research/era/tree/main/implementation/data/playground-series-s3e1): `implementation/data/playground-series-s3e1`
- [Candidate generator](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [Gemini adapter](https://github.com/google-research/era/blob/main/implementation/llm.py): `implementation/llm.py`
- [Candidate executor](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [Sandbox interface](https://github.com/google-research/era/blob/main/implementation/sandbox.py): `implementation/sandbox.py`
- [Generated program](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [RMSE scoring](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`
- [Search progress](https://github.com/google-research/era/blob/main/implementation/playground_s3e1.py): `implementation/playground_s3e1.py`

### FUTS search

- [FUTS search](https://github.com/google-research/era/blob/main/implementation/futs.py): `implementation/futs.py`
- [PUCT selection](https://github.com/google-research/era/blob/main/implementation/futs.py): `implementation/futs.py`

### Scientific extensions

- [Research applications](https://github.com/google-research/era/tree/main/era_applications): `era_applications`

### Other components

- **Scientist**
- **Gemini API**

## Connections

- Scientist → Experiment runner: runs (evidence: `README.md`)
- Experiment runner → Data preparation: prepares data (evidence: `implementation/playground_s3e1.py`)
- Data preparation → Housing data: reads and splits (evidence: `implementation/playground_s3e1.py`)
- Experiment runner → Candidate generator: configures (evidence: `implementation/playground_s3e1.py`)
- Candidate generator → Gemini adapter: requests code (evidence: `implementation/playground_s3e1.py`)
- Gemini adapter → Gemini API: generates content (evidence: `implementation/llm.py`)
- Experiment runner → FUTS search: starts search (evidence: `implementation/playground_s3e1.py`)
- FUTS search → PUCT selection: selects by PUCT (evidence: `implementation/futs.py`)
- FUTS search → Candidate generator: expands candidate (evidence: `implementation/futs.py`)
- FUTS search → Candidate executor: evaluates candidate (evidence: `implementation/futs.py`)
- Candidate executor → Sandbox interface: runs program (evidence: `implementation/playground_s3e1.py`)
- Candidate executor → Housing data: loads split files (evidence: `implementation/playground_s3e1.py`)
- Candidate executor → RMSE scoring: scores predictions (evidence: `implementation/playground_s3e1.py`)
- Candidate generator → Generated program: returns code (evidence: `implementation/playground_s3e1.py`)
- Experiment runner → Search progress: records history (evidence: `implementation/playground_s3e1.py`)
- Scientist → Research applications: explores research (evidence: `README.md`)
