ClawCures
Disease-campaign orchestration that separates planning from execution:
- OpenClaw plans through
/v1/responses. refua-mcpexecutes typed scientific tools, with built-inweb_search/web_fetchfor evidence collection.
What You Get
- Single-run planner/executor flow.
- Autonomous planner/critic loop with policy checks.
- Offline plan validation and dry-run modes.
- Portfolio ranking for disease-program prioritization.
- Structured
promising_curesoutput with full ADMET property maps and assessment text.
Requirements
- Python
>=3.11,<3.14(Python3.14+is not supported byrefua-mcp). - A running OpenClaw Gateway if you want live planning.
- Optional:
refua-mcpruntime dependencies for tool execution.
Quick Start
- Install
cd /path/to/ClawCures
python3.13 -m venv .venv
source .venv/bin/activate
pip install -e .
- Configure OpenClaw access
- Set your gateway URL with
REFUA_CAMPAIGN_OPENCLAW_BASE_URL. - Ensure OpenClaw
responsesendpoint is enabled. - Provide auth with one of:
REFUA_CAMPAIGN_OPENCLAW_TOKENOPENCLAW_GATEWAY_TOKENOPENCLAW_GATEWAY_PASSWORD(for password mode)
- Run an offline smoke test (no OpenClaw call)
ClawCures run \
--objective "Offline validation" \
--plan-file examples/plan_template.json \
--dry-run
- Simplest live invocation (all-disease cure mission)
ClawCures run
ClawCures run now loops continuously by default (--max-cycles 0) until you stop it.
To run a single cycle and exit, use --max-cycles 1.
In loop mode, memory is preserved automatically by reusing a stable session key, enabling OpenClaw response storage, and carrying concise cycle summaries forward into subsequent planning objectives.
By default, ClawCures run sets the objective to:
"Find cures for all diseases by prioritizing the highest-burden conditions and researching the best drug design strategies for each."
If planner JSON generation fails repeatedly (common on small local models), ClawCures now auto-attempts repair passes and then falls back to a deterministic all-disease bootstrap validation plan.
For all-disease objectives, this fallback now includes deterministic web_search target-discovery queries before validation calls.
- Run a live planning dry-run
ClawCures run \
--dry-run
Environment Variables
| Variable | Default | Purpose |
|---|---|---|
REFUA_CAMPAIGN_OPENCLAW_BASE_URL |
http://127.0.0.1:18789 |
OpenClaw Gateway base URL |
REFUA_CAMPAIGN_OPENCLAW_MODEL |
openclaw:main |
OpenClaw model/agent ID |
REFUA_CAMPAIGN_TIMEOUT_SECONDS |
180 |
API timeout |
REFUA_CAMPAIGN_OPENCLAW_TOKEN |
unset | Bearer token override |
OPENCLAW_GATEWAY_TOKEN |
unset | Gateway token fallback |
OPENCLAW_GATEWAY_PASSWORD |
unset | Password-mode fallback token |
REFUA_CAMPAIGN_SESSION_KEY |
unset | Optional stable OpenClaw user key for cross-turn memory |
REFUA_CAMPAIGN_STORE_RESPONSES |
unset | Optional bool (true/false) for OpenClaw response storage |
REFUA_CAMPAIGN_AGENT_MODEL_MAP_JSON |
unset | Optional JSON object for phase/domain model routing (e.g. {"planner:oncology":"openclaw:oncology-planner","critic":"openclaw:critic"}) |
BRAVE_API_KEY |
unset | Optional key for higher-quality web_search results |
CLAWCURES_ALLOW_PRIVATE_WEB_FETCH |
unset | Set true to allow web_fetch against localhost/private IPs |
CLI Commands
| Command | What it does |
|---|---|
ClawCures print-default-prompt |
Print bundled mission prompt |
ClawCures list-tools |
Show available execution tools (refua-mcp + web tools) |
ClawCures run ... |
Continuous planner + execution loop (--max-cycles 0 default) |
ClawCures run-autonomous ... |
Planner/critic multi-round loop |
ClawCures validate-plan ... |
Policy-check a local JSON plan |
ClawCures rank-portfolio ... |
Rank disease programs from JSON input |
Common Usage
Run one plan + execute cycle:
ClawCures run \
--max-cycles 1 \
--output artifacts/kras_campaign_run.json
Run with OpenClaw native function calling (no intermediate JSON plan parsing):
ClawCures run \
--max-cycles 1 \
--native-tool-loop \
--session-key mission-all-disease-v1 \
--store-responses \
--stream \
--native-discovery-bootstrap-rounds 2 \
--auto-web-fetch \
--agent-model-map-json '{"planner:oncology":"openclaw:oncology-planner","critic":"openclaw:critic"}' \
--evidence-file docs/RESEARCH.md \
--output artifacts/native_tool_loop_run.json
The run JSON now includes:
promising_cures: ranked therapeutic candidates extracted from tool outputspromising_cures_summary: aggregate counts and ADMET coverageinteresting_targets: web-derived disease target hypotheses ranked by evidence densityinteresting_targets_summary: aggregate counts and top target list
Each cure includes:
metrics(binding/admet/affinity/potency signals)admet.key_metrics(admet_score,safety_score,adme_score,rdkit_scorewhen available)admet.properties(full ADMET scalar property map from discovered outputs)assessment(risk/opportunity summary)
Offline autonomous policy check:
ClawCures run-autonomous \
--objective "Offline policy check" \
--plan-file examples/plan_template.json \
--dry-run
Rank programs:
ClawCures rank-portfolio \
--input examples/portfolio_input.json
Release Packaging
Build and validate release artifacts in a version-specific directory:
./scripts/build_release_artifacts.sh
Upload only from that release directory (not from dist/*):
python -m twine upload dist/release-<version>/*
OpenClaw Compatibility
Verified against official OpenClaw docs and latest stable release v2026.2.15 (released 2026-02-16):
- API interface:
POST /v1/responses - Request fields used by this project:
model,input,instructions - Auth model:
Authorization: Bearer ...token/password - Endpoint behavior note: OpenClaw currently ignores
metadatafor prompt construction, so this project does not rely on metadata for critic payloads
Primary references:
- https://docs.openclaw.ai/openapi/openapi/responses_api/
- https://docs.openclaw.ai/openclaw/faq/
- https://github.com/openclaw/openclaw/releases/tag/v2026.2.15
Troubleshooting
connection refusedto/v1/responses- OpenClaw Gateway is not running or
REFUA_CAMPAIGN_OPENCLAW_BASE_URLis wrong.
- OpenClaw Gateway is not running or
401or auth errors- Token/password env var is missing or mismatched with gateway auth mode.
requires a different Python: ... not in '<3.14,>=3.11'- Use Python
3.11,3.12, or3.13.
- Use Python
Notes
- Tool plans are strict JSON for reproducibility.
- All tool calls go through a strict allowlist.
web_searchandweb_fetchare included in the allowlist for target/evidence discovery.web_fetchblocks localhost/private-network targets by default for safety.--native-tool-loopuses OpenClaw function calls directly, executing tools turn-by-turn.--session-key+--store-responseswire OpenClaw session memory across campaign turns.--streamrequests OpenClaw streaming responses;--stream-to-stderrmirrors streamed deltas to stderr.--agent-model-map-file/--agent-model-map-jsonenable disease/phase agent routing.--evidence-fileinjects local literature text into OpenClaw input for evidence-grounded planning.--native-discovery-bootstrap-roundsforces early native-loop rounds to web discovery tools only (web_search,web_fetch).--auto-web-fetchfollows discovered web_search URLs with bounded web_fetch calls for richer target evidence.--native-tool-fail-fastdisables recoverable tool-error feedback and fails immediately on tool exceptions.- Mission framing is aspirational; never claim cures without evidence.
- For local-model reliability, planner output is auto-repaired and canonicalized (
args/tool aliases) before execution. ClawCures rundefaults to an infinite loop. Use--max-cycles 1for a single cycle.- Loop mode carries forward compact cross-cycle memory (prior findings, failures, and state hints) to reduce repeated work.
- Architecture details:
docs/ARCHITECTURE.md - Research notes:
docs/RESEARCH.md
Metadata
Release files for ClawCures 0.7.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| clawcures-0.7.3.tar.gz | 71.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clawcures-0.7.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 136.2 kB
Release files / clawcures-0.7.3.tar.gz
| Download URL | clawcures-0.7.3.tar.gz |
|---|---|
| Size | 71.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18ad98e6393c2bf8799e89d56ef06eba057cf842c75336a5b725e6bcbb5d672d
|
|
BLAKE2b-256 checksum How to use checksums |
0a01f458987baafb95a254d06582a941eba7bae3164f147b732fb0a6eaf7805a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.0 CPython/3.14.4 Darwin/25.4.0
|
Release files / clawcures-0.7.3-py3-none-any.whl
| Download URL | clawcures-0.7.3-py3-none-any.whl |
|---|---|
| Size | 64.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
518bdeec81fab36a439d0a909e3ab1b19258f6b5972fb79dac57ccc9b2cdafe6
|
|
BLAKE2b-256 checksum How to use checksums |
22bd0a29564d23d9077f5a91f0cdee2e35e8aecc808bb341e980dec74663a347
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.4.0 CPython/3.14.4 Darwin/25.4.0
|
Security for ClawCures 0.7.3
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.