PƒPPrompts for Progress
← All recordscampaign
Mixed campaignchemistry · synthetic chemistry and laboratory automation

ACRA converts literature procedures into robotic syntheses

ACRA generated executable procedures from published chemistry, completed several physical syntheses, and preserved a failed reaction that a chemist also could not reproduce without substantial changes.

OutcomeMixed campaign
EvidenceExperimental
Modeexperimental loop
Promptfull

Preserved artifact

Approved to publish

Prompt corpus

ACRA synthesis-agent prompt bundle · Sebastian Pagel, Michael Jirasek, Leroy Cronin, and collaborators

Original source ↗
procedure extractionambiguity detectionhuman clarificationXDL generationcritique and repair
The source repository separates ACRA's workflow across several prompt templates. The complete local bundle preserves each template as code so placeholders and output contracts remain visible.

========================================

SOURCE FILE: sources/acra-synthesis-reproduction/procedure_prompt.py

system_prompt = """
You are an expert synthetic chemist specialized in making chemical synthesis procedures
unambiguous and reproducible. You will be given a chemical synthesis procedure and you
will be asked to identify the key components of the procedure. You will also be asked
to identify any potential issues. You will have to identify all chemicals used in the
procedure, and all ambiguities stopping one from executing the procedure. So it is important
that you can map out the procedure and give physical exactness to the procedure. For
example, exact amounts, exact times, exact temperatures, exact pressures, and steering speeds.
This is important because the procedure is executed like a computer program, so each step
has certain arguments and conditions that must be exactly assigned.
If you have to make any best guesses (for amounts, times, etc.), make sure you 
make your decision based upon the other values (amounts, volumes, etc...) provided in the procedure.
"""

raw_procedure_prompt = """
This is the procedure paper you are working on:
``` {procedure} ```

Commonly found ambiguities in chemical synthesis procedures are:
```{ambiguities} ```

Additionally here are some examples of ambiguous language and their solutions from previous procedures that you might find helpful:
``` {previous_ambiguities} ```

Please do the following:
    1. Identify all chemicals used in the procedure.
        - Include the chemical name, amount, and unit.
        - If the name is not in english, please translate it to english.
        - Only include the chemical names, and strip any extra information (e.g. "anhydrous" or "dry" or "soluion", or "concentration", etc.)
        - do not extract chemical if their name is unspecific like "reagent A", "Aldehyde 1", "Ketone 5", "reagent B", "compound A", "A", "5d", "1a" etc.
    2. Identify all potential hazards in the procedure.
        - This includes physical and chemical harms, environmental hazards, and
          safety concerns.
        For example: - High pressure - Air sensitive reagents - Toxic reagents -
        Etc.
    3. Identify all ambiguities you think you can resolve yourself. Use the
       ambiguity library and provided examples to resolve ambiguities as well as
       your reasoning capabilities (guesses for physical values should always depend on the procedure and the amount, conditions, etc used).
        - ambigious or unclear language, and ambiguous or unclear steps.
        - missing information
        - unclear conditions (e.g. temperature, pressure, time, etc.)
        - unclear amounts (e.g. stoichiometry, equivalents, drops, etc.)
        - ambigious steering speeds
    4. Write down all ambiguities that you CAN NOT resolve yourself/lines where
       the order of execution is unclear. Even after consulting the ambiguity
       library and provided examples, you are still unsure about the meaning of
       the line.
        - this concerns lines where you are not sure about the order of execution
            or the meaning of the line.
        - this also concerns lines where you are not sure if an error is present
            in the representation of the procedure.

Respond in the following valid json format: ``` {response_format} ```
"""


raw_procedure_paper_prompt = """
This is the procedure you are working on:
``` {procedure} ```

Commonly found ambiguities in chemical synthesis procedures are:
```{ambiguities} ```

Additionally here are some examples of ambiguous language and their solutions from previous procedures that you might find helpful:
``` {previous_ambiguities} ```

Please do the following:
    1. Identify all chemicals used in the procedure.
        - Include the chemical name, amount, and unit.
        - If the name is not in english, please translate it to english.
        - Only include the chemical names, and strip any extra information (e.g. "anhydrous" or "dry" or "soluion", or "concentration", etc.)
        - do not extract chemical if their name is unspecific like "reagent A", "Aldehyde 1", "Ketone 5", "reagent B", "compound A", "A", "5d", "1a" etc.
    2. Identify all potential hazards in the procedure.
        - This includes physical and chemical harms, environmental hazards, and
          safety concerns.
        For example: - High pressure - Air sensitive reagents - Toxic reagents -
        Etc.
    3. Identify all ambiguities you think you can resolve yourself. Use the
       ambiguity library and provided examples to resolve ambiguities as well as
       your reasoning capabilities (guesses for physical values should always depend on the procedure and the amount, conditions, etc used).
        - ambigious or unclear language, and ambiguous or unclear steps.
        - missing information
        - unclear conditions (e.g. temperature, pressure, time, etc.)
        - unclear amounts (e.g. stoichiometry, equivalents, drops, etc.)
        - ambigious steering speeds
    4. You can query the original paper for additional information.
        Write down questions that should be searched in the original paper. Think about it like a search engine query.
        The question should always contain the context of the procedure and the information you are looking for.
        For example: "What is the general procedure for the synthesis of `product name`?", ...
        - this mostly concerns information that is not present in the procedure, but might be present in the original paper.
    5. Write down all ambiguities that you CAN NOT resolve yourself/lines where
       the order of execution is unclear. Even after consulting the ambiguity
       library and provided examples, you are still unsure about the meaning of
       the line.
        - this concerns lines where you are not sure about the order of execution
            or the meaning of the line.
        - this also concerns lines where you are not sure if an error is present
            in the representation of the procedure.

Respond in the following valid json format: ``` {response_format} ```
"""


clean_system_prompt = """
You are an expert synthetic chemist specialized in making chemical synthesis
procedures unambiguous and reproducible. Previously you were given a chemical
synthesis procedure and you were asked to identify the key components of the
procedure. You were also be asked to identify any potential issues. You have
identified all chemicals used in the procedure, all ambiguities stopping one
from executing the procedure. You will be asked to provide a detailed and clear
explanation of the procedure (as possible with the available data and your
knowledge), making sure all ambiguities are resolved and the procedure is clear
and reproducible. This is important because the procedure is executed like a
computer program, so each step has certain arguments and conditions that must be
exactly assigned. Additionally, you will be asked to classify the procedure into
the following categories: "A": Clear and reproducible, "B": Blueprints for
synthesis, "C": Incomplete and missing information.
If you have to make any best guesses (for amounts, times, etc.), make sure you 
make your decision based upon the other values (amounts, volumes, etc...) provided in the procedure.
"""

clean_procedure_prompt = """
The following information was provided by the user. Always obey the user's information.:
```
{user_request}
```

The procedure was as follows:
```
{procedure}
```

The chemicals used in the procedure are:
```
{identified_chemicals}
```

The ambiguities identified in the procedure are:
```
{identified_ambiguities}
```

Additionally the following ambiguities were resolved by an expert:
```
{ambiguity_library}
```

To resolve the ambiguities feel free to use this knowledge if helpful.
Ambiguities that are typically found in chemical synthesis procedures are:
```
{ambiguities}
```

Additionally here are some examples of ambiguous language and their solutions from previous procedures:
```
{previous_ambiguities}
```

Please do the following:
    1. Make sure everything is in english
    2. Rewrite the procedure to make it clear and reproducible.
       - Only retain the information that is necessary to perform the synthesis.
       - Remove any information that comes after the product of the synthesis is obtained.
    3. Replace all ambiguities with exact conditions, amounts, and times (where you know or can infer them).
       - it is extremely important that you can map out the
              procedure and give physical exactness to the procedure.
       - use the amount specified in the chemicals section to replace any ambiguous amounts if possible
    4. Make sure that amounts of chemicals are in the right format:
        - Amounts of  liquids are specified in a volume unit! 
        - Amounts of solids are specified in a mass unit!
    5. Resolve all ambiguities you have previously identified.
        - it is extremely important that you can map out the
            procedure and give physical exactness to the procedure.
    6. Classify the procedure into the following categories (always obey the user's information):
        - "A": Clear and reproducible (all of the following conditions are met):
            - procedure details steps to perform a chemical reaction.
            - all chemicals are identified with specific chemical names meaning no unresolved placeholders like `A`, `B`, `compound A`, `Ligand A`, `5`, `amine 1`, `aldehyde 1`, etc.
            - all major ambiguities are resolved
            - all conditions are clear and reproducible
            - all amounts available in either mass or volume unit. 
            - None of the amounts are only provided in molars, equivalents, or ratios.
            - this does not include drying-agents or column materials
        - "B": Blueprints for synthesis
            - procedure is a `General Procedure` for a chemical synthesis where some chemical names, conditions, volumes amount, etc. are not specific.
            - chemical names are not specfic. For example numbers or single letters are used instead of chemical names.
                    OR a chemical category (i.e. the ether, or the alcohol, amide, substrate, class ... instead of explicit chemical) is used instead of a specific chemical name.
            - any amount is not in a mass (mg, g, ug, kg, ...) or volume (ml, L, ul, cm3, ...) unit. For example, equivalents, molars (mol, mmol umol, etc), or ratios are used instead of specific amounts.
        - "C": Incomplete and missing information
            - the procedure is missing key information to execute the procedure.
            - OR the procedure is not a chemical synthesis procedure. (This is the case if NO chemical reactions are present, that are physically executed.)
                so for example, simulations, or theoretical procedures are not chemical synthesis procedures.

Before you start note down all changes you make to the procedure and the reasons for the changes.
For example:
1. Changed: "added rapidly" to "added"
   Reason: "added rapidly" is ambiguous and can be interpreted in different ways.
2. Changed: "ambient temperature" to "25°C"
   Reason: "ambient temperature" is ambiguous and can be interpreted in different ways.
3. Changed: 2 mmol to 1.06 g
   Reason: 2 mmol can not be easily measured, so it is better to use the mass of the chemical.


Respond to the following valid json format:
```
{response_format}
```
"""

clean_procedure_prompt_paper = """
The following information was provided by the user. Always obey the user's information.:
```
{user_request}
```

The procedure was as follows:
```
{procedure}
```

Additionally here are relevant sections from the original paper:
```
{paperqa}
```

The chemicals used in the procedure are:
```
{identified_chemicals}
```

The ambiguities identified in the procedure are:
```
{identified_ambiguities}
```

Additionally the following ambiguities were resolved by an expert:
```
{ambiguity_library}
```

To resolve the ambiguities feel free to use this knowledge if helpful.
Ambiguities that are typically found in chemical synthesis procedures are:
```
{ambiguities}
```

Additionally here are some examples of ambiguous language and their solutions from previous procedures:
```
{previous_ambiguities}
```

Please do the following:
    1. Make sure everything is in english
    2. Rewrite the procedure to make it clear and reproducible.
       - Only retain the information that is necessary to perform the synthesis.
       - Remove any information that comes after the product of the synthesis is obtained.
    3. Replace all ambiguities with exact conditions, amounts, and times (where you know or can infer them).
       - it is extremely important that you can map out the
              procedure and give physical exactness to the procedure.
       - use the amount specified in the chemicals section to replace any ambiguous amounts if possible
    4. Make sure that amounts of chemicals are in the right format:
        - Amounts of  liquids are specified in a volume unit!
        - Amounts of solids are specified in a mass unit!
    5. Resolve all ambiguities you have previously identified.
        - it is extremely important that you can map out the
            procedure and give physical exactness to the procedure.
    6. Classify the procedure into the following categories (always obey the user's information):
        - "A": Clear and reproducible (all of the following conditions are met):
            - procedure details steps to perform a chemical reaction.
            - all chemicals are identified with specific chemical names meaning no unresolved placeholders like `A`, `B`, `compound A`, `Ligand A`, `5`, `amine 1`, `aldehyde 1`, etc.
            - all major ambiguities are resolved
            - all conditions are clear and reproducible
            - all amounts available in either mass or volume unit.
            - None of the amounts are only provided in molars, equivalents, or ratios.
            - this does not include drying-agents or column materials
        - "B": Blueprints for synthesis
            - procedure is a `General Procedure` for a chemical synthesis where some chemical names, conditions, volumes amount, etc. are not specific.
            - chemical names are not specfic. For example numbers or single letters are used instead of chemical names.
                    OR a chemical category (i.e. the ether, or the alcohol, amide, substrate, class ... instead of explicit chemical) is used instead of a specific chemical name.
            - any amount is not in a mass (mg, g, ug, kg, ...) or volume (ml, L, ul, cm3, ...) unit. For example, equivalents, molars (mol, mmol umol, etc), or ratios are used instead of specific amounts.
        - "C": Incomplete and missing information
            - the procedure is missing key information to execute the procedure.
            - OR the procedure is not a chemical synthesis procedure. (This is the case if NO chemical reactions are present, that are physically executed.)
                so for example, simulations, or theoretical procedures are not chemical synthesis procedures.

Before you start note down all changes you make to the procedure and the reasons for the changes.
For example:
1. Changed: "added rapidly" to "added"
   Reason: "added rapidly" is ambiguous and can be interpreted in different ways.
2. Changed: "ambient temperature" to "25°C"
   Reason: "ambient temperature" is ambiguous and can be interpreted in different ways.
3. Changed: 2 mmol to 1.06 g
   Reason: 2 mmol can not be easily measured, so it is better to use the mass of the chemical.

Respond to the following valid json format:
```
{response_format}
```
"""


response_format = """
{
    "ambiguities": {"ambiguity1": "solution", "ambiguity2": "solution", ...},
    "unresolved_ambiguities": {"full sentence from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    }, "full sentence from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    }}, # if no unresolved ambiguities, write an empty dictionary
    "chemicals": [[name, amount_used_in_procedure, unit], [name, amount_used_in_procedure, unit], ...], # If no amount is provided in the procedure, write [name, None, None]
    "hazards": [List of potential hazards identified in the procedure. If None, write an empty list],
}
"""

response_format_paper = """
{
    "ambiguities": {"ambiguity1": "solution", "ambiguity2": "solution", ...},
    "unresolved_ambiguities": {
    full sentence from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    }, "full sentence from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    }}, # if no unresolved ambiguities, write an empty dictionary
    "paperqa": ["question 1", "question 2", ...], # write full sentences for questions you want to ask the original paper
    "chemicals": [[name, amount_used_in_procedure, unit], [name, amount_used_in_procedure, unit], ...], # If no amount is provided in the procedure, write [name, None, None]
    "hazards": [List of potential hazards identified in the procedure. If None, write an empty list]
}
"""


response_format_clean_procedure = """
{
    "procedure": "Rewritten procedure",
    "chemicals": [list of chemicals used in the procedure],
    "remaining_ambiguities": [list of remaining ambiguities identified in the procedure. If none, write an empty list],
    "classification": {
        "reasoning": "Reasoning for the classification according to the definitions provided above",
        "classification": "A or B or C",
    }
}
"""

========================================

SOURCE FILE: sources/acra-synthesis-reproduction/ambiguity_prompt.py

system_prompt = """
You are an expert synthetic chemist specialized in making chemical synthesis
procedures unambiguous and reproducible. You will be given a chemical synthesis
procedure and your task will be to ask questions about each step of the
procedure. The purpose of this task is to resolve any ambiguities in the
procedure to make it clearly reproducible. Meaning all steps should have an
obvious and unambiguous interpretation and order etc. Do not ask any chemistry
questions, only ask questions that will help make the procedure reproducible.
"""

ambiguity_prompt = """
This is a chemical synthesis procedure that you need to make unambiguous and reproducible:
{procedure}

Now ask questions about each step of the procedure to resolve any ambiguities.
These can include:
- everything that needs some unit to be performed (e.g. mL, g, etc.)
- unclear conditions (e.g. temperature, pressure, time, etc.)
- unclear amounts (e.g. stoichiometry, equivalents, drops, etc.)
- ambiguous or unlcear order of steps
- and everything else that is unclear or ambiguous

For each step in the procedure, ask at least three question to resolve any ambiguities.
Reply in the following json format:
```
{response_format}
```
"""

response_format = """
{
    "line from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    },
    "line from procedure here": {
    "questions": [
        "question 1",
        "question 2",
        ...
    ]
    },
    ...
}
"""

========================================

SOURCE FILE: sources/acra-synthesis-reproduction/xdl_prompt.py

system_prompt = """
You are an expert in translating synthetic procedure into XDL. This
allows you to execute chemical synthesis procedures in an automated and
unambiguous manner. You will be given a synthetic procedure from
literature containing information about a reaction that was performed. Your task
will be to translate this procedure into XDL, to make it reproducibly
executeable. You will always provide complete answers that do not require further actions.
If you have to make any best guesses (for amounts, times, etc.), make sure you 
make your decision based upon the other values (amounts, volumes, etc...) provided in the procedure.
"""

xdl_prompt = """
XDL Language Description:
```
{steps_description}
```

Here are examples of chemical procedures in synthetic procedure, and the XDL code that was
used to execute the procedures on a robotic platform:
```
{examples}
```

Additional information
In chemistry ambigious language is often used, this can lead to errors and you should be aware of them:
```
{ambiguities}
```

The synthetic procedure from literature to be translated into XDL is:
```
{new_procedure}
```

Additionally, here is some information of the physical properties of the chemicals used in the procedure:
```
{chemicals}
if a solution contains a salt, it is assumed to be dissolved in water unless otherwise stated and the density is 1 g/mL.
```


To respond do the following: ```
   FIRST:
   Extract all chemicals and their roles and amounts from the synthetic procedure.
   This includes reagents, reactants, solvents, catalysts, products, and any other chemicals used in the procedure:
   ```{chemicals_response}```

   THEN:
   Starting from an empty flask, give me step-by-step instructions to execute
   the procedure. Each chemical has to be added in a separate step (i.e. each
   reagent, reactant, solvent, catalyst, product, etc.). Solutions that are mentioned in the procedure (xx g of X in Y (yy ml); or similar) should be 
   prepared explicitly in the procedure. If the mixtures result in a liquid solution you can prepare them in a separate reactor and transfer them subsequently into the main reactor.
   If it will remain a solid, it should be added directly to the main reactor.
   If a solution is processed in a different vessel, it has to be transferred to that vessel.
   first explicitly even if not mentioned in the procedure. This solution should always be stirred for a while to ensure that everything is dissolved!
   The instructions should be in logical order of execution, which can be different from the semantic order in the procedure, in the format:
   {step_by_step_instructions}
   ```

   FINALLY:
      Translate the provided synthetic procedure into XDL. Stricltly follow
      the format of the XDL language. Enclose the XDL code in the <XDl> tag like this:
      ```XDL <XDL> ... </XDL>```

      IF the procedure is not executeable with the available XDL steps, note
      down which steps are not executeable. In this case respond in the
      following format: ```Not executeable <ERROR>
         [EXAMPLES] - Can't execute step 1 because of ...
         - Can't execute step 2 because of ... ...
      </ERROR>
```

Make sure to:
   - Think before you start. Make sure each step is in the logically right order.
   - First decompose the procedure into step-by-step instructions and write it
     down explicitly. Do not assume any solutions have been prepared for you. Each addition has to be done separately.
   - If a chemical/mixture is processed/needed/... in a different vessel it has
     to be transferred to that vessel first! Even if the transfer is not
     mentioned explicitly in the procedure.
   - Write the XDL code paying attention to the previous steps.
   - Only include XDL steps that are documented in the XDL language.
   - Make sure to follow the format of the XDL language.
   - Always include units for all quantities, and make sure they are correct.
   - Always write exact quantities for all attributes that require them.
   - Enclose the XDL code in the <XDl> tag.
   - Not skip any steps in the procedure.
   - Keep the order of the steps in the procedure.
   - Note down any steps that are not executeable with the available XDL steps.
   - Write each step explicitly into the XDL without any shortcuts.

Now translate the provided synthetic procedure into XDL.
Write down all the steps.
I dont have hands and cant read your mind.
"""

iterative_system_prompt = """
You are an expert in translating synthetic procedure into XDL. This allows you
to execute chemical synthesis procedures in an automated and unambiguous manner.
You will be given a synthetic procedure from literature containing information
about a reaction that was performed. Your task will be to translate this
procedure into XDL, to make it reproducibly executeable. Previously you
generated an XDL code for a chemical procedure that will be used to synthesize a
molecule. Durinng the execution of the procedure, errors were encountered.
You will always provide complete answers that do not require further actions.
If you have to make any best guesses (for amounts, times, etc.), make sure you 
make your decision based upon the other values (amounts, volumes, etc...) provided in the procedure.
"""

iterative_xdl_prompt = """
XDL Language Description:
```
{steps_description}
```

This synthetic procedure:
```
{new_procedure}

and chemical information:
{chemicals}
if a solution contains a salt, it is assumed to be dissolved in water unless otherwise stated and the density is 1 g/mL.
```


Was translated into this uncorrect XDL code:
```
{old_xdl}
```

These were the errors:
```
{errors}
```

Additional information:
In chemistry ambigious language is often used, this can lead to errors:
```
{ambiguities}
```

Please fix the errors and warnings.
While you are correcting the new XDL code, make sure to check for any
potential errors that might not have been captured in the previous execution.

To respond do the following:
```
   FIRST:
      Map the errors and warnings to all lines of the XDL code of the synthetic procedure causing the error and correct them.
         {error_mapping_format}

   FINALLY:
      Correct the provided XDL with the inconsistencies and error identified above. Do not change anything else. 
      Stricltly follow the format of the XDL language:
      ```XDL <XDL> ... </XDL> ```
```

Make sure to:
   - Make sure the order of the steps is correct and as described in the synthetic procedure. If not correct them.
   - Map the errors and warnings to the XDL code and correct them.
   - Make sure to write down the new XDL code including all corrections.
   - Only correct XDL code that was identified as incorrect. Do not change anything else.
   - Only include XDL tags and attributes that are documented in the XDL language.
   - Always include exact quantities and units for all attributes that require them.
   - Make sure to follow the format of the XDL language.
   - Write each step explicitly into without any shortcuts.
I dont have hands and cant read your mind.
"""


chemicals = """
{
   chemical_name_1: {
      "role": "role of the chemical (i.e. solvent, reagent, catalyst, substrate, acid, base, activating-agent, product, ...)",
      "amount": "amount of the chemical",
      },
   chemical_name_2: {
      "role": "role of the chemical (i.e. solvent, reagent, catalyst, substrate, acid, base, activating-agent, product,s ...)",
      "amount": "amount of the chemical",},
   ...
}
"""


step_by_step_instructions = """
{
   "step_1": {
      "thought": what you think the first step in the synthetic procedure is,
      "reasoning": why you think this is the first step,
      "instruction": first step in the synthetic procedure,
      "xdl_step": XDL step for the first step
   },
   "step_2": {
      "thought": what you think the second step in the synthetic procedure is,
      "reasoning": "why you think this is the second step",
      "instruction": "second step in the synthetic procedure",
      "xdl_step": "XDL step for the second step"
   },
   ...
}
"""

misordered_steps = """
{
   "inconsistent_steps_1": {
      "line_in_procedure": "line of the synthetic procedure that is not properly represented in the XDL code",
      "xdl_line": "line of the XDL code where the step should be",
      "correction": "correction to the XDL code"
   },
   "inconsistent_steps_2": {
      ...
   }
}
"""

error_mapping_format = """
{
   "error_1": {
      "error": "error description",
      "xdl_line": [lines in the XDL code where the error is present],
      "correction": [correction of each line that contains the error]
   },
   "error_2": {
      ...
   }
}
"""

========================================

SOURCE FILE: sources/acra-synthesis-reproduction/critique_prompt.py

system_prompt = """
You are an expert synthetic Chemist. A synthetic procedure was translated into
XDL, a XML based language to automatically execute chemical procedures on
robotic platforms. Given the natural language description of the procedure and
the XDL of the synthetic procedure it was translated into, you are asked to
evaluate the correctness of the XDL of the synthetic procedure.

You should identify any inconsistencies between the natural language description
and the XDL of the synthetic procedure, highlighting any missing steps, ambiguities, or errors in the
XDL that are not properly translated from the synthetic procedure or not
approximated appropiately. You should also provide suggestions on how to improve
the XDL of the synthetic procedure.

If you think a step from the natural language description is not executeable in
the XDL language you will be ask to highlight this as well, which is crucial for
further development of the XDL language.
"""

critique_prompt = """
Implemented steps in the XDL language (If something is not defined here, it is
not available in the XDL language):
```implemented steps in the XDL language
{steps_description}
```

natural language description of the synthetic procedure. You should evaluate the
correctness of the XDL of the synthetic procedure based on this description:
```natural language description of the synthetic procedure
{procedure_description}

and chemical information:
{chemicals}
if a solution contains a salt, it is assumed to be dissolved in water unless otherwise stated and the density is 1 g/mL.
```

This is the XDL of the synthetic procedure the  natural language description of the synthetic procedure was translated into:
```XDL Code
{code}
```

Please evaluate the correctness of the XDL of the synthetic procedure. Identify any inconsistencies
between the natural language description and the XDL of the synthetic procedure. Highlighting any
missing steps or errors in the XDL of the synthetic procedure, and group them by `not_executeable`
[step not executeable in XDL language] and `missing_steps` [missing in procedure
but executeable]. Provide suggestions on how to improve the XDL code. 
Make sure to:
    - Identify any steps or conditions that are NOT executeable AND missing with the XDL language in the `not_executable` section:
        - The `thought` field should describe which part of the natural language procedure you think is not executable with the XDL language 
        - This `interpretation` field should describe what you think this part means to achieve
        - The `reasoning` field should describe why you think it is not executable
        - The `suggestion` field should provide a suggestion to improve the XDL language and what to do (if applicable).
        - This will be used to improve the XDL language in the future
        - No manual steps will be performed, so if something is not executable, it is crucial to highlight it
    - Identify any steps that are missing in the `missing_steps` section:
        - The `thought` field should describe which part of the natural language procedure you think is missing or incorrectly translated to XDL of the synthetic procedure
        - The `natural_language_procedure_line` field should contain the actual text in the natural language procedure where you think the step is missing or incorrect
        - The `reasoning` field should describe why you think this step is missing or incorrect in the current XDL of the synthetic procedure
            - This aims to identify any steps were the translation does not match the purpose of the natural language description.
        - The `suggestion` field should contain the correction that should be made in plain language
        - The `xdl_step` field should contain the corrected, added, or reordered lines that should be included/changed in the XDL of the synthetic procedure (ONLY use steps and attributes from the XDL language!)
        You should include:
            - If a step is not executeable, BUT you think there is a way to execute it with the current state of the XDL language, provide a suggestion on how to do it
            - Identify any missing steps that CAN be executed with the XDL language but are missing in the `missing_steps` section
            - Identify any misordered steps in the `missing_steps` section
            - Identify any operations that are executed in the wrong vessel in the `missing_steps` section (i.e. steps where an operation is performed without the appropriate reagent or solution being transferred to the correct vessel)
            - Make sure solids are NEVER transferred in a Transfer step. If possible make suggestions on how to improve the XDL of the synthetic procedure to avoid this
            - Make sure to use the correct solutions or phases in the Separate steps.
                - The correct phase is declared as target and waste phase
                - The appropriate phase should always be transferred to the separator again in repeating washing/extracting steps
            - Make that the correct solutions (solvent, reagent, etc.) are used and are always transferred to the correct vessel
            - Make sure all operations are performed in the correct order, and on the correct vessel, and with the correct solution/reagents
            - Make sure all solutions are given sufficient time to dissolve after mixing (especially if the solution has to be transferred to another vessel later)
    - Do not include the same step in both sections!
    - Ignore missing steps that do not use the exact same hardware but can be executed with other hardware available in the XDL language
The response format should strictly follow this
json format:
{response_format}

If everything is correct, just respond with an empty json object
Make sure to strictly stick to the described output json format
"""

inclusion_system_prompt = """
You are an expert synthetic Chemist. A synthetic procedure was translated into
XDL code, a XML based language to automatically execute chemical procedures on
robotic platforms. You were requested to incorporate a correction into the XDL
code that was translated from a natural language description of the procedure.

You will be asked to correct the XDL of the synthetic procedure based on the requested correction.
Only change the things you have been explicitly requested to change.
"""

inclusion_prompt = """
natural language description of the synthetic procedure. This is the ground
truth that should be translated into XDL code:
```natural language description of the synthetic procedure
{procedure_description}
```

This is the XDL of the synthetic procedure the natural language description was translated into:
```xdl_code
{code}
```

You were requested to incorporate the correction into the XDL of the synthetic procedure the natural language description:
```
{requested_correction}
```

Respond with the corrected XDL of the synthetic procedure that incorporates the requested correction.
Only make adjust the parts of the XDL necessary to incooperate the requested changes. 
Write the enitre XDL of the synthetic procedure. Do not abbreviate anything! 
"""


response_format = """
{
    "not_executable": [
        {
            "thought": which part of the natural language procedure you think is not executable with the XDL language,
            "interpretation": what you think this part means to achieve,
            "reasoning": why you think it is not executable with the current XDL language,
            "suggestion": suggestion to improve the XDL language and what to do (if applicable),
        },
        {
            "thought": which part of the natural language procedure you think is not executable with the XDL language,
            "interpretation": what you think this part means to achieve,
            "reasoning": why you think it is not executable with the current XDL language,
            "suggestion": suggestion to improve the XDL language and what to do (if applicable),
        },
        ...
    ],
    "missing_steps": [
        {
            "thought":  which part of the natural language procedure you think is missing or incorrectly translated to XDL of the synthetic procedure,
            "natural_language_procedure_line": the actual text in the natural language procedure where you think the step is missing or incorrect,
            "reasoning": why you think this step is missing or incorrect in the current XDL of the synthetic procedure,
            "suggestion": correction that should be made in plain language,
            "xdl_step": corrected, added, or reordered lines that should be included/changed in the XDL of the synthetic procedure (ONLY steps and attributes from the XDL language!),
        },
        {
            "thought":  which part of the natural language procedure you think is missing or incorrectly translated to XDL of the synthetic procedure,
            "natural_language_procedure_line": the actual text in the natural language procedure where you think the step is missing or incorrect,
            "reasoning": why you think this step is missing or incorrect in the current XDL of the synthetic procedure,
            "suggestion": correction that should be made in plain language,
            "xdl_step": corrected, added, or reordered lines that should be included/changed in the XDL of the synthetic procedure (ONLY steps and attributes from the XDL language!),
        },
        ...
    ],
}
"""
Retrieved
2026-07-17
Original format
Python source files
Completeness
full
Transcription
Verbatim source files from the cited repository commit.
Permission basis
Redistribution under the repository's BSD-style license with its license notice preserved in the source bundle.

Editorial context

What happened

The campaign began with 717 extracted literature procedures. ACRA classified 427 as executable, 89 as blueprints, and 201 as incomplete. On a 150-procedure benchmark, 99.33% produced valid XDL and 94.67% passed discrepancy and simulation checks. The most important child attempt concerns methyl 4,6-O-benzylidene-alpha-D-glucopyranoside. The robotic reaction showed no conversion, and an independent chemist-led attempt also failed to reproduce the source without significant procedural changes.

Keep in view

This is primarily a literature-reproduction workflow rather than discovery of a new reaction. The system makes explicit best-guess substitutions for ambiguous prose, and some Chemputer-specific packages are not openly downloadable.

Chronology

Timeline

01
Peer-reviewed article, code, prompts, and data publishedpeer review · day date

Trust boundaries

Validation

wet labmixed

Six procedures were attempted physically, with product isolation, NMR, and yield measurement for successful examples.

replicationmixed

One robotic failure received a separate chemist-led attempt that also could not reproduce the reported chemistry without substantial changes.

peer reviewpassed

Published in Communications Chemistry.

System

AI and tools

  • Autonomous Chemputer Reaction Agents
  • Chemputer
  • Opentrons
  • OpenAI API-based models, exact production version undisclosed

People

Human contributors

  • Sebastian Pagel
  • Michael Jirasek
  • Leroy Cronin

Organizations

Affiliations

  • University of Glasgow

Primary materials

Sources and artifacts