Retrosynthesis logo

Retrosynthesis

Organization
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.

Overview

PublisherK-Dense-AI
Repositorydrug-discovery-agent-skills
Skill nameretrosynthesis
Stars
51
Forks
5
Bundled files
5
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 5 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by K-Dense-AI on GitHub. Read the source before you install it.

Installation

Install the Retrosynthesis AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/K-Dense-AI/drug-discovery-agent-skills/tree/main/skills/retrosynthesis
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

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
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Retrosynthesis in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Retrosynthesis on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Retrosynthesis is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Retrosynthesis AI skill do?

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.

Why use Retrosynthesis on TypingMind?

Because you install it once and use it with any model. Retrosynthesis is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Retrosynthesis in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/K-Dense-AI/drug-discovery-agent-skills/tree/main/skills/retrosynthesis. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Retrosynthesis?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Retrosynthesis?

As many as you like. As long as a model supports skills, you can use Retrosynthesis with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Retrosynthesis AI skill free?

Yes. It is published on GitHub by K-Dense-AI under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇