Mass Spectrometry AI Agents: Improving Molecular Identification

    AI agents can improve molecular identification by coordinating accurate-mass calculations, chemical database searches, and fragmentation simulations rather than relying on language models alone. This article explains the required domain skills, evidence-driven workflows, human review checkpoints, and engineering practices for faster, more auditable identification of known compounds and better-supported hypotheses for unknown molecules.

    Mass spectrometry interpretation has long faced a gap between high-quality measurements and reasoning that demands specialist expertise. Instruments provide accurate masses, isotope patterns, and tandem mass spectra. The difficult part is translating those observations into chemically consistent structural hypotheses while preserving an evidence trail that others can verify.

    General-purpose large language models have improved at answering chemistry questions. However, when asked to infer a structure directly from an unannotated tandem mass spectrum using only a peak list, their identification accuracy is often very low. Accurate-mass calculations, searches across millions of compounds, and simulations of bond cleavage and rearrangement are deterministic or semi-deterministic tasks. Language generation alone cannot reliably replace them.

    A more practical approach is to let an AI agent orchestrate domain-specific skills, established mass spectrometry algorithms, and public chemical database queries, then present the complete evidence to a chemist for review.

    The Core Problem: Combining Observations, Retrieval, and Chemical Constraints

    Tandem mass spectrometry produces masses and intensities with measurement uncertainty—not a molecular graph. Identification must satisfy at least three types of constraints:

    • Molecular formula constraints: Candidate formulas must agree with the precursor ion’s accurate mass.
    • Fragmentation constraints: Fragment ions must be explainable through chemically plausible bond-cleavage pathways.
    • Consistency constraints: Candidate structures must agree with available reference libraries, isotope distributions, and adduct assignments.

    Without all three, identification can quickly become lost among isomers.

    Language models are useful for breaking a natural-language task into steps and explaining relationships between fragments and functional groups. They are less reliable at ensuring numerical correctness in mass-defect calculations and are not a substitute for indexed database retrieval.

    The engineering principle is therefore to separate reasoning from computation and retrieval. The model proposes hypotheses, selects the next skill, and organizes the report. Specialized tools perform accurate-mass calculations, library searches, and fragmentation simulations. Their outputs are then returned to the model for chemical consistency checks.

    Domain Skills: Turning Routine Tasks into Orchestrated Capabilities

    A mass spectrometry agent typically needs several categories of domain skills. These can form an end-to-end workflow or be invoked independently.

    Spectrum Preprocessing and Peak Annotation

    Preprocessing includes baseline and noise reduction, isotope-cluster identification, and assignment of adducts and charge states.

    Users should specify instrument tolerances, such as mass windows and resolution, in natural language. The agent should map those requirements to tool parameters rather than asking the model to guess an acceptable error.

    Within the specified tolerance, tools enumerate or retrieve molecular formulas consistent with the accurate mass. They then compare spectra or individual fragments against compounds in reference libraries.

    For known compounds, improvements in identification efficiency come primarily from database coverage and ranking quality—not from a model becoming better at guessing structures.

    Fragmentation Simulation and Substructure Constraints

    For molecules absent from reference libraries, the goal should not be to produce a complete structure in one step. Instead, the workflow should narrow the formula candidates and identify substructures supported by fragment evidence. These results can guide subsequent NMR, chromatography, or synthetic validation.

    Bond-cleavage simulations provide interpretable fragment-to-bond relationships that chemists can use to reject incorrect molecular frameworks.

    Evidence Trails and Auditable Reports

    When a workflow takes an unannotated spectrum from a single prompt to a proposed structure, its report should include:

    • Tolerances and tool versions used
    • Candidate structures and reasons for excluding alternatives
    • Matched fragments and unexplained peaks
    • Explicit statements of uncertainty

    Reviewers should be able to reproduce each step rather than see only a final molecular structure.

    In a suitably configured system, researchers can describe the task and instrument tolerances in natural language without configuring the underlying toolchain individually. The agent connects the skills, integrates their outputs, and performs chemical reasoning. Tasks such as denoising, peak annotation, and isomer comparison can also be used independently within existing laboratory workflows.

    Why a Language Model Alone Is Not Enough

    Without external retrieval or specialized mass spectrometry skills, both frontier and lightweight models can perform very poorly when inferring structures from peak lists alone.

    This is not simply a prompting problem. The task exceeds the capabilities of a purely generative model. Without accurate-mass calculations and database searches, the model relies on uncontrolled associations drawn from the molecular distributions represented in its training data. Distinguishing isomers becomes particularly difficult.

    Limited web access does not resolve the problem. Even when models can query public information, substantial numbers of spectra may remain unidentified, with lightweight models generally missing more. Web text cannot replace structured library searches or fragmentation simulations, nor can it ensure that a referenced spectrum was acquired under conditions compatible with the current instrument.

    Adding domain-specific skills can bring molecular identification and verification performance closer to that of specialized toolchains. Lightweight models may also approach the performance of larger models. At the same time, generation overhead per interaction can decrease: instead of producing lengthy reasoning to approximate mass and fragment calculations, the model calls tools and interprets their results.

    For laboratories, this can mean shorter interactions, more reliable numerical results, and lower inference costs.

    However, any specific accuracy percentage depends on the spectrum dataset, tolerances, library coverage, and whether human review is permitted. Teams should establish their own gold-standard evaluation set, including known compounds, blanks, spiked samples, and examples with novel molecular frameworks.

    Evaluation should distinguish between identifying compounds represented in a library and narrowing the candidate space for compounds outside it. Reducing both tasks to a single end-to-end accuracy figure can obscure important differences.

    Agent Orchestration and Human Review

    A recommended workflow schedules skills according to gaps in the evidence rather than loading every capability into one prompt:

    1. Determine the charge state and adduct.
    2. Calculate candidate molecular formulas.
    3. Search reference libraries.
    4. If retrieval fails, perform fragmentation analysis and assemble supported structural fragments.

    Each stage should have explicit failure conditions, such as too many unexplained peaks or an inconsistent isotope pattern. When a condition is triggered, the agent should revisit earlier steps or request additional metadata, such as chromatographic retention time or collision energy.

    Chemist review belongs at high-risk decision points:

    • Submitting a final proposed structure
    • Excluding a candidate supported by strong fragment evidence
    • Claiming that a compound is new

    The agent’s value lies in making the full evidence trail visible, not in transferring responsibility for structural identification away from the scientist.

    Database queries and calculations should also run in a controlled environment. Unpublished spectra should not be sent through external channels that cannot be audited.

    Engineering Considerations for Deployment

    Treat Tolerances and Metadata as First-Class Inputs

    The same skills can perform very differently across instruments. Clearly specifying mass accuracy, resolution, and ionization method can be more useful than increasing model size.

    Build Retrieval Indexes and Local Caches

    Libraries containing millions of compounds need indexes for mass and molecular formula. Caching peak-annotation results can reduce latency for repeated experiments.

    For offline operation, retain at least local accurate-mass calculation and fragmentation simulation capabilities so that the system does not become entirely unusable without network access.

    Use an Explicit Isomer Strategy

    Do not return only one “best structure.” Provide a ranked candidate list based on fragment coverage, ring systems, degree of unsaturation, and biosynthetic or synthetic plausibility.

    The report should also identify which structural differences the available mass spectrometry data cannot resolve.

    Make Small Tasks Reusable

    Denoising, peak annotation, and isotope fitting should expose stable interfaces that can integrate with laboratory information management systems.

    End-to-end spectrum-to-structure workflows are useful for exploratory analysis. Routine quality control is often better served by fixed combinations of skills.

    Evaluate and Run Regression Tests

    Whenever a model or tool version changes, rerun a fixed spectrum dataset. Relevant checks include:

    • Top-1 identification accuracy for compounds represented in the library
    • Whether the correct molecular formula remains in the candidate set for compounds outside the library
    • Whether reports still include unexplained peaks

    Missed identifications deserve more attention than a few impressive individual examples.

    Scope, Limitations, and Future Directions

    This approach is well suited to rapid identification of compounds already represented in reference libraries, assistance with metabolite annotation, and generation of testable substructure hypotheses for unknown compounds.

    It cannot replace the orthogonal experiments required for complete structural elucidation. It should also avoid strong conclusions when tolerances or blank controls are missing. For unknown compounds from plants, environmental samples, or synthesis, the output should be framed as hypotheses and evidence, not definitive identification.

    Further development can focus on three vendor-neutral capabilities:

    • Unified evidence integration across additional dimensions, including multistage mass spectrometry and ion mobility
    • Coordination with chromatographic peak-purity assessment and blank subtraction
    • Review-oriented visualization, including fragment-to-bond highlighting and the structural differences between isomers

    These are general capabilities rather than features tied to a particular model.

    Conclusion

    The key to AI-assisted molecular identification is not simply a larger language model. It is making accurate-mass calculation, library retrieval, and fragmentation simulation available as callable skills, then allowing an agent to coordinate them around a natural-language task while preserving every computational step for chemist review.

    This approach can accelerate identification of known molecules and narrow the formula and substructure search space for unknown compounds. It can also reduce unproductive generation and make the workflow more auditable.

    For most laboratories, starting with focused tasks such as peak annotation and tolerance configuration, then gradually expanding to end-to-end structure inference, is a more dependable strategy than pursuing fully automated identification from the outset.