Skip to content

ChazenLi/Rachel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rachel

Formalized chemical reasoning for multi-step retrosynthesis

Python 3.10+ Active Research Multi-Step Retrosynthesis Workflow LLM Strategy Layer

Trace Demo | End-to-End Example | Highlights | Selected Molecules | Quickstart

trace.mp4

Rachel treats retrosynthetic planning as a structured state -> action -> validation -> commit process rather than a one-shot text generation task. The current repository is an active research codebase being cleaned up for arXiv-facing presentation while remaining in day-to-day use.

Trace Demo

The trace above is a visual walkthrough of the Rachel planning workflow from structured state to a committed retrosynthetic route.

trace_final
  • The trace is meant to show planning behavior, not only final route output
  • It is the fastest way to see how Rachel moves from context to sandboxed candidates to validated commitment

End-to-End Example

The figure below shows a full route-level comparison between a PaRoutes ground-truth plan and Rachel's generated result on case n1_366.

n1_366_groundtruth_vs_rachel_annotated_case_en

This example is included as a qualitative systems-level reference point. The point is not only whether a single step looks chemically plausible, but whether the route remains interpretable and structurally coherent at the full planning level.

Highlights

Capability What it means in Rachel
Stateful planning Rachel reasons over persistent session state instead of isolated one-shot answers.
Grounded operator space Bond disconnection and FGI are treated as complementary planning operators.
Sandbox before commitment Candidate steps are tried locally before they affect the main route tree.
Validation-gated execution Feasibility checks, atom balance, and related validators help control commitment.
Structured route memory Accepted steps become explicit route-tree objects rather than only free-form text.
LLM as strategy layer The LLM helps organize search and choice, rather than acting as an unchecked chemistry oracle.

What Rachel Is

Rachel combines:

  • a session-driven planning workflow
  • chemistry-grounded operators such as bond disconnection and FGI
  • sandboxed local trials before route commitment
  • validator-gated route construction
  • route-tree memory and audit state

The goal is not just to propose a route, but to make route construction inspectable, recoverable, and chemically checkable.

Core Workflow

flowchart LR
    A["Current State"] --> B["Candidate Action"]
    B --> C["Sandbox Trial"]
    C --> D["Validation"]
    D --> E["Commit or Reject"]
    E --> F["Updated Route Tree"]
Loading

Candidate actions are explored before they are written into the route. Validated steps move forward into the main tree; rejected attempts remain informative planning artifacts rather than disappearing into free-form text.

Selected Molecules

Rachel is currently showcased with three qualitative examples chosen to cover complementary strengths.

QNTR
QNTR
Losartan
Losartan
Rivaroxaban
Rivaroxaban
Molecule Role Route depth What it highlights
QNTR Experimentally grounded example 6 steps A interpretable route tied to real synthesis experience
Losartan Canonical medicinal chemistry target 4 steps Convergent route logic with recognizable medicinal chemistry disconnections
Rivaroxaban Deeper drug-like example 5 steps Longer-horizon planning with a broader transformation mix

QNTR

An experimentally grounded molecule connected to my own synthesis experience. This is a truly flurescence probe that target the NO2-reduction probe and I finished the whole chemical synthesis process, the condition optimization. We both choose to split the target molcular into three main part as using the same terminal mols, same intermediate and reaction.
Even though the first version of Rachel has the mistake and did fgi-action not that good, the ring close/open also not that easy to predict and run synthesis map before experiments without refs in reality. The whole route and design strategy did make me excited. This was also truly an important reason that I began to make it a more chemical-feasible system.

My route

1878e5777ea5c79edce765660331f35d

Early version Rachel's route

synthesis_tree - 副本

Rachel's route

synthesis_tree
  • Short 6-step route from 4 starting materials
  • Useful as a compact demonstration of interpretable planning
  • Especially valuable because the accepted route reflects strategy beyond simple template satisfaction

Losartan

A canonical medicinal chemistry target with a recognizable convergent route.

  • 4-step route from 4 starting materials
  • Highlights tetrazole formation, N-alkylation, and Suzuki coupling logic
  • Useful as a benchmark-like example that many readers can immediately interpret

Rivaroxaban

A deeper drug-like example with a richer transformation mix.

  • 5-step route from 4 starting materials
  • Highlights Buchwald-Hartwig amination, FGI, cyclization, and amide formation
  • Useful for showing that Rachel is not limited to short or purely toy routes

Dual Drug-Case Comparison

The figure below places the Losartan and Rivaroxaban examples into one annotated comparison view. It gives the README a more complete qualitative picture of how Rachel behaves on two recognizable drug-like targets with different route depths and transformation profiles.

rivaroxaban_losartan_dual_annotated_en

Taken together, these two cases make the contrast especially clear:

  • Losartan emphasizes classical convergent medicinal chemistry logic
  • Rivaroxaban emphasizes deeper route depth and operator diversity
  • The pair helps readers compare route style, not just isolated outcomes

Minimal Quickstart

Current local runs assume a Python environment with the main research dependencies already available, including Python 3.10+, RDKit, numpy, and Pillow.

from Rachel.main import RetroCmd

cmd = RetroCmd("my_session.json")

cmd.execute(
    "init",
    {
        "target": "CC(=O)Nc1ccc(O)cc1",
        "name": "Paracetamol",
        "terminal_cs_threshold": 1.5,
    },
)

ctx = cmd.execute("next")

cmd.execute(
    "try_precursors",
    {
        "precursors": ["CC(=O)Cl", "Nc1ccc(O)cc1"],
        "reaction_type": "Schotten-Baumann acylation",
    },
)

cmd.execute(
    "commit",
    {
        "idx": 0,
        "reasoning": "Acylation with simple, accessible precursors.",
        "confidence": "high",
    },
)

This is a protocol-level example, not a full benchmark workflow. More technical notes are preserved in usage notes.

Repository Map
  • main: orchestration, session logic, route tree, reports, and command interface
  • chem_tools: chemistry-grounded operators and validation utilities
  • tools: helper scripts for runs, analysis, visualization, and related research workflows
  • tests: current validation and experiment-support material

Project Status

  • Active research codebase
  • Currently being prepared for arXiv-facing presentation
  • Documentation is being cleaned up, but the repository remains under active use
  • Core workflow is already in use
  • Not yet a fully hardened OSS release

About

This is a program which allow LLM finish the de novo synthesis works or retro-synthesis analyze works. You can use this in any IDE to do the retro-map design work.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors