RFC: optional add-ons for reproducibility, token cost, and cross-run memory (happy to PR in small pieces)
Author: matiasmolinasCreated Jun 8, 2026Updated Jun 9, 2026
Hi, and thanks for AI-Scientist-v2. We've been running it and built a set of optional, default-off add-ons in a fork, and would like to know whether you'd be open to upstreaming some of them as small, independent PRs before we send anything.
Fork: https://github.com/EvolvingAgentsLabs/AI-Scientist-v2 (the full design doc lives in UPGRADE_PLAN.md).
Motivation
Running v2 we hit four recurring pain points (consistent with the README's own notes on v2's open-ended, lower-success-rate nature):
- Reproducibility — a successful experiment is hard to reproduce exactly (temperature, the exact code+reasoning that produced it).
- Token cost — the improve/debug loop re-sends the full experiment script each iteration.
- Backtracking — when a debug branch hits a dead end there's no clean "restore the last good state."
- No memory across runs — each run re-learns the same failures (e.g. "this optimizer/lr diverges on this data").
What we built (each is opt-in via config; with flags off, the pipeline is byte-for-byte unchanged; each has offline unit tests)
Ranked by how self-contained they are (easiest to review first):
| # | Add-on | New deps? | Surface area |
|---|---|---|---|
| A | strict-patch editing — in the improve step the model emits a line-precise patch instead of a full rewrite; deterministic applier with safe fallback to full code. ~10x fewer output tokens on large files. | none | ai_scientist/dialects/, one branch in parallel_agent._improve, flag agent.code.patch_mode |
| B | discipline-aware reviewers — infer the paper's field and tailor the reviewer persona (numerical-stability / statistical-rigor / proof-rigor / physical-correctness lenses). Additive wrapper over perform_review. |
none | ai_scientist/reviewers/ |
| C | measurement harness — scripts/measure_run.py reports $/run, tokens/stage, buggy-vs-good, debug-depth, from the artifacts a run already writes. |
none | new script + a token-summary dump in save_run |
| D | role-isolated improve pipeline — Researcher (frontier) → Coder (small/local) in separate contexts, so a mid-size/local model can do the mechanical coding cheaply. | none | ai_scientist/pipeline/ |
| E | cross-run "lab memory" — an offline pass distills durable axioms (successes/failures/constraints) from past journals into an append-only wiki that future runs pull into their prompts. | none | ai_scientist/dream/, flag use_lab_memory |
| F | multidimensional VCS of the search tree — each BFTS node becomes a commit of (code + hypothesis + models + trace); the best node is "frozen" into a deterministic, replayable recipe shippable as supplementary material; real rollback. | optional dep on agentvcs (separate OSS project), soft-imported and fail-safe |
ai_scientist/agentvcs_bridge.py, hooks in journal.py/agent_manager.py/config.py, flag agentvcs.enabled |
What we're asking
- Would you accept any of A–E as small standalone PRs? They add no dependencies and default to off.
- F is the most opinionated and carries an optional dependency on a separate project of ours; we'd only propose it if there's interest, and would keep it strictly opt-in. Totally fine if it stays in our fork.
We'll open one PR per item, each branched off main, minimal diff, with tests. Happy to adjust scope/naming to your conventions. Thanks!
Source: SakanaAI/AI-Scientist-v2