Refua is the open-source toolkit behind AgentCures. It combines structure prediction, affinity scoring, generative design, and ADMET utilities in one Python-first package.
Drug discovery is hard enough without closed tooling. Open code lets teams verify results, reuse methods, and build faster from shared work. Open science improves speed and trust when researchers can inspect and reproduce the full workflow.
Refua was built to make practical ML tools available to more labs, not only well-funded groups. We want the same core capabilities to be available to biotechs, academics, and independent researchers.
Refua is a drug discovery toolkit that combines structure prediction, affinity modeling, and generative design in one package. It brings together the Boltz inference stack for protein–ligand complex folding with the BoltzGen design pipeline for de novo molecular generation, plus small-molecule analytics, ADMET profiling, and interactive 3D visualization, giving you everything you need from target definition to candidate generation.
Build specs, run predictions, and post-process results with a readable, composable API. There is no need to stitch together CLI calls, YAML, or intermediate files.
Keep a predictor instance alive and run many inferences in a loop without paying initialization and checkpoint-loading cost each time. This matters for high-throughput virtual screens.
Prepare inputs, run inference, and perform analysis entirely in memory without writing temporary files to disk. Ideal for notebook-driven research and cloud pipelines.
From structure prediction to binding affinity to ADMET profiling and generative design, one unified package replaces a patchwork of disconnected tools.
Interactive 3D molecular viewers, 2D structure renderings, and color-coded ADMET dashboards display inline in any Jupyter notebook, powered by the Refua Notebook extension.
Support for up-to-date PyTorch, CUDA, and scientific Python libraries.
A single pip install refua gets you started; optional extras
add GPU acceleration.
Refua ships six tightly integrated modules. Each can be used standalone or composed into multi-step workflows.
Boltz-2 predicts 3D structures for protein–ligand, protein–protein, and protein–nucleic-acid complexes from sequence alone. It supports small-molecule ligands, covalent modifications, and multi-chain assemblies.
The Refua wrapper provides a fluent builder pattern:
define proteins by sequence, add ligands by SMILES, attach constraints,
and call .fold() to obtain an all-atom 3D structure plus
per-residue confidence scores, all without leaving Python.
BoltzGen is the design counterpart to Boltz-2. Given a target and structural constraints, it can sample peptide binders, antibody CDR loops, and linker sequences for downstream evaluation.
Refua exposes BoltzGen through the same composable API. You can specify chain lengths, add cyclic-peptide constraints or template insertions, and generate sequences ready for downstream affinity scoring and ADMET profiling.
The SM class wraps a SMILES string and computes a comprehensive panel of
molecular descriptors, including molecular weight, LogP, topological polar surface area (TPSA),
hydrogen-bond donors and acceptors, rotatable bond count, and Lipinski rule-of-five
compliance backed by RDKit. Properties can be evaluated lazily on first access or
eagerly with to_dict().
SM integrates with the ADMET module for full drug-likeness profiling and with SmilesView for instant 2D depictions inside notebooks.
ADMET (Absorption, Distribution, Metabolism, Excretion, and Toxicity) often determines whether a molecule can become a drug. Refua’s ADMETView widget takes a dictionary of predicted properties (LogP, Caco-2 permeability, hERG inhibition, AMES mutagenicity, bioavailability, plasma protein binding, and more) and renders a color-coded dashboard with optimal / warning / danger thresholds derived from medicinal-chemistry guidelines.
Supported categories span absorption (LogP, Caco-2, solubility, HIA, PAMPA), distribution (PPBR, VDss, BBB penetration), metabolism (clearance, half-life), excretion (P-gp substrate), and toxicity (hERG, AMES, DILI, LD50, carcinogenicity).
MolstarView embeds the Mol* molecular visualization framework directly inside Jupyter notebooks. Load structures from Binary CIF (the compact format produced by Boltz-2), PDB files, or public RCSB URLs. The viewer renders publication-quality 3D representations with interactive rotation, zoom, ligand highlighting, and surface display with no external software required.
Combined with Boltz-2, researchers can fold a complex and visualize it in a single cell, enabling rapid hypothesis testing and visual inspection of predicted binding poses.
The Complex class orchestrates multi-component assemblies. Combine proteins,
small molecules, nucleic acids, and covalent modifications into a single specification, then
fold the entire assembly with Boltz-2 and request binding-affinity predictions like IC50,
Kd, and binding probability in one fluent call chain.
ComplexView renders the result as an interactive 3D scene annotated with affinity metrics, component labels, and confidence scores. It is useful for team presentations and notebook reports.
pip install refua
For NVIDIA GPU support:
pip install "refua[cuda]"
from pathlib import Path
from refua import Binder, Complex, Protein, SM
target = Protein(
"MSEQNNTEMTFQIQRIYTKDISFEAPNAPHVFQQLAGKYTPEEIRNVLSTLQKAD",
ids="A",
)
# Protein + ligand -> Boltz2 structure + affinity
result = (
Complex([target, SM("Cn1cnc2n(C)c(=O)n(C)c(=O)c12")], name="demo")
.request_affinity()
.fold()
)
Path("complex.bcif").write_bytes(result.to_bcif())
print(result.affinity.ic50, result.affinity.binding_probability)
# Protein + binder placeholder -> Boltz2 structure + BoltzGen design inputs
binder = Binder(length=12, ids="P")
result = Complex([target, binder], name="design").fold()
Path("design.bcif").write_bytes(result.to_bcif())
print("binder spec:", binder.sequence)
Refua ships with practical examples covering common drug discovery workflows.
Refua is completely open source and welcomes contributions from researchers worldwide. By making these tools freely available, we aim to broaden access to modern drug discovery methods.
Whether you are at a major pharmaceutical company, a small biotech startup, or an academic lab with limited resources, Refua gives you the same powerful capabilities. Science should not be limited by budget.
Refua is more than a single toolkit. It is a complete open-source ecosystem of interoperable packages covering every stage of the drug discovery lifecycle, from data curation to cloud deployment.
An autonomous AI agent that works until it finds a cure to every disease. Plans and executes full discovery campaigns via OpenClaw.
Explore ClawCuresWeb control plane for planning, running, and monitoring discovery campaigns with a built-in mission control UI and drug portfolio view.
Explore StudioMCP server that exposes strict, typed Refua tools for protein folding, affinity prediction, and generative design to any AI assistant.
Explore MCPPK/PD-driven virtual patient simulation and adaptive clinical trial design with Bayesian optimization and protocol recommendation.
Explore ClinicalCurated dataset catalog with 25+ drug-discovery datasets, intelligent caching, and parquet materialization for modeling workflows.
Explore DataBuild verifiable regulatory evidence bundles with end-to-end lineage across plans, tool calls, models, datasets, and generated artifacts.
Explore RegulatoryGenerate GPU-aware cloud deployment bundles for Kubernetes and Compose across 18 public and private cloud providers.
Explore DeployBenchmark and regression-gate tooling with statistical gating, baseline registries, and adapter-based model evaluation.
Explore BenchJupyter and IPython extensions for rich drug discovery visualizations including 3D molecular structures, ADMET dashboards, and SMILES drawings.
Explore NotebookStart with Refua, run the examples, and adapt the pieces you need for your own programs. Contributions and issue reports are welcome.