Skip to content

About

Autonomous AI Researcher on AWS: give it a research problem and it loops hypothesize → run experiment on GPU → learn → repeat, using Claude Code on Amazon Bedrock, with a compounding LLM Wiki and a web dashboard. Deployed with AWS CDK.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

AI Researcher

An autonomous AI Researcher that runs the scientific method end-to-end on AWS. Give it a research project and it will, in a tight loop, hypothesize → run an experiment → learn → repeat — thousands of times, faster and more systematically than a human team — and hand you a validated, high-performing answer along with the full reasoning trail that produced it.

It is built on Claude Code (via Amazon Bedrock), keeps a compounding LLM Wiki as its memory, runs each experiment on a GPU worker it powers on and off itself, and streams everything to a web app so you can watch it think. This repo is self-contained: infrastructure (CDK), the agent, and the web app.

📝 Blog post: From Literature to Experiments: An AI Researcher on AWS

This README is the main user documentation. Its core is the bootstrap-directory convention below — define any conforming project as a folder, upload it, and the AI Researcher picks it up and runs. demos/ has ready-to-run examples.

Building on or modifying Auto-Research? See the design doc — the architecture (with diagram), CDK stacks, control-plane Lambdas, runtime flow, and invariants.


Demo Video

Demo Video


When does the AI Researcher fit a problem?

Two things must be true:

  1. A candidate has a machine-representable format — the "answer" is a structured artifact a computer can emit and change: source code, a config, a formula, a parameter set, a policy, …
  2. A candidate can be scored programmatically — there's an automated way to measure how good a candidate is: a benchmark, a simulation, a test suite, a backtest, a sensor reading, …

If both hold, you can express the problem as a bootstrap directory and let the AI Researcher search the space for you.


Defining a project: the bootstrap-directory convention

A bootstrap directory is the complete, self-describing definition of one research project. You upload it in the web app (Create New Project → Upload folder); its contents are committed to the project's code repository and the AI Researcher runs against them. Any folder that follows this convention can be picked up — nothing about a project is hard-coded into Auto-Research.

Layout

<project>/                     # the folder name becomes the project id (slugified)
├── auto-research.json         # REQUIRED — the machine-readable spec (files, eval, metric; schema below)
├── README.md                  # REQUIRED — the researcher's brief (goal, background, seed refs, ideas)
├── src/                       # REQUIRED — the code/artifacts the agent studies & edits
│   ├── <the file(s) to optimize>          # listed in modifiable_files
│   └── <fixed evaluation harness, deps>   # listed in read_only_files
└── setup.sh                   # OPTIONAL — one-time worker setup (install deps, stage data)

What you provide is the project + the code under study. What Auto-Research adds at creation (you never put these in the folder):

  • .claude/skills/ — the AI Researcher's own skills, the knowledge-acquisition (LLM Wiki) skill and the web-search skill, discovered as project skills because the agent runs from the repo.
  • .auto-research/ — the researcher/worker bootstrap, research loop, and logging/dispatch scripts.
  • .claude/settings.json — deny-rules derived from read_only_files (+ auto-research.json), so the agent physically cannot edit protected files.
  • report/status.md — the live research status the web app renders (the agent keeps it current).
  • A separate {project}-wiki repo, seeded from the project README.md.
  • CLAUDE.md — always generated by Auto-Research from the README.md brief + the operational rules derived from auto-research.json.

So the committed repo = your upload ∪ Auto-Research-managed skills/scripts/settings.

auto-research.json — the machine-readable spec

auto-research.json holds the structured, machine-read fields: a short display summary, the file lists, and how to run and score one experiment. Everything meant for the researcher to read — the goal, background, seed references, and starting ideas — goes in README.md (see below). The project name, model, budget, training time budget, experiment timeout, and how experiments run (see below) are chosen in the Create New Project form at creation time — not in this file.

Where experiments run. By default the AI Researcher is a small CPU box and each experiment runs on a separate GPU worker that is powered on only for that run (experiment_runner="ec2"). Alternatively, tick "Run experiments locally" to make the researcher itself a GPU instance that runs the experiments (experiment_runner="local", zero workers): the GPU is held for the whole session — no per-experiment capacity waits — at the cost of paying for it while it sits idle between experiments. Each mode maps to a sub-agent skill (run-ec2-experiment / run-local-experiment).

Field Meaning
description One-line summary shown in the projects list + project homepage (not the full brief — that's README.md).
modifiable_files Files the agent may edit (e.g. ["src/train.py"]).
read_only_files Files the agent must not edit → become .claude/settings.json deny-rules.
evaluation_command How to run one experiment. It must write a JSON result file (metrics.json) — see the result contract below — and typically also redirects console output to run.log.
metric_name / metric_direction The objective and whether lower_is_better / higher_is_better.

The result contract (metrics.json)

Each run's evaluation_command must write metrics.json (next to run.log) that Auto-Research reads to score the experiment — no fragile log parsing:

{
  "metric": 0.004067,        // REQUIRED — the value of metric_name (number)
  "peak_vram_mb": 1240.5,    // OPTIONAL — peak GPU memory used
  "status": "ok",            // OPTIONAL — "ok" | "invalid" (constraint violated → metric is a penalty)
  "metrics": { "aux": 1.2 }, // OPTIONAL — secondary metrics for the ledger / wiki
  "notes": "…"               // OPTIONAL — freeform (e.g. why it was invalid)
}

Write it from the read-only evaluation harness (a read_only_files entry) so the agent cannot fabricate the score. If metrics.json is absent or invalid, the run has no metric and is treated as a crash — there is no fallback.

README.md — the researcher's brief

The project README.md is the main way to pass information to the researcher: it is committed to the repo, inlined into the agent's auto-generated CLAUDE.md, and used to seed the wiki. Put the goal, background/context, seed references (papers, links), and starting experiment ideas here, in prose. There is no required structure — the agent reads the whole file.

Rules of thumb

  • Keep it small. Upload source, config, and small seeds only. Do not upload data, checkpoints, .venv, .git, or caches — setup.sh regenerates data on the worker. (The uploader enforces a 64 MB cap and skips those paths. Folders over ~3 MB are uploaded straight to S3 via a presigned URL, so they are not limited by the API Gateway/Lambda request-body size.)
  • src/ holds what's under study. modifiable_files is what the agent edits; everything else in src/ is protected read-only.
  • setup.sh runs once on the worker's first boot (from the repo root) to install deps and stage inputs onto EBS so they survive stop/start.

See demos/circle-packing/ for a complete worked example.


How it runs (once a project is created)

  • The AI Researcher (a small CPU instance, m8g.large (Graviton/arm64) by default) runs a loop: read the wiki + status + past results, design one experiment, dispatch a run-experiment sub-agent, learn from the result, update the wiki + status, repeat. It reads everything it needs from the conventions above (auto-research.json, the skills, the wiki) — which is exactly why any conforming project just works.
  • The run-experiment sub-agent owns one GPU worker per experiment: it starts the worker (default 1 × g4dn.xlarge; size up to a g5/g6 or a p5.4xlarge H100 for heavier demos), SSHes in, runs and debugs the experiment within the time budget, stops the worker, and reports back. The GPU is on only while an experiment runs.
  • Observability: the web app streams the AI Researcher and each experiment sub-agent in real time, renders the live status report with charts, and lets you browse the wiki, code, and data. Full logs are archived to S3 and linkable per project and per experiment.

Deployment

Deploying Auto-Research stands up the control plane only (DynamoDB, S3, Cognito, HTTP API + Lambdas, CloudFront, a VPC security group + SSH keypair). It is cheap and creates no GPU — the GPU worker (default g4dn.xlarge) is only created (STOPPED) when you create a project, and only starts while an experiment runs. Everything is reversible with cdk destroy.

0. Prerequisites

Tooling (local):

  • AWS CLI v2, authenticated to the target account (aws sts get-caller-identity should succeed).
  • Python 3.11+, Node 18+, and the AWS CDK CLI v2 (npm i -g aws-cdk).

Account (one-time):

  • Deploy region — defaults to us-east-1 (best GPU capacity + Bedrock inference-profile availability), but you can deploy to any region your account supports. Pick one and export AWS_REGION=<your-region> for the whole session; every command below reads $AWS_REGION.
  • Bedrock model access enabled in your deploy region for the model id used in your project's auto-research.json (the demos use a Claude Opus 4.8 inference profile, us.anthropic.claude-opus-4-8). Bedrock console → Model access.
  • GPU quota + capacity for the worker — needed to create/start a project, not to deploy the control plane. The default worker is a g4dn.xlarge (NVIDIA T4) — the cheapest, most readily-available GPU instance; it only needs the standard Running On-Demand G and VT instances vCPU quota in your deploy region (Service Quotas → Amazon EC2). Heavier projects can use a g5.xlarge/g6.xlarge (24 GB) worker, or a p5.4xlarge (H100): for the latter, request the p5 On-Demand vCPU quota ("Running On-Demand P instances") and secure capacity via an On-Demand Capacity Reservation or an EC2 Capacity Block for ML — p5.4xlarge is scarce, so arrange it ahead of time.

1. Deploy the control plane

cd aws-auto-research
export AWS_REGION="${AWS_REGION:-us-east-1}"   # your deploy region; us-east-1 is the default
./scripts/deploy.sh

deploy.sh is idempotent and does the whole thing: bundles the skills + bootstrap scripts into the create_project Lambda (package_lambdas.sh), creates a local Python venv and installs the CDK deps, bootstraps the environment if needed, cdk deploy --all, and stores the API URL in SSM (/auto-research/api-url). It prints the dashboard URL, the API URL, and the SSM path of the worker SSH private key. First run takes ~10–15 min (CloudFront).

Manual equivalent (what the script runs), if you prefer step-by-step:

bash scripts/package_lambdas.sh
cd infrastructure && python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt
cdk bootstrap "aws://$(aws sts get-caller-identity --query Account --output text)/$AWS_REGION"
cdk deploy --all --require-approval never

2. Create a dashboard user

export AWS_REGION="${AWS_REGION:-us-east-1}"
./scripts/add_user.sh <username> <password>

Creates a Cognito user with a permanent password (password policy: ≥8 chars, upper/lower/digit/symbol). (You can also create users directly in the Cognito user pool via the AWS console or cognito-idp.)

Budgets. Every user starts with a $0 budget and cannot create a project until a budget administrator grants them budget (on the User page — the username link in the top nav). Make a user a budget administrator by setting is_budget_admin = true on their AutoResearch-Users row; that user can then fund themselves and others. Creating a project reserves its maximum budget from the creator's balance; deleting the project refunds the unspent part.

3. Deploy the web app

export AWS_REGION="${AWS_REGION:-us-east-1}"
./scripts/deploy_ui.sh

Reads the stack outputs into user-interface/.env.local, npm run builds the React app, syncs it to the UI S3 bucket, and invalidates CloudFront. Prints the dashboard URL. Open it and log in with the user from step 2.

4. Run a project

  1. Create New Project → set a project name (unique per run; every resource is prefixed with it, so you can run the same demo again under a new name without deleting earlier runs) → set a project budget (> $1 and within your available budget — it is reserved from your budget on Create) → keep the default compute (m8g.large researcher, 1 × g4dn.xlarge worker) → upload a bootstrap folder that fits it (e.g. demos/circle-packing/ or demos/california-housing/; size the worker up for heavier projects) → Create. (Only the project owner can delete it; owners can add admins via the project's Team tab.)
  2. The project page shows provisioning progress live (a streamed step-by-step feed while repos are created, files committed, and instances launched). Provisioning is async — the page never just hangs. If it fails (e.g. no GPU capacity), the project shows provision_failed with a clear error and a Delete button; any instances it created are rolled back automatically (no orphans). Fix the cause (attach GPU capacity or choose a g5/g6 worker) and create again.
  3. When it reaches setup (nothing spending yet), review the generated repo if you like, then press Start.
  4. Watch the update stream, the research status (with charts), the growing wiki, and per-experiment sub-agent logs.
  5. Press Stop to end the session — this stops the researcher and the GPU worker, so nothing keeps spending.

5. Teardown

Per project (created at runtime, not by CDK): use the Delete button in the UI, or call DELETE /projects/{id} (the delete_project Lambda) — it terminates the instances, deletes the {project}-code/{project}-wiki repos and the log group, and clears the S3 prefix + DB rows.

Whole deployment:

export AWS_REGION="${AWS_REGION:-us-east-1}"
cd infrastructure && source .venv/bin/activate
cdk destroy --all

Note: the data bucket has RemovalPolicy.RETAIN (it is not deleted by cdk destroy) so results survive; empty/delete it manually if you want it gone.

Troubleshooting

  • Wrong region. The scripts default to us-east-1 but honor $AWS_REGION. Whatever region you deploy to, use the same one for every step — the stacks, SSM param, and UI env must all target it. If your shell default points elsewhere, export AWS_REGION=<your-deploy-region> first.
  • cdk bootstrap / lookup errors. The stack looks up the account's default VPC in your deploy region; ensure one exists there (aws ec2 describe-vpcs --region "$AWS_REGION" --filters Name=isDefault,Values=true).
  • Project won't start / p5 capacity error. Only happens if you chose a p5.4xlarge worker — it's GPU quota/capacity (step 0), not the control plane. Use the default g4dn.xlarge (or a g5/g6 worker), or attach a Capacity Reservation for the H100.
  • CodeCommit. The code/wiki repos use AWS CodeCommit; the instance role and viewer Lambdas assume it. Your account must be able to create CodeCommit repositories.

Repository layout

aws-auto-research/
├── README.md              # ← this file: main user documentation + conventions
├── design.md              # architecture & contributor guide (how the system is built)
├── demos/                 # ready-to-upload bootstrap directories (e.g. circle-packing/, tsp-tsplib/)
├── researcher/            # the AI Researcher: bootstrap, loop, skills (canonical sources)
│   └── .claude/skills/    #   the agent's skills (incl. knowledge-acquisition, web-search)
├── worker/                # GPU worker bootstrap
├── infrastructure/        # AWS CDK app: DataStack, AuthStack, ComputeStack, ApiStack, WebAppStack
│   └── lambda/            #   control-plane Lambdas (create_project, start/stop_session, logs, viewers)
├── user-interface/        # React + Cloudscape web app
└── scripts/               # deploy.sh, package_lambdas.sh, add_user.sh, deploy_ui.sh

Cost & safety

The expensive GPU is on only while an experiment runs; all reasoning happens on the cheap CPU instance with the GPU worker stopped. Guardrails: a guaranteed worker stop on sub-agent exit, a worker-side shutdown watchdog, a per-project budget_usd cap, a per-user budget (a user can only create projects up to the budget an administrator granted them), and a Stop button that halts all compute. Verify current pricing for your chosen worker instance in your deploy region before long runs.

What counts against the budget. spent_usd = Claude (Bedrock) usage of every agent invocation + the researcher instance's running time + every worker's running time, all metered automatically (see the design doc, Cost metering). EC2 rates are resolved for your deploy region; Claude usage is priced from token counts at Bedrock list price with the ~10% geographic-profile premium. EBS, S3 and CloudWatch are not included. Claude is typically the largest item.


Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

About

Autonomous AI Researcher on AWS: give it a research problem and it loops hypothesize → run experiment on GPU → learn → repeat, using Claude Code on Amazon Bedrock, with a compounding LLM Wiki and a web dashboard. Deployed with AWS CDK.

Resources

Code of conduct

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages