Logo: Retrosynthesis

Retrosynthesis

Organisatioun
K-Dense-AI
retrosynthesis

Plan synthetic routes and judge whether a proposed molecule can actually be made, using AiZynthFinder's Monte-Carlo tree search over template-derived reactions and a purchasable building-block stock. Use this skill to configure expansion and filter policies, choose a stock file, run route search over a candidate set, and read the returned trees — solved fraction, route depth, and which building blocks a route bottoms out in. Also trigger on AiZynthFinder, retrosynthetic tree search, synthetic accessibility, SAscore, RAscore, building-block stock, reaction template, or route scoring.

Add to TypingMind

Iwwersiicht

EditeurK-Dense-AI
Repositorydrug-discovery-agent-skills
Skill-Nummretrosynthesis
Stären
51
Forks
5
Matgeliwwert Dateien
5
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 5 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    K-Dense-AI huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Retrosynthesis an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/K-Dense-AI/drug-discovery-agent-skills/tree/main/skills/retrosynthesis
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/K-Dense-AI/drug-discovery-agent-skills.git /tmp/drug-discovery-agent-skills
mkdir -p .claude/skills
cp -r /tmp/drug-discovery-agent-skills/skills/retrosynthesis .claude/skills/retrosynthesis
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Retrosynthesis an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Retrosynthesis automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Retrosynthesis net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Retrosynthetic Planning

The Make half of design-make-test-analyse, and the check that a proposed molecule is more than a picture. AiZynthFinder runs Monte Carlo tree search over reaction templates until every leaf of a route is something you can buy.

Tool: AiZynthFinder 4.4.1, MIT. pip install aizynthfinder — Python 3.10–3.12 only, it will not install on 3.13. Then download_public_data <dir> for models and a ZINC stock (several GB). CPU is sufficient. Checked against: 4.4.1, December 2025.

Read references/aizynthfinder-setup.md before your first run, references/synthesizability-scores.md when triaging more molecules than you can search, and references/route-quality.md before acting on a route — that one is judgement, not syntax.

The two scripts

ScriptAnswers
aizynth_config.pyWhat does the config look like, and are the model files really there?
route_report.pyWhat fraction is makeable, in how many steps, from what?

The stock file is the answer

This is the thing to get right. A target is solved when every leaf of a route is in your stock file — so "solved" is a statement about the stock at least as much as about the molecule.

StockSolved fraction
small in-house inventorylow; reflects what you can start today
ZINC (the default download)moderate; a public baseline
eMolecules / commercialhigh
Enamine building blockshigh; what a REAL-space campaign should use

A solved fraction quoted without naming the stock is meaningless — the same molecule is solved against eMolecules and unsolved against a cupboard. route_report.py says so on every run.

Configuration changed at version 4

Version 3 took bare lists of file paths; version 4 takes typed blocks. Every tutorial older than 2024 shows the incompatible form, and the resulting error is unhelpful.

bash
python skills/retrosynthesis/scripts/aizynth_config.py config \
    --model uspto_model.onnx --templates uspto_templates.csv.gz \
    --filter-model uspto_filter_model.onnx --stock zinc:zinc_stock.hdf5 > config.yml
python skills/retrosynthesis/scripts/aizynth_config.py check --config config.yml
yaml
expansion:
  uspto:
    type: template-based
    model: uspto_model.onnx
    template: uspto_templates.csv.gz

check verifies every referenced file exists, because AiZynthFinder discovers a missing model after the run starts. It also warns when a config looks like the version-3 form.

Always set a filter policy. Without one the search proposes reactions the expansion model likes but that do not work, and the solved fraction stops measuring anything.

Budget before you start

time_limit is per target. At the 120 s default, ten molecules is twenty minutes and ten thousand is nearly two weeks. Use aizynthcli --nproc 8 to parallelise across targets.

Reading the result

bash
python skills/retrosynthesis/scripts/route_report.py summary --output out.json.gz
python skills/retrosynthesis/scripts/route_report.py routes --output out.json.gz
# 1/1 solved (100.0%)
targets       1
solved        1
median_steps  2

target  route  steps  starting_materials  leaves_in_stock  score
TARGET  0      2      3                   3                0.95

Step count matters more than existence — yields multiply, so five steps at 70% is 17% overall, and past about six steps a route is rarely run as written. route_report.py flags those.

blocks counts how many routes share each starting material. If twenty targets converge on three intermediates, the campaign is cheap; that is a different and more useful fact than the solved fraction.

Unsolved does not mean unmakeable

It means no route was found within the time and depth limits, using these templates, terminating in this stock. Four distinct fixes, and working out which applies is the useful step: raise the time limit, raise max_transforms, broaden the stock — or accept that the chemistry is not in USPTO templates.

That last case is systematic. Template models only know reactions in their training corpus, so novel methodology, photoredox, electrochemistry, and enzymatic steps are largely invisible.

Four ways this misleads

  1. A solved route is a proposal, not a validated synthesis. The templates come from reactions that worked on other substrates; nothing here knows your chemoselectivity or protecting-group needs.
  2. Convergent beats linear at equal step count. Overall yield depends on the longest linear sequence, so read the tree shape, not just its depth.
  3. Where the disconnections sit matters more than step count for a series. A route that decorates late gives analogues from a common intermediate; one that installs the variable group first needs a full resynthesis each time.
  4. Pre-filtering with RAscore inflates the solved fraction, because RAscore is trained to predict AiZynthFinder's own verdict. Fine as a pipeline, misleading as a statistic — report the pre-filter.

Triage at scale

Route search is seconds to minutes per molecule; scores are microseconds. For a generated library: SAscore or RAscore across everything, full search on the survivors, and a chemist reading the routes for the handful you will actually order. The honest hierarchy is SAscore < RAscore < route search < a chemist's opinion < the compound in a vial, and each step right is more expensive and more real.

Composing with the rest of the bundle

  • generative-design → here: the essential check, since nothing in a REINVENT objective knows what can be made. Better still, add SAscore as a scoring component during the run.
  • chemical-space → alongside: if it is already purchasable, you do not need a route.
  • medchem → before: no point routing molecules that fail structural alerts.
  • admet-prediction → alongside: makeable and developable are different filters.

Reporting results honestly

Name the stock, always. Give solved fraction and median step count — 90% solved at nine steps is worse than 60% at three. State the time and depth limits, since unsolved is partly a statement about them. And say plainly that a proposed route is a hypothesis no chemist has yet reviewed.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Retrosynthesis?

Plan synthetic routes and judge whether a proposed molecule can actually be made, using AiZynthFinder's Monte-Carlo tree search over template-derived reactions and a purchasable building-block stock. Use this skill to configure expansion and filter policies, choose a stock file, run route search over a candidate set, and read the returned trees — solved fraction, route depth, and which building blocks a route bottoms out in. Also trigger on AiZynthFinder, retrosynthetic tree search, synthetic accessibility, SAscore, RAscore, building-block stock, reaction template, or route scoring.

Firwat Retrosynthesis op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Retrosynthesis besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Retrosynthesis an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/K-Dense-AI/drug-discovery-agent-skills/tree/main/skills/retrosynthesis an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Retrosynthesis benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Retrosynthesis benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Retrosynthesis domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Retrosynthesis gratis?

Jo. K-Dense-AI huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇