LLM Agents for AI4S: An Automated Workflow for Preclinical Molecular Screening

    How LLM agents can orchestrate marker-gene analysis, technical-gene filtering, and biological plausibility review so preclinical molecular screening moves faster without dropping reproducibility or expert judgment. This article outlines a reusable three-stage pipeline, an agent-plus-tools-plus-compute architecture, and the engineering practices that keep results traceable.

    1. The Problem: When Large Molecule Libraries Hit Preclinical Screening

    Drug discovery has a long-standing “valley of death.” Before a program reaches the clinic, teams must pick a small number of molecules with real drug potential from thousands of candidates. The traditional process depends on experienced scientists working through literature review, target validation, pathway analysis, and biological plausibility one molecule at a time. A full assessment of a single candidate often takes hours or even days of expert time.

    AI for Science (AI4S) is redefining this step. A common industry pattern is to use a large language model agent as an orchestrator and interpreter: unstructured work such as reading the literature and explaining results goes to the model, while structured computation such as gene-expression calculation, sequence alignment, and protein filtering stays with mature bioinformatics tools. The agent then connects the two paths. Work that used to take a doctoral researcher four to eight hours—marker-gene calculation, ribosomal-protein filtering, and biological plausibility assessment—can now produce an initial screen in about the time of a meal.

    This article does not focus on any specific product. It breaks the path into a reusable, general approach for developers.

    2. A Typical Pipeline: Three Key Stages

    2.1 Marker-gene calculation

    Marker-gene analysis checks whether the cell type or tissue context where a candidate molecule is expected to act actually expresses the intended target. The typical input is a single-cell or bulk expression matrix. The output is differentially expressed genes grouped by cell cluster, plus enriched pathways.

    1. # Illustrative pseudocode: marker-gene calculation
    2. def compute_marker_genes(expr_matrix, cluster_labels):
    3. # 1. Run differential expression tests by cluster
    4. degs = differential_test(expr_matrix, cluster_labels)
    5. # 2. Drop low-expression and low-specificity genes
    6. degs = [g for g in degs if g.specificity > THRESH_SPEC
    7. and g.mean_expr > THRESH_EXPR]
    8. # 3. Pathway enrichment as evidence for later plausibility review
    9. enriched = pathway_enrichment(degs, background=gene_universe)
    10. return MarkerReport(degs, enriched)

    The engineering difficulty at this stage is volume and parallelism: expression matrices are large, and the work can run in parallel. In practice, matrix slices are usually stored in object storage, compute jobs are submitted as containers to a cloud compute pool, and results are written back as structured files (for example, a columnar format) for the next stage.

    2.2 Ribosomal-protein filtering

    Ribosomal proteins, mitochondrial genes, and other technically highly expressed genes often occupy noisy slots in differential-expression results. Leaving them in can mislead downstream judgment. The filter looks simple, but it is a critical quality-control step:

    • Remove genes that match a blacklist based on gene-family annotations.
    • Flag samples with abnormal expression shares instead of deleting them outright.
    • Keep a filter log so results stay traceable and reproducible.
    1. RIBOSOMAL_PATTERN = r"^RP[L/S]\d+"
    2. MITO_PATTERN = r"^MT-"
    3. def filter_technical_genes(gene_list):
    4. blacklist = {g for g in gene_list
    5. if re.match(RIBOSOMAL_PATTERN, g)
    6. or re.match(MITO_PATTERN, g)}
    7. return [g for g in gene_list if g not in blacklist]

    This step reflects an important pipeline principle: make quality-control rules explicit and manage parameters in one place. Putting filter lists and thresholds in a shared configuration, rather than scattering them across scripts, is what keeps batch runs consistent.

    2.3 Biological plausibility assessment

    The first two stages produce candidates at the data level. The third stage asks whether they make sense scientifically: Is the target related to the disease pathway? Does the proposed mechanism conflict with the known literature? This step has traditionally been the slowest because it requires knowledge integrated across papers and databases—exactly the kind of work large models handle well.

    Here the agent does two jobs:

    1. Evidence retrieval and synthesis. Given the candidate genes and pathways, search public knowledge bases and literature abstracts and summarize supporting and opposing evidence.
    2. Structured interpretation. Against a predefined review frame (relevance, specificity, and safety signals), draft a conclusion with a confidence score for human review.

    Model output should be treated as an assisted interpretation draft, not a final conclusion. Hallucination risk means critical decisions must still pass an expert review node. The agent should also cite sources so each judgment can be traced and checked.

    3. Agent Orchestration: Connecting the Three Stages

    The overall architecture can be summarized as an agent layer, a tool layer, and a compute layer:

    1. User intent → Agent (plan / call / reflect)
    2. ├─ Tool calls: bioinformatics engines, database queries, file I/O
    3. ├─ Data bus: object storage + structured intermediate results
    4. └─ Compute scheduling: containerized jobs, elastic scale on demand

    The agent does not “do the math” itself. It does three things:

    • Task planning. Turn a natural-language request (for example, “assess whether this batch of molecules is plausible in the target tissue”) into an executable sequence of subtasks.
    • Tool orchestration. Choose the right compute tool for each subtask, assemble parameters, and retry on failure.
    • Result synthesis. Collect outputs from each stage and produce a human-readable assessment report.
    1. # Illustrative pseudocode: agent task loop
    2. for molecule in candidate_batch:
    3. plan = agent.plan(task=f"Assess the biological plausibility of molecule {molecule}")
    4. for step in plan:
    5. result = executor.run(step.tool, step.params)
    6. if not validator.pass_qc(result):
    7. step = agent.revise(step, feedback=result.qc_log)
    8. report = agent.summarize(collect_all_results())
    9. queue_for_human_review(report)

    4. Engineering Practices for Production

    1. Separate the sources of speed. Not all of the gain comes from the large model. Structured computation speeds up through pipeline parallelism and elastic compute. The largest time savings are in literature search and plausibility review, which used to be entirely manual. Knowing which stage contributes which gain is what makes the return on investment clear.

    2. Results must be reproducible. Each job should record an input snapshot, tool versions, parameter configuration, and random seed. Intermediate artifacts should land in object storage with version tags. In research, “fast” only counts if the result is also correct and traceable.

    3. Observability is not optional. Batch jobs need logging, metrics, and failure alerts. Instrument at two levels: job level for throughput and failure rate, and stage level to see whether a job is stuck in computation, retrieval, or synthesis.

    4. Draw a clear line between human and machine. Assessment conclusions from the agent should include evidence citations and a confidence score, and they should be forced into a human review queue. Review records can then feed prompt and evaluation-framework updates, closing the loop.

    5. Takeaways

    AI4S does not change molecular screening by replacing scientists with a model. It hands repetitive computation to a pipeline, knowledge integration to an agent, and scientific judgment to experts. For engineering teams, the transferable lesson is: first make quality-control rules explicit and compute elastic, then bring in a large model for orchestration and interpretation, and finally back the system with reproducibility and human–machine review. When thousands of molecules reach preclinical screening, the candidates that last are the ones a fast, rigorous, and traceable pipeline has actually evaluated.