MCPcopy Create free account
hub / github.com/beita6969/ScienceClaw

github.com/beita6969/ScienceClaw @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
27,372 symbols 105,233 edges 6,250 files ⚖ MIT 1,261 documented · 5% ● updated 6d ago★ 1,0332 open issues

Browse by type

⨍ Functions 26,379◇ Types & classes 983↳ Endpoints 10
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ScienceClaw

Skills and Operators that grow from replay-verified executions.

arXiv:2610.08691 Website Benchmark data on Hugging Face GitHub stars License

Quick start  ·  How it works  ·  Results  ·  Gateway  ·  Benchmark  ·  Paper  ·  Design

Overview of ScienceClaw

ScienceClaw-Eval spans 23 disciplines across the natural and social sciences, while ScienceClaw turns verified execution evidence into persistent Skill–Operator program updates.

23

disciplines across the natural and social sciences

+16.45 %

mean out-of-distribution gain over the frozen agent

98.23 %

of instances pass every scientific hard constraint

91.30

OOD macro success rate after seven rounds (from 77.72)

ScienceClaw is an agent system for scientific work that gets better the more it is used. It solves each task as a typed, executable workflow. When a repair is reproduced under a clean replay, it becomes a linked Skill (strategy) and Operator (a typed, executable capability), and it is kept only if it still solves its source task and improves independent validation tasks.

[!NOTE] This repository is the agent system, built on the OpenClaw gateway. Its companion benchmark, ScienceClaw-Eval, keeps its evaluation data on Hugging Face.

✨ Highlights

Idea In practice
An evolving program What evolves is a versioned program of Skills (decomposition, workflow construction, recovery) and typed Operators with explicit input, output and domain contracts.
Typed, executable workflows Ports carry a schema of type, shape, unit and provenance. Nodes are fingerprinted, so an edit reruns only what it affects.
Evidence you can replay Every result is regenerated from a reset environment and checked against the task's hard scientific constraints.
Linked Skill–Operator updates A reproduced repair becomes a strategy patch and a typed capability, committed together. No LLM judge is needed to form, rank or select candidates.
A gate, not a guess An update persists only if source replay reproduces it and uses it, and independent validation tasks strictly improve within budget.
You stay in control Updates are versioned snapshots that you promote, and that you can roll back.

🚀 Quick start

git clone https://github.com/beita6969/ScienceClaw.git
cd ScienceClaw

# One-click setup: Node, Python, the engine, its tools and weights, MCP servers, skills
chmod +x setup.sh && ./setup.sh

Manual installation

pnpm install && npx openclaw onboard
pip install -e packages/scienceclaw          # Python >= 3.11; extras: [all], vision, audio, nlp, forecast, materials, retrieval
python -m scienceclaw.cli setup              # install and verify every tool and pretrained weight (--profile light skips assets > 1.5 GB)
python -m scienceclaw.cli doctor             # which tool modules can run on this machine, and why not

The engine refuses tasks until setup has completed (SCIENCECLAW_SKIP_SETUP_CHECK=1 is for development only), and the full profile downloads about 19 GB of weights. setup.sh runs it for you; SCIENCECLAW_SKIP_TOOLS=1 defers it to first use.

[!TIP] Bring your own model. The engine never assumes a model family and this repository names none. Point it at any OpenAI-compatible endpoint, a local program, or your own backend:

bash export SCIENCECLAW_API_BASE_URL=<your OpenAI-compatible endpoint> export SCIENCECLAW_API_KEY=<your key> export SCIENCECLAW_MODEL=<your model name> # or SCIENCECLAW_<POLICY|EXECUTOR|PATCH>_MODEL per role

llm.backend can also be command (a local program reads the prompt and writes the completion) or package.module:factory. See configs/default.yaml.

🧠 How it works

The problem

LLM agents increasingly solve scientific tasks by connecting reasoning to data, domain tools and executable code. But a repair that works once rarely survives: it lives in a transient context, or in a single tool or prompt, so verified executions seldom become persistent improvements. Existing work evolves individual tools or Skills, and existing benchmarks treat tasks as independent episodes, so it has been hard to tell whether verified scientific executions turn into persistent, transferable improvements.

How can verified scientific executions drive persistent and transferable program-level self-evolution without updating foundation-model parameters?

Task formulation

Task formulation of verifiable program-level self-evolution for AI-for-Science agents.

The answer: replay-gated, linked Skill–Operator evolution

1. A task for program-level self-evolution. The model Θ₀ is fixed. What evolves is an editable program A_r = (Skills, Operators). A task D_t = (D_T, D_V, D_E) specifies its objective and inputs, its evaluation protocol and hard constraints (units, feasibility, convergence, reproducibility), and its data, tools and environment.

2. Typed, execution-guided workflows. A solution is a directed graph whose ports carry a schema (type, shape, unit, provenance); an edge is valid only if types and shapes match and any unit conversion is explicit and recorded. The agent edits the graph one atomic action at a time, and the executor checkpoints every node by fingerprint and reruns only the affected descendants, so a long scientific workflow is repaired rather than regenerated.

3. Evidence you can replay. Every candidate result is regenerated from a reset environment and checked against the task's evaluator and hard constraints. A replay that fails and a later replay that passes bracket the shortest reproduced repair, e⁻ → e⁺. Replay alone never authorizes persistence.

4. Linked Skill–Operator candidates, with no LLM judge. The reproduced repair is split by edit type. Control edits (topology, routing, configuration) become a Skill patch. Generated or repaired executable nodes are grouped into convex components and abstracted into typed Operators, each checked by boundary replay in isolation. Both are committed as one atomic bundle, so a strategy never arrives without the capability behind it, nor a capability without a strategy that selects it.

5. A replay-and-validation gate. A candidate persists only if source replay reproduces the repair and actually uses every new component (R_src = Pass ∧ Use), every hard integrity and scientific check holds on independent validation tasks, its cost stays within budget, and it strictly improves the validation score over the incumbent. A noise guard requires at least two improved and at most one regressed validation episode. Otherwise the incumbent program is kept.

Definition and overview of the ScienceClaw task

Given task specification D_t and agent program A_r, ScienceClaw produces scientific solution Z_t and retains a candidate update only after source-task replay and independent program validation.

📊 Results

Seven evolution rounds over a common stream of 23 disciplines, with 64 IID and 64 OOD instances per discipline, one fixed foundation model, and the same tools, source stream, validation data and update budget throughout. OOD means an independently sourced dataset of the same discipline; OOD results never generate or select updates.

  • Consistent gains. ScienceClaw improves on the frozen agent in every discipline: +16.45 % on average out-of-distribution (+11.57 % to +23.34 %) and +12.25 % in-distribution. Its OOD score falls 11.73 % below its IID score on average, against 16.06 % for the frozen agent.
  • It keeps improving. The OOD macro success rate rises from 77.72 to 91.30 over seven rounds (+13.59 pp). 70 of 161 submitted candidates are promoted (43.48 %), so the gate is selective without stalling.
  • It transfers and retains. 18 of 20 cross-family pairs transfer positively (mean +1.58 pp, against +14.69 pp within a family). Average forgetting is 0.13 pp (maximum 0.51 pp), with 11.89 % negative transfer.
  • It is reliable. Hard constraints pass on 98.23 % of instances and only 1.23 % of promotions are erroneous.
  • The linkage and the gate are what matter. Committing Skills and Operators separately keeps only 60 % of the gain; removing Operator evolution keeps 59 %. Without independent IID selection only 15 % remains; without scientific constraints, source replay or the independent validator, 46 %, 55 % and 59 %.
  • Execution structure is the base. The full system runs 4.84 planner rounds and 4.24 distinct Operators per task, repairs 71 % of failures from feedback, recovers 89 % after interruption and replays 96 % cleanly (a single-turn agent: 0 %, 31 %, 78 %).

Ablation heatmap across 23 disciplines

Mean of IID and OOD task-native scores of the ablation variants across 23 disciplines. Colours are normalised within each discipline (darker is better); the two groups follow higher-is-better and lower-is-better metrics.

Linked mechanism, workflow mechanics, reliability and cost, and promoted candidates

(f) Gain over the frozen agent (%) of the linked-mechanism variants on Commerce (MASE) and Law (mAP). (g) Workflow mechanics: planner rounds, distinct Operators, Operator diversity, feedback repair, checkpoint recovery and clean replay. (h) Hard-constraint pass rate against cost per OOD gain (ScienceClaw = 1), coloured by planner wall-time share. (i) Promoted candidates and promotion rate.

Per-discipline scores: ScienceClaw against the frozen agent

Task-native scores, compared only within a discipline (metrics differ in units and direction); arrows give the direction of "better". Gains are the relative improvement in the better direction, computed from the rounded scores shown.

FoR Discipline (metric) Frozen IID ScienceClaw IID Gain Frozen OOD ScienceClaw OOD Gain
30 Agricultural sci. (PQ+) ↑ 69.4761 76.9612 +10.77 % 64.6829 75.7629 +17.13 %
31 Biological sci. (Spearman) ↑ 0.5057 0.5816 +15.01 % 0.3745 0.4234 +13.06 %
32 Biomedical sci. (DSC) ↑ 0.7816 0.8556 +9.47 % 0.7088 0.8226 +16.06 %
33 Built env. (NRMSE %) ↓ 51.0997 45.0065 +11.92 % 53.5009 45.0970 +15.71 %
34 Chemical sci. (ROC-AUC) ↑ 0.6518 0.7545 +15.76 % 0.6205 0.7478 +20.52 %
35 Commerce (MASE) ↓ 1.6009 1.4653 +8.47 % 1.8740 1.5986 +14.70 %
36 Creative arts (SDR (dB)) ↑ 8.9208 10.1867 +14.19 % 8.0993 9.5619 +18.06 %
37 Earth sci. (RMSE (K)) ↓ 1.0562 0.9721 +7.96 % 1.1364 0.9580 +15.70 %
38 Economics (sMAPE (%)) ↓ 12.7394 11.3320 +11.05 % 18.1343 15.5025 +14.51 %
39 Education (10-mask acc.) ↑ 0.5965 0.6878 +15.31 % 0.6202 0.7087 +14.27 %
40 Engineering (DCASE score) ↑ 0.5709 0.6535 +14.47 % 0.4663 0.5269 +13.00 %
41 Environmental sci. (CRPS) ↓ 0.8104 0.7164 +11.60 % 0.6504 0.5751 +11.58 %
42 Health sci. (Clin. utility) ↑ 0.4971 0.5514 +10.92 % 0.6834 0.7796 +14.08 %
43 History (cMER-micro) ↓ 0.0185 0.0166 +10.27 % 0.0296 0.0251 +15.20 %
44 Human society (nRMSE) ↓ 0.0113 0.0100 +11.50 % 0.0213 0.0181 +15.02 %
45 Indigenous (chrF++) ↑ 15.4451 17.4351 +12.88

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 23,901
Method 2,478
Class 783
Interface 184
Struct 14
Route 10
Enum 2

Languages

TypeScript90%
Python6%
Kotlin5%
Go1%

Modules by API surface

src/memory/qmd-manager.ts94 symbols
apps/android/app/src/main/java/ai/openclaw/app/voice/TalkModeManager.kt86 symbols
src/discord/monitor/agent-components.ts73 symbols
extensions/zalouser/src/zalo-js.ts71 symbols
src/discord/components.ts67 symbols
src/tui/tui.ts59 symbols
src/discord/monitor/native-command.ts58 symbols
src/auto-reply/reply/export-html/template.js58 symbols
src/agents/subagent-registry.ts57 symbols
skills/open-notebook/scripts/test_open_notebook_skill.py57 symbols
src/agents/tools/web-search.ts55 symbols
apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt55 symbols

Datastores touched

proseDatabase · 1 repos
myprojectDatabase · 1 repos
neondbDatabase · 1 repos

For agents

$ claude mcp add ScienceClaw \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page