Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ScienceFlow

An End-to-End Autoresearch Agent Framework

Project News · Paper (arXiv) · Chinese

ScienceFlow is an end-to-end autoresearch agent framework for productive, stable, and goal-aligned research over hours or days. It organizes research around recoverable executable workspaces, coupling persistent state, adaptive exploration, and evidence-aware execution control so agents can continue, redirect, or recover without losing validated progress.

ScienceFlow documentation uses iqcraft as the short name for InquiryCraft. Package, import, and CLI examples continue to use the canonical inquirycraft name.

Across machine learning, scientific modeling, and mathematical optimization, ScienceFlow sustains effective long-horizon research and reaches 70.22 ± 1.18% Any-Medal on the full 75-task MLE-bench within a 24-hour budget, exceeding the strongest reported baseline by 4.92 percentage points.

Representative full MLE-bench Any-Medal leaderboard

Figure 1a. Full MLE-bench Any-Medal leaderboard. Mean ± SEM over three independent runs for ScienceFlow.

News

  • [2026-09] The testing preview is available on the preview branch for integration testing and feedback.
  • [2026-08] ScienceFlow is open source — the framework code, task packages, and documentation are available in this repository.
  • [2026-08] The ScienceFlow paper is available on arXiv.

Core concepts

  1. Recoverable executable state. Each persistent LNR worker advances research in an isolated executable workspace. An archived state binds that workspace to compact memory, validation evidence, and resource records.
  2. Stage Gate. A task-specific result signal invokes GateService: the configured Evaluator produces normalized evidence, and the Gate policy decides admission. An accepted result materializes an immutable Stage with ledger facts and a recoverable workspace snapshot.
  3. ESTRA. At a research boundary, Executable-State Transition through Re-Anchoring makes a two-axis decision: a start point (the current workspace or an archived Stage) and an intent (continue or redirect). Selecting an archived start point restores its executable state before the next research segment.
  4. Persistent memory. Add records accepted Stage progress. Fold keeps recent, best-validated, and anchor-relevant evidence explicit while summarizing older records; Unfold/restore retrieves indexed evidence and state, and Assemble constructs the anchor-specific context for the next segment.
  5. Evidence-aware execution control. Research workers choose scientific routes, while the controller admits, leases, monitors, timeboxes, and stops physical jobs using resource availability, remaining budget, validated progress, and recoverability. Valid worker states are finalized under merge/finals/final_*.

System architecture

ScienceFlow system architecture

Figure 2. ScienceFlow system architecture. Research workers operate over recoverable executable states and adapt long-horizon trajectories through boundary-triggered ESTRA transitions, while evidence-aware execution control coordinates physical resource allocation and runtime execution.

Design boundaries

  • LNR is no-skill by default: lnr_skill_tool_enabled: false and lnr_skill_auto_read: false.
  • .scienceflow/skills/data_processing/ is retained only for the dedicated data-prep agent and validation-split workflow.
  • auto is the default evaluator backend and resolves registered tasks to task_package; artifact_command remains available for generic command-based evaluation.
  • Parallel runs bind CPU/GPU resources at task level, then split CPU capacity across workers. GPU leases support controlled sharing by multiple workers.
  • Result signals may create Stages without a submission when the task contract permits it. Merge can only emit finals from candidates that carry the required artifact.

Repository layout

ScienceFlow/
├── scienceflow/                         # Framework package
│   ├── agent/                           # InquiryCraft host ports, construction, and sessions
│   ├── foundation/                      # Architecture rules, typed config, and contracts
│   │   ├── architecture/                # Executable dependency and size policies
│   │   ├── config/                      # LLM/runtime/schema config and packaged profiles
│   │   └── contracts/                   # Stable cross-domain values
│   ├── research/                        # Research-domain decisions and persistent state
│   │   ├── control/                     # Admission, ESTRA, execution-value, and resources
│   │   ├── quality/                     # Assessment, Evaluator, Gate, and finalization
│   │   ├── solver/lnr/                  # Long-horizon solver, split into five responsibilities
│   │   │   ├── lifecycle/               # Stage, workspace, records, and snapshots
│   │   │   ├── orchestration/           # Coordinator and worker execution
│   │   │   ├── resources/               # Resource feedback and physical runtime
│   │   │   ├── support/                 # Context and prompt support
│   │   │   └── transitions/             # ESTRA, resume, and recovery
│   │   └── state/                       # Dataset, knowledge, and workspace state
│   ├── runtime/                         # Physical execution and operational boundaries
│   │   ├── core/                        # Kernel, process, stage, and shared runtime support
│   │   ├── observability/               # Agent I/O, monitoring, correlation, and traces
│   │   ├── safety/                      # Agent, shell, process, and resource safeguards
│   │   └── parallel/                    # Task scheduling and subprocess execution
│   ├── interfaces/                      # User-facing adapters
│   │   ├── cli/                         # Command composition
│   │   └── ui/                          # Read-only monitor and trace presentation
│   └── cli.py                           # Stable `python -m scienceflow.cli` entry point
├── tasks/                               # Task packages and evaluators
├── scripts/                             # Five canonical manifests and two lifecycle launchers
├── tools/                               # Architecture, contract, and parity developer tools
├── .scienceflow/skills/data_processing/ # Data-preparation skills
└── docs/                                # Public docs, architecture, plans, benchmarks, and evidence

The package root is intentionally limited to five ownership namespaces: foundation, agent, research, runtime, and interfaces. Foundation defines stable contracts and configuration; research owns policy and recoverable state; runtime owns physical effects, safety, and observation; agent and interfaces adapt external interaction. InquiryCraft remains behind typed ports in scienceflow/agent, so ScienceFlow policy does not leak into the generic agent runtime. The default fan-out limit at every depth is five immediate subdirectories and five direct business modules (__init__.py excluded). A small number of cohesive product surfaces have explicit path-specific ceilings; increases require review in tests/test_leaf_package_structure_v5_2.py rather than changing the global default.

Install and run

Requirements: Python 3.11+ and uv.

InquiryCraft 0.9.0 is published on the public package index and pinned by the ScienceFlow lock file. Create the source environment directly from the reviewed dependency set:

cd ScienceFlow
uv sync --python 3.12 --group dev
source .venv/bin/activate

The Light runtime without test dependencies uses uv sync. The Full profile is uv sync --extra full --group dev.

Create the private model registry once, edit it, and start the TUI:

scienceflow config init
scienceflow config path
scienceflow tui --workspace /path/to/workspace

The default registry is ~/.config/scienceflow/models.json with mode 600. Use --model-config PATH to test another registry. API keys stay in the registry and are not copied into manifests, sessions, or reports. See model configuration.

Activation is per shell. To expose this checkout without activation, ensure ~/.local/bin is on PATH and create a user-level link:

mkdir -p ~/.local/bin
ln -sfn "$PWD/.venv/bin/scienceflow" ~/.local/bin/scienceflow
scienceflow tui --workspace /path/to/workspace

ScienceFlow embeds InquiryCraft as its sole generic Agent Runtime; no second process is required. Useful entry points are:

scienceflow agent tools list
scienceflow repl
scienceflow parallel -m scripts/lnr.yaml -j 1
scienceflow monitor --manifest scripts/lnr.yaml --refresh 5
scienceflow web --workspace /path/to/workspace

After the preview package is published, install the exact pre-release version from PyPI. Pinning the version prevents a test environment from changing when a later preview is released. Container and Compose usage lives in deploy/README.md.

pip install scienceflow==0.2.0b3
pip install "scienceflow[full]"==0.2.0b3

Configuration essentials

Setting Purpose
lnr.num_workers Number of persistent research workers inside one task.
task.cpu_list / task.gpu_list Task-level CPU and GPU resource boundaries; LNR further splits CPU across workers.
lnr.omp_threads_cap CPU thread cap for each worker slice.
lnr.wall_clock_budget_sec Total wall-clock budget for the LNR process.
lnr.estra_enabled / estra_trigger_stage_count Enables ESTRA and sets the trigger for boundary review and context folding.
lnr.resource_runtime_enabled Enables evidence-aware resource and execution control.
resume_budget_policy Budget accounting for resumed runs; fresh adds this round's time_limit on top of accumulated time.
evaluator.backend Selects auto (default), task_package, or artifact_command.
evaluator.stage_source_mode Selects the shadow, adjudicate, or primary Stage source mode.
evaluator.command.python_executable Points a task at an isolated Python environment.
profile_overrides.<profile> Overrides prompts, Evaluator, and resource behavior per task type.
tasks/**/task.yaml Declares the task-level artifact, metric, provider/profile, Evaluator, and Gate policy.
metric.authoritative: true Marks a metric as authoritative evidence eligible for high-trust selection.

Documentation

Documentation index · Architecture overview · Recoverable states and LNR · Evidence-aware execution control · Adding optimization tasks · Current plans · SciModelingBench

Paper task coverage

The paper evaluates the same ScienceFlow workflow across three classes of executable research tasks:

All task families share the Stage Gate and Evaluator contract. Each task.yaml keeps provider/profile, artifact schema, evaluator backend, authoritative status, and Gate policy outside the generic solver. MLE-bench tasks may leave metric direction open for the runtime to resolve from task, stage, and evaluation evidence.

TUI and managed research

scienceflow tui starts a new chat session by default; add --resume to restore the latest session for the same workspace. Ordinary text uses InquiryCraft's Agent Runtime. The main ScienceFlow commands are:

Command Purpose
/models Select the chat model and show the registry path.
/long-research DESCRIPTION Prepare a task, confirm resources and models, preflight, and launch it.
/tasks, /status N List tasks or inspect one persistent task number.
/stop N, /resume N, /attach N Control or attach to a research task.
/research-usage N, /resources Show model usage/cost or host and running-task resources.
/web, /web stop Start or stop the workspace Web monitor.

Closing the TUI detaches from supervised research; it does not stop workers. Chat cancellation also does not stop research—use /stop. Managed-run records live under ~/.local/state/scienceflow/managed_runs/, while chat sessions live under <workspace>/.scienceflow/sessions/.

/resources keeps each starting or running task on one line. Stopping tasks are hidden, but their reservations remain excluded from Available until the processes release them.

The CLI exposes the same lifecycle when a full-screen terminal is not wanted:

scienceflow run circle-packing --tui --workspace /path/to/experiment
scienceflow status --all
scienceflow stop RUN_ID
scienceflow resume RUN_ID --tui

Do not resume a workspace with a different task profile, dataset, prompt, or artifact contract. MLE-bench additionally requires the data root, exp_id, and submission.csv contract to agree. Model pricing is optional and lives only in models.<alias>.pricing; missing prices display Cost — rather than silently using a built-in estimate.

The Web monitor shows task status, workers, metric history, Stage lineage, ESTRA/EEC, usage, and final reports. See Web monitor behavior for local and SSH access.

Verification

Run tests through the active development environment against the pinned, published InquiryCraft 0.9.0 package:

.venv/bin/pytest -q \
  tests/test_inquirycraft_dependency_boundary.py \
  tests/test_inquirycraft_cli_composition.py \
  tests/test_long_research_interaction.py

The release workflow accepts only a version-matching tag, builds and checks the wheel and source distribution, installs the wheel in a clean runner, and reruns the public dependency contracts before publishing through PyPI Trusted Publishing. The full regression command is uv run --locked pytest -q. Optional ML, GPU, MLE-bench, and scientific-design tests require their corresponding extras.

Metadata

Release files for scienceflow 0.2.0b3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scienceflow 0.2.0b3
File Size Uploaded Provenance Actions
scienceflow-0.2.0b3.tar.gz 1.9 MB With provenance Details for scienceflow-0.2.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scienceflow 0.2.0b3
File Interpreter ABI Platform Actions
scienceflow-0.2.0b3-py3-none-any.whl Python 3 none any Details for scienceflow-0.2.0b3-py3-none-any.whl

Total release size: 3.9 MB

Release files / scienceflow-0.2.0b3.tar.gz

Download URL scienceflow-0.2.0b3.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
34b0b795ab8ebcc17d21dcbf6b3b71c8f80eb0948731b2fb6be7510268988a88
BLAKE2b-256 checksum
How to use checksums
760b89afeb186089959fe07317f890103f5fe501bc64aeb4c7ec4874c7b00f35
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Release files / scienceflow-0.2.0b3-py3-none-any.whl

Download URL scienceflow-0.2.0b3-py3-none-any.whl
Size 2.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6d7d8661af5ea0d3bbe302098f57191192ba68d3cd1ca9e840b2d196e0d7b211
BLAKE2b-256 checksum
How to use checksums
dc566c5e245f5440f6743b2ab8252b2d8651500b6d3359586e0aa4d2a0e3fb09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

Security for scienceflow 0.2.0b3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scienceflow-0.2.0b3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page