From a molecule to source evidence
Search for a reported preparation, retrieve one observation and read its conditions in context.
Use this workflow when the question is “How was this molecule prepared in a recorded source?” You will search for a product, retrieve a selected observation and distinguish reported conditions from missing information.
You need an installed Python SDK and a CYBERRXN_API_KEY with access to corpus queries. The installation guide provides the current package and checksum. For another interface, see the equivalent operations.
1. Search for the product molecule
Use molecule_reactions with role="product". It finds observations involving that molecule as a product, including a product side with other molecules. Start with three results so you can inspect each one.
search_reactions(products=...) has a different meaning: it matches the complete dot-separated product side. Choose it deliberately when that is what your question requires. Search semantics.
2. Retrieve a selected observation
The following example makes one search call and, if there is a match, one full-observation call. It uses the ID actually returned by the server.
from cyberrxn import Client
with Client() as client:
matches = client.molecule_reactions(
"CCN1CCN(CO)C(=O)C1=O", role="product", limit=3
)
if not matches.items:
print("No recorded match for this query.")
else:
record = client.get_observation(matches.items[0].observation_id)
print("Observation:", record.observation_id)
print("Patent:", record.evidence.patent)
print("Source paragraph:", record.paragraph_text)
print("Conditions:", record.conditions)Both successful operations are metered: this is two calls when an observation is fetched, or one call when the search is empty. You can inspect usage afterwards.
The first match is selected to keep the example small. For a real question, compare the returned candidates and choose the observation relevant to the requested preparation. Do not combine conditions from different observations into one procedure.
3. Read the original paragraph
Inspect paragraph_text, evidence and conditions together. A paragraph can describe several stages of an experiment.
| Check | How to interpret it |
|---|---|
| Temperature and time | Identify the stage they describe: reaction, work-up, drying or another operation. |
| Pressure | Preserve its units and kind. A drying vacuum does not establish reaction pressure. |
| Agents | Keep unresolved roles unresolved; an agent list is not automatically a catalyst/solvent list. |
| Missing values | Keep null or unknown values as missing. Do not replace them with ambient assumptions. |
| Missing paragraph | State that the returned record has no source paragraph available; do not invent a quote. |
Use the opaque observation_id for retrieval. A patent number or source UID helps locate the source but does not replace that ID in an API request.
4. Present a traceable answer
A useful result identifies the selected observation and patent, explains what the source reports, and states which requested conditions remain unknown. Quote only text actually present in the retrieved source. Keep extracted evidence, computed checks and model hypotheses clearly distinguishable.
A structure match does not establish that a procedure will work in a new setting. If you also need an atom/charge check, run chemical validation as a separate operation and explain what it checks.
When the result is incomplete
An empty search means that this query found no observations. Check the structure and search semantics before broadening the request. A missing condition is not itself a corpus error. If you observe a direct conflict between a record and its source, follow the reporting guide.
For an assistant, use the same bounded workflow after connecting MCP. Ask it to read the current guide, search a few observations and retrieve the selected source. Inspect actual tool activity before relying on a claim that it checked the corpus.