Building Research Agents for AI for Science: Architecture, Scenarios, and Engineering Challenges

    This article examines how large language models and research agents can support AI for Science (AI4S) by shifting the focus from raw model capability to executable scientific workflows. It introduces a capability taxonomy, a six-layer reference architecture for scientific agents, and practical patterns for prompt orchestration, tool calling, and knowledge integration. Through representative scenarios such as single-cell analysis, drug and materials research, and evidence-based knowledge services, it explains where research agents can provide measurable value. The article also analyzes the main obstacles to large-scale adoption, including fragmented scientific data, domain-specific knowledge gaps, reproducibility requirements, heterogeneous tool ecosystems, inference costs, evaluation difficulties, and the need for interdisciplinary teams. Finally, it outlines engineering practices for moving research agents from prototypes to production environments.

    Introduction: The Execution-Layer Logic Behind AI for Science

    A vendor recently announced that it will treat AI for Science—often abbreviated as AI4S—as a key investment direction, and it showcased scientific research agent examples on its developer platform. These examples cover scenarios such as biomedical data analysis, drug discovery, and materials research.

    In one publicly disclosed single-cell analysis example, a biomedical agent was connected to a general-purpose large language model and completed an end-to-end analysis workflow on 3,696 mouse embryonic pancreas cells. In about 90 minutes, the system produced a cell development atlas and identified 100 candidate genes. Parameter configurations and the execution trace were recorded throughout the process.

    This case illustrates two important points:

    • The value of a research agent is not simply that the model “knows a lot.” It is that the workflow is executable and the results are visible.
    • In scientific settings, the competitive focus of general-purpose large models is shifting from parameter scale alone to system-level engineering capabilities that combine models, toolchains, domain knowledge, and evaluation.

    This article first outlines the capability layers and reference architecture of AI4S. It then examines key scenarios such as single-cell analysis, drug and materials research, and research knowledge services. Finally, it discusses the practical challenges and possible paths forward for large-model vendors entering this direction.

    From Model Capability to Execution Capability: Three Perspectives on AI4S

    2.1 Three Main Forms of Current AI4S Solutions

    Form Core characteristics Typical tasks Main bottlenecks
    Specialized models Designed around a single scientific problem and dependent on high-quality labeled data Protein structure prediction, molecular property prediction, materials generation Narrow coverage and limited generalization to new scientific problems
    Large models plus agents Reuse the reasoning, code-generation, and tool-calling capabilities of general-purpose models to orchestrate domain tools and complete tasks Data analysis, literature review, experiment design Insufficient domain knowledge and uncertain result reliability
    Domain models Continue pretraining or fine-tuning on top of general-purpose models using large-scale scientific corpora Molecular and materials understanding, biological sequence modeling High-quality scientific corpora are scarce and training costs are high

    These three forms are not mutually exclusive. Specialized models and domain models provide domain capabilities that are precise and reliable, while general-purpose large models provide cognitive and orchestration capabilities: understanding intent, explaining decisions, and invoking tools. For research agents, a more realistic role is to let the general-purpose model act as the “brain” that can call specialized domain capabilities, rather than expecting one model to solve all scientific problems.

    2.2 Four Characteristics of Scientific Tasks Shape Agent Design

    1. Complex but decomposable workflows: Scientific tasks can usually be broken into standardized substeps, making them suitable for multi-step structures such as planning, execution, and verification.
    2. Highly specialized tools: Analysis software, computational libraries, instrument control programs, and domain databases each serve specific purposes. The model does not need to “remember” how to compute everything; the key is whether it can invoke the right tools correctly.
    3. Results must be verifiable: Scientific conclusions require supporting data, methods, and evidence. Every stage should be traceable and reproducible.
    4. Long-tail and highly specialized knowledge: Disciplines are deeply specialized. Terminology, units, naming conventions, and standards vary widely, and knowledge evolves quickly.

    These characteristics also define the practical boundary of research agents. Agents can significantly improve efficiency in stages where workflows are fixed, tools are mature, and results can be quantified. However, proposing scientific hypotheses, making causal judgments, and making value trade-offs in experiment design still require scientists to remain in control.

    Reference Architecture for Research Agents

    A deployable research agent can typically be divided into six layers. The model is only one component.

    Layer Main responsibility Key design points
    Interaction layer Receives tasks and presents processes and results Natural-language input; previewable intermediate results; one-click export of charts and reports
    Agent orchestration layer Decomposes tasks, selects tools, and verifies results Structured prompts; limits on call steps and duration; retry and fallback strategies
    Domain knowledge layer Provides domain semantics and evidence Literature and data retrieval; terminology ontologies; domain prior-knowledge bases
    Tool layer Executes real computation Unified tool protocols; parameter validation; sandbox isolation; version locking
    Data and compute layer Stores, schedules, and runs workloads Data catalogs and versions; elastic compute; asynchronous handling of large tasks
    Observability and governance layer Monitors, audits, and continuously optimizes the system Call-chain tracing; evaluation sets; cost statistics; permissions and data masking

    Three core constraints connect these layers:

    • Model outputs are suggestions; tool returns are facts.
    • Every data transformation must leave version and parameter records to ensure reproducibility.
    • High-risk operations—such as deleting raw data, changing experiment designs, or publishing conclusions—must require human confirmation.

    3.1 Orchestration Layer: Making Models Follow Defined Procedures

    In scientific settings, the role of the model is closer to that of an experiment assistant than a casual chatbot. Prompts should explicitly constrain available tools, call order, failure handling, and output formats. For example:

    1. You are a single-cell transcriptome analysis assistant. Follow these rules:
    2. 1. Data preprocessing: first perform quality control to filter low-quality cells and cells with abnormal mitochondrial content, then normalize the data and select highly variable genes.
    3. 2. Clustering and visualization: build the cell neighbor graph, perform dimensionality reduction and visualization, and cluster the cells. Clustering granularity should be determined based on cluster-size distributions.
    4. 3. Cell-type annotation: based on marker genes of each cluster and a prior knowledge base of pancreas-development markers, provide candidate cell types and confidence scores.
    5. 4. Candidate gene selection: perform differential expression analysis for the target cell groups, and rank genes by adjusted significance and expression fold change.
    6. 5. Rigor requirements: all gene names must be validated through an annotation tool, and all generated artifacts must be written to the dataset inventory.
    7. 6. Uncertainty handling: if a tool call fails, inspect the error message and retry once. If it still fails, state the reason honestly and do not fabricate intermediate results.
    8. 7. Output format: structured summary plus files containing the atlas and differential gene lists.

    3.2 Tool Layer: Constraining Tool Calls with JSON Schema

    Whether tool descriptions are well defined directly affects whether the model can select the right tool and provide the right parameters. The example below shows a cell-type annotation tool.

    1. ANNOTATE_TOOL = {
    2. "name": "annotate_clusters",
    3. "description": "Given marker genes for each cluster and a domain prior knowledge base,
    4. return candidate cell types with evidence.",
    5. "parameters": {
    6. "type": "object",
    7. "properties": {
    8. "markers": {
    9. "type": "object",
    10. "description": "A mapping from cluster IDs to marker gene lists"
    11. },
    12. "species": {"type": "string", "enum": ["mouse", "human"]},
    13. "tissue": {"type": "string", "description": "Tissue name, such as pancreas"}
    14. },
    15. "required": ["markers", "species", "tissue"]
    16. }
    17. }
    18. def annotate_clusters(markers: dict, species: str, tissue: str) -> list:
    19. """Illustrative implementation: match markers against prior knowledge and return candidates with confidence."""
    20. knowledge_base = load_marker_knowledge(species=species, tissue=tissue)
    21. results = []
    22. for cluster, genes in markers.items():
    23. matched = knowledge_base.match(genes)
    24. results.append({
    25. "cluster": cluster,
    26. "candidates": matched[:3],
    27. "confidence": round(matched.score, 2) if matched else 0.0
    28. })
    29. return results

    Tool functions should be executed in independent sandbox processes with timeouts and resource limits. Parameters should be validated before being passed to underlying functions.

    3.3 Orchestration Loop: The Model Plans, Tools Execute, and Results Are Written Back

    1. from __future__ import annotations
    2. from dataclasses import dataclass, field
    3. from typing import Any
    4. @dataclass
    5. class ToolCall:
    6. name: str
    7. arguments: dict[str, Any]
    8. @dataclass
    9. class ModelReply:
    10. content: str | None = None
    11. tool_calls: list[ToolCall] = field(default_factory=list)
    12. finished: bool = False
    13. class ToolCallingAgent:
    14. """Illustrative implementation: the model decides, tools execute, and results are written back to the context."""
    15. def __init__(self, llm, tools: dict, system_prompt: str,
    16. max_steps: int = 20):
    17. self.llm, self.tools, self.max_steps = llm, tools, max_steps
    18. self.system_prompt = system_prompt
    19. def run(self, task: str) -> dict:
    20. messages = [
    21. {"role": "system", "content": self.system_prompt},
    22. {"role": "user", "content": task}
    23. ]
    24. for step in range(1, self.max_steps + 1):
    25. reply: ModelReply = self.llm.chat(messages, tools=self.tools)
    26. # The model determines the task is complete: return the conclusion with the full execution trace.
    27. if reply.finished:
    28. return {"summary": reply.content, "trace": messages}
    29. # The model requests tool calls: execute them one by one and append results as tool messages.
    30. if reply.tool_calls:
    31. messages.append(reply.as_assistant_message())
    32. for call in reply.tool_calls:
    33. result = self.tools[call.name](**call.arguments)
    34. messages.append({
    35. "role": "tool",
    36. "tool_call_id": call.id,
    37. "content": self.serialize(result)
    38. })
    39. continue
    40. # The model neither finished nor requested a tool: prompt it for the next action.
    41. messages.append(reply.as_assistant_message())
    42. messages.append({
    43. "role": "user",
    44. "content": "Based on the current results, provide the next action or the final conclusion."
    45. })
    46. raise RuntimeError("Maximum tool-calling steps exceeded. Please check the task description or prompt.")
    47. # Illustrative run: the stub LLM only shows protocol flow and does not call a real model.
    48. class StubLLM:
    49. def chat(self, messages, tools):
    50. history = [m.get("role") for m in messages]
    51. if history.count("tool") < 1:
    52. return ModelReply(tool_calls=[ToolCall(
    53. name="run_analysis_step",
    54. arguments={"step": "quality_control",
    55. "dataset_id": "sc-pancreas-e11.5"}
    56. )])
    57. return ModelReply(content="Quality control completed. About 3,700 cells were retained, and the data can proceed to clustering.",
    58. finished=True)
    59. def fake_llm(messages, tools):
    60. return StubLLM().chat(messages, tools)
    61. agent = ToolCallingAgent(
    62. llm=fake_llm,
    63. tools={"run_analysis_step":
    64. lambda step, dataset_id: {"status": "ok", "dataset_id": dataset_id}},
    65. system_prompt=open("sc_agent_prompt.txt", encoding="utf-8").read()
    66. )
    67. print(agent.run("Analyze mouse embryonic pancreas single-cell data and output a cell developmental atlas and candidate genes."))

    In this example, the model does not directly manipulate data. It advances the workflow through tool calls, and the execution trace itself becomes an auditable log. In real systems, tool functions are usually encapsulated in independent sandboxes and exchange artifacts through processes and files. Batch analysis tasks can be queued asynchronously through message queues, while container orchestration platforms can schedule workloads elastically based on compute resources.

    3.4 Knowledge Layer: Retrieval-Augmented Generation and Domain Priors

    General-purpose models often cannot reliably provide biological knowledge from memory alone. A knowledge layer is typically composed of three parts:

    1. Literature and database retrieval: retrieved results are reranked before being injected into the context, and the model is required to cite sources for each conclusion.
    2. Terminology and ontologies: gene naming conventions—including gene symbols, case conventions, and species-specific differences—cell types, and anatomical structures should be unified to prevent failures caused by inconsistent naming.
    3. Domain prior-knowledge bases: expert-curated marker gene lists, pathway annotations, and experimental protocols should be structured into reusable knowledge that can be invoked during annotation and candidate gene selection.

    Typical Scenarios

    4.1 Biomedical Data Analysis: Standardized and Verifiable Workflows

    Using the publicly disclosed single-cell analysis case as an example, the full workflow can be broken into the following stages:

    Stage Main operations Outputs Agent value
    Data ingestion Read expression matrices and cell annotation metadata Standardized dataset Automatically identifies data formats and species information
    Quality control Filter cells with low gene counts or high mitochondrial content and genes with low expression QC report Suggests thresholds based on data distribution and domain standards
    Normalization and feature selection Library-size correction, log transformation, and selection of highly variable genes Standardized matrix Fixes parameters and reduces manual inconsistency
    Dimensionality reduction and clustering Build the neighbor graph, perform nonlinear dimensionality reduction, visualize, and cluster Clustering results and visualizations Cluster count is determined by the data; the model helps explain granularity choices
    Cell-type annotation Compute marker genes for each cluster and match against prior knowledge Cell-type labels with confidence scores Low-confidence clusters are flagged for manual review
    Candidate gene selection Perform differential expression testing between target and control groups Differential gene list Combines significance thresholds and effect-size filtering
    Result delivery Generate the atlas and candidate gene list Reproducible report Records parameters, code, and data versions

    These tasks are well suited to early adoption for three reasons:

    • Standardized workflows: mainstream analysis steps and parameter systems are mature.
    • Verifiability: cell counts, cluster counts, marker genes, and adjusted significance levels can be quantitatively checked.
    • High repeatability: analysis steps are similar across datasets, so agents can be reused effectively.

    From a research and development perspective, 3,696 cells represent a relatively small dataset. The computational effort required for one round of this workflow is not inherently demanding. The approximately 90-minute runtime mainly reflects orchestration overhead across multiple analysis steps, domain knowledge matching, and result validation. This illustrates the nature of the agent approach: automating workflows to free scientists from repetitive operations. However, runtime is closely related to data scale, workflow complexity, and implementation details, and should not be generalized into a fixed performance benchmark.

    At the same time, agent outputs are candidates and atlases, not final conclusions. Candidate genes still require experimental validation. Cell-type annotation depends on the coverage of prior knowledge bases. If a cell type in the data is absent from the prior knowledge base, the agent should mark it as “unknown” instead of forcing an incorrect classification.

    4.2 Drug and Materials Research: Shrinking the Search Space

    In drug and materials research, agents primarily provide value in four ways:

    • Literature and patent research: quickly summarize the current state of research on targets, lead compounds, or materials systems, and produce cited research summaries.
    • Property prediction and screening: call specialized models or tools for molecular property prediction, crystal structure stability calculation, and batch evaluation of candidates.
    • Experiment design: combine existing data and constraints—such as cost, synthesizability, and safety—to generate candidate plans and prioritization.
    • Knowledge management: convert structured knowledge scattered across lab records, instrument data, and literature into searchable knowledge bases.

    These scenarios are characterized by extremely high trial-and-error costs. The goal of an agent is not to replace scientists in final decision-making, but to reduce the search space from finding a needle in a haystack to targeted investigation, thereby reducing ineffective experiments and repeated literature review.

    4.3 Research Knowledge Services: From Question Answering to Evidence-Based Reporting

    Tasks such as literature review, methodology comparison, and paper-writing assistance are knowledge-intensive. Research agents can organize retrieved results into evidence cards. Each card includes the source, year, method, and key data. The model then summarizes and compares the cards and generates a structured report with citations. Humans only need to spot-check key conclusions, significantly reducing verification costs.

    Core Challenges for Large-Model Vendors Entering AI4S

    Public cases are only a starting point. Large-scale deployment requires overcoming the following obstacles.

    5.1 Data: Scarcity of High-Quality, Systematic, and Shareable Scientific Data

    Problem manifestations:

    • Raw data is scattered across research groups, laboratory instruments, and local hard drives. Metadata is often incomplete, with insufficient records of sample information and experimental conditions.
    • Data involving human samples is constrained by ethics approval, privacy protection, and cross-border data-transfer requirements.
    • Corporate compound libraries, formulations, and process data are core assets and cannot easily be used for general model training.

    Root cause: scientific data is often produced for publication rather than for model consumption. Data standards, sharing incentives, and data-governance responsibilities remain unclear.

    Potential approaches:

    • Build unified data catalogs and metadata standards, with clear field definitions, units, and versions.
    • Apply tiered authorization, de-identification, and access auditing to sensitive data.
    • Adopt deployment models in which data remains in its domain and models are brought into the data environment.
    • Start with project-level private knowledge bases before expanding more broadly.

    5.2 Domain Knowledge: Long-Tail Disciplines Are Difficult for General Models

    Problem manifestations: scientific disciplines are far more specialized than general corpora can cover. Gene naming conventions, units, measurement standards, and experimental protocols differ greatly. General-purpose models may produce output that appears plausible but is not domain-appropriate.

    Root cause: the distribution of general corpora does not match scientific requirements, and scientific knowledge evolves quickly, so training data is naturally outdated.

    Potential approaches:

    • Use retrieval-augmented generation instead of relying on model memory, and require verifiable sources for all domain conclusions.
    • Build disciplinary ontologies and terminology databases to constrain model wording and tool parameters.
    • Convert expert-curated marker tables, pathway libraries, and experimental standards into structured prior knowledge.
    • Update knowledge bases incrementally and establish a knowledge-operation process of expert review, ingestion, and versioning.

    5.3 Reliability: Scientific Conclusions Must Be Verifiable and Reproducible

    Problem manifestations:

    • Models may fabricate nonexistent genes, pathways, or literature.
    • Units may be mixed, orders of magnitude may be wrong, and correlation may be mistaken for causation.
    • Scientific responsibility must ultimately belong to humans, so outputs that merely “look correct” are not enough.

    Root cause: the training objective of language models favors generating text that seems plausible in natural language, while scientific evaluation requires logical provability.

    Potential approaches:

    • Enforce citation validation: every key conclusion must be bound to an evidence source, and claims without sources should be blocked.
    • Delegate deterministic computation to tools: differential expression testing, statistical testing, and similar operations should be executed by mature tools rather than being “mentally calculated” by the model.
    • Ensure end-to-end reproducibility: fix random seeds and record tool versions, parameters, and intermediate artifacts.
    • Introduce human-machine review: add expert review points for key conclusions and retain complete audit logs.
    • Express uncertainty explicitly: when evidence is insufficient, mark results as “to be verified” rather than presenting definitive conclusions.

    5.4 Tool Ecosystem: Scientific Tools Are Highly Heterogeneous

    Problem manifestations: scientific tools include open-source libraries, commercial software, instrument control programs, and database APIs. Their interfaces, dependency environments, and version-management practices vary widely. Unified encapsulation is expensive, and tool-call failures are more common.

    Root cause: scientific software ecosystems have evolved historically and lack unified protocols.

    Potential approaches:

    • Build an internal scientific tool repository and describe tool names, functions, inputs, outputs, and error codes using a unified JSON Schema.
    • Run tools in sandbox containers with fixed dependencies and locked versions to ensure reproducibility.
    • Design structured error messages, such as “parameter out of range” or “data dimension mismatch,” so models can self-correct.
    • Create regression test sets for high-frequency tools to prevent result drift after tool upgrades.

    5.5 Compute Costs: The Hidden Bill of Long-Chain Inference

    Problem manifestations: multi-step agent tasks often require multiple model calls. Combined with the CPU or GPU consumption of scientific computation itself, the cost of a single task can far exceed that of a normal conversation. The longer the context—large amounts of literature, long sequences, or complete analysis logs—the higher the cost.

    Root cause: scientific tasks tend to involve heavy context and long chains. Inference costs can grow linearly or even superlinearly with the number of steps and context length.

    Potential approaches:

    • Use layered models: lightweight models for routine steps and larger models for complex reasoning, forming a model-routing strategy.
    • Compress context: summarize tool outputs before writing them back, while persisting full logs and retrieving them on demand.
    • Enable batch processing and asynchronous execution: queue non-real-time tasks to improve resource utilization.
    • Make costs observable: track token and compute consumption by task and user, and set budgets and alerts.

    5.6 Evaluation: Lack of a Widely Accepted Standard

    Problem manifestations: traditional software has unit tests, but research agents often lack universally accepted ground truth. For the same analysis task, different tools and parameters may produce different but reasonable atlases. Expert manual scoring is expensive and subjective.

    Root cause: evaluation criteria for scientific tasks are inherently domain-specific and cannot easily be reduced to a single automatic metric.

    Potential approaches:

    • Build domain evaluation sets: pair real scientific tasks with known answers, for example cell counts that can be checked or marker genes that can be validated.
    • Combine metrics: evaluate tool-call success rates, parameter correctness, result reproducibility, expert acceptance rates, runtime, and cost together.
    • Combine offline evaluation with online gray releases: test new model versions on evaluation sets before rolling them out to limited traffic.
    • Build error-attribution frameworks: distinguish tool errors, model errors, data errors, and ambiguous requirements, and improve accordingly.

    5.7 Organization and Deployment: Scarcity of Interdisciplinary Teams

    Problem manifestations: talent who understand both machine learning and domain science is scarce. Research teams vary in their acceptance of AI tools. Procurement cycles are long, and impact is difficult to quantify.

    Root cause: AI4S is fundamentally an intersection of domain knowledge, data governance, and AI engineering. It is difficult to advance with an algorithm team alone.

    Potential approaches:

    • Form joint teams composed of domain experts, AI engineers, data engineers, and platform engineers. Domain experts should define task boundaries and acceptance criteria.
    • Start with scenarios that have clear pain points and measurable outcomes, such as compressing a three-day manual analysis task into two hours.
    • Adopt a gradual mechanism of pilot, evaluation, and expansion, using data rather than marketing claims to drive adoption.
    • Define data-use boundaries, privacy protections, and rules for attribution and responsibility of AI-assisted outputs from a compliance perspective.

    Platform Engineering Practices: From Prototype to Production

    Prototype validation and large-scale operation are two different engineering challenges. With the support of general cloud platform capabilities, research agents can usually be implemented through six capability layers:

    Capability layer General capability category Role in research agents
    Data layer Object storage, file storage, data lakes, or warehouses Hosts large volumes of structured and unstructured scientific data such as expression matrices, images, and literature
    Compute layer Heterogeneous compute instances, container platforms, elastic scaling Runs scientific computing tools and model inference, scaling with task demand
    Model service layer Large-model platforms and inference-acceleration components Handles model calls, inference services, and model routing
    Orchestration layer Container orchestration, message queues, task scheduling Executes multi-step workflows asynchronously, handles retries, and controls concurrency
    Observability layer Logging, monitoring, alerts, and tracing Helps locate tool failures and inference timeouts, and tracks token and compute costs
    Security layer Private networks, key management, identity and access management, and data masking Keeps sensitive research data within its domain and enforces least-privilege access and operation auditing

    For example, on Baidu AI Cloud, developers can use general-purpose model service platforms such as Qianfan to handle model calls. They can then combine services such as object storage, container services, and logging services to build the data, compute, and operations foundation. Standard interfaces between model services and compute resources make it easier to select and replace models according to task characteristics.

    6.1 Boundaries of Multi-Agent Collaboration

    Complex tasks can be divided into multiple roles, such as planner, executor, and reviewer. The planner decomposes tasks, executors call tools to complete subtasks, and reviewers verify results and citations. However, more agents do not always mean better results:

    • Each additional role increases token costs and debugging complexity.
    • Overlapping responsibilities between roles can amplify hallucinations rather than reduce them.

    In practice, it is advisable to start with a single agent plus multiple tools. Only after the workflow is stable should roles be split as needed.

    Conclusion

    The adoption logic of AI4S is shifting from demonstrating model capability to reconstructing workflows. Public cases show that research agents already provide value in quantifiable stages: compressing hours of manual analysis into minutes and turning candidate-gene screening into a repeatable, standardized process.

    For large-model vendors, competitive barriers are not limited to single-model capabilities. They depend on accumulated capabilities in data governance, domain knowledge, tool ecosystems, evaluation systems, and engineering. For developers and research teams, a rational path includes:

    • Defining clear scenario boundaries.
    • Building tool and knowledge foundations.
    • Establishing verifiable evaluation loops.
    • Promoting deployment gradually while maintaining security and compliance.

    Only by converting “model intelligence” into “scientific certainty” can AI4S move from isolated cases into everyday research practice.