Engineering AI for Science: Building Auditable Research Agents
AI for Science must move beyond conversational demos toward reproducible, auditable scientific workflows. This article presents a six-layer architecture for research agents, covering model access, scientific tools, task orchestration, data and knowledge management, evaluation and auditing, and infrastructure. It also examines task decomposition, tool execution, result verification, human review, a biomedical single-cell analysis workflow, pseudocode for auditable orchestration, and a phased implementation and risk-control strategy.
1. From “Can Chat” to “Can Do Research”: The Challenge Is Not a Single Model
AI for Science discussions often stop at model demonstrations: given a research question, an agent generates an analysis plan, calls several tools, and produces a conclusion. Production research environments demand much more. Scientific tasks typically involve sensitive data, long-running workflows, multiple tools, reproducibility requirements, and clearly defined accountability. A usable research agent should not merely answer questions. It should function as an orchestrated, auditable, and measurable executor of scientific workflows.
From an engineering perspective, there are three core challenges.
First, a gap exists between model capabilities and scientific tools. Models are effective at language understanding and task decomposition, but statistical testing, numerical computation, omics analysis, image processing, and related work still require specialized tools.
Second, research data and experimental processes require versioned management. Data sources, preprocessing parameters, tool versions, and intermediate artifacts must all be traceable.
Third, scientific conclusions cannot be “self-certified” by a model. They require review by domain experts, statistical constraints, and audit logs.
As a result, the focus of AI for Science implementation should shift from “Which model should we choose?” to “How do we build a research agent system?” Such a system should include a unified model access layer, a scientific tool layer, a task orchestration layer, a data and knowledge layer, an evaluation and audit layer, and an infrastructure layer. The model is only one replaceable component, and business logic should not be tightly coupled to a single model service.
2. System Architecture: A Six-Layer Capability Stack
2.1 Unified Model Access Layer
A research agent may use general-purpose language models, domain-specific models, embedding models, and reranking models at the same time. The access layer should hide differences between model services and provide consistent mechanisms for invocation, quota management, timeouts, retries, logging, and content-safety policies. This helps control costs and prevents research workflows from becoming locked into a single vendor.
2.2 Scientific Tool Layer
Tools should be packaged as idempotent, parameterized, and sandbox-executable capability units. Examples include data quality control, sequence alignment, statistical analysis, image segmentation, knowledge retrieval, and spreadsheet computation.
Each tool should define:
- Input and output schemas
- A version identifier
- Resource requirements
- Failure semantics
Tool outputs should not be limited to natural-language responses. They should be returned as structured records so that downstream validation is possible.
2.3 Task Orchestration Layer
Research questions usually require multi-step plans: understand the question, retrieve literature and data, perform computations, interpret results, and generate a report. The orchestration layer should support plan generation, step dependencies, failure retries, human interruption, and result verification.
High-risk steps, such as statistical tests that affect the final conclusion, must include human review checkpoints.
2.4 Data and Knowledge Layer
Research data should be managed through a controlled data registry that records dataset identifiers, versions, authorization scope, preprocessing history, and lineage.
The knowledge layer may include literature collections, experimental records, domain glossaries, and internal standards. Retrieval-augmented generation can assist with literature synthesis, but retrieved results must retain their sources and retrieval timestamps. Model-generated content must not be treated as original evidence.
2.5 Evaluation and Audit Layer
Evaluation should measure more than whether an answer is fluent. Relevant metrics include:
- Task success rate
- Tool-calling accuracy
- Structured-output validity
- Reproduction consistency
- Human-review pass rate
- Latency
- Cost
Audit logs should record every model call, tool execution, parameter, output summary, and human operation. Sensitive raw data should not be written directly into logs. Summaries and hashes can be used to preserve traceability while reducing exposure.
2.6 Infrastructure Layer
In a cloud deployment, orchestration services can run on a general-purpose container platform, while data and intermediate artifacts can be stored in object storage. Logs, metrics, and alerts can be connected to logging and monitoring services.
For example, general-purpose container platforms, object storage, logging, and monitoring capabilities provided by Baidu AI Cloud may be considered as candidate infrastructure components. The final choice should still be based on compliance requirements, cost, and the team’s technology stack. Model services should be accessed through a unified gateway so that business logic does not become coupled to a specific service.
3. Core Capabilities: Scientific Task Decomposition and Tool Use
3.1 Task Decomposition
The first core capability of a research agent is task decomposition. For example, the request to “analyze a set of omics data and identify candidate mechanisms” may need to be divided into data quality control, normalization, dimensionality reduction and clustering, differential analysis, pathway enrichment, and result interpretation.
The decomposition should not be free-form text. It should be an ordered list of steps with dependencies. Each step should declare:
- Required tools
- Input data
- Output schema
- Validation conditions
3.2 Tool Calling
Tool calling is not simply a matter of composing prompts. It requires parameter validation, resource isolation, and output verification.
Computational tools should run in sandboxes with restricted network access and resource limits. Retrieval tools should return sources, relevant excerpts, and confidence values. Model-based tools should require structured outputs, with validators checking field completeness and value ranges.
3.3 Result Verification
In scientific settings, model-generated conclusions must pass rule-based and domain-specific checks.
Rule-based checks may include:
- Whether numerical values fall within reasonable ranges
- Whether statistical tests satisfy their assumptions
- Whether cited references actually exist
- Whether charts are consistent with the underlying data
Domain checks can be performed through sample-based expert review. If a step cannot be verified, the system should explicitly mark it as “requires review” rather than presenting a definitive conclusion.
3.4 Human Interruption and Recovery
Long-running research tasks may continue for hours or longer. The orchestration layer should support pausing, resuming, rerunning, and comparing branches.
Every rerun should create a new execution record and preserve artifacts from previous versions. Overwriting existing outputs can make the process impossible to reproduce.
4. An Abstract Biomedical Example
Consider single-cell data analysis in biomedicine. Public examples of research agents often present a workflow such as “data quality control → cell-type annotation → differential analysis → result interpretation.” In production, this workflow should be represented as an auditable task template rather than allowing the model to act without constraints.
First, the data enters the registry, where its sample source, batch, version, and authorization scope are recorded. Next, quality-control tools check missing values, low-quality cells, and batch effects, producing a structured quality-control report. If quality control fails, the workflow should stop and move to human handling.
The model may then assist in generating an analysis plan, while the actual computations are performed by tools. During cell-type annotation, retrieval augmentation can provide domain knowledge, but every annotation should retain supporting excerpts and a confidence value.
Finally, a report generator combines intermediate artifacts, statistical results, and cited sources into a report. Sections requiring expert review should be clearly marked.
The key is not how intelligent a particular model appears to be, but where the model is placed within the workflow:
- The model handles understanding, planning, explanation, and structured organization.
- Tools perform deterministic computation.
- The audit layer records and verifies operations.
- Experts make the final judgment.
Only with clear responsibility boundaries can a research agent become suitable for production use.
5. Code Example: Auditable Research-Agent Orchestration
The following pseudocode illustrates orchestration logic only. It does not represent any real interface or product capability.
# Pseudocode: Auditable orchestration for a research agentdef run_research_task(task):dataset = dataset_registry.load(task.dataset_id, version=task.version)qc = run_tool("data_quality_check", dataset)if not qc.passed:return audit_fail(qc)plan = planner.build(question=task.question,schema=dataset.schema,constraints=task.constraints)artifacts = []for step in plan.steps:audit_start(step)if step.kind == "retrieval":out = knowledge_base.search(step.query, filters=step.filters)elif step.kind == "compute":out = tool_sandbox.execute(tool=step.tool,inputs=artifacts[-1],params=step.params)elif step.kind == "model":out = model_gateway.infer(prompt=step.prompt,context=artifacts[-1],schema=step.output_schema)else:raise UnsupportedStep(step.kind)verified = verifier.check(step, out)if not verified:return human_review(step, out)artifacts.append(out)audit_end(step, out)report = reporter.compose(task, artifacts)return validate_and_publish(report)
This pseudocode reflects four principles:
- Data is registered before it is used.
- The plan is explicit.
- Models and tools have separate responsibilities.
- Every step is audited and verified.
A real system should also include permission checks, sensitive-data masking, resource quotas, timeout controls, and failure compensation.
6. Implementation Roadmap and Risk Control
A practical implementation can proceed in three phases.
Phase 1: Start with Low-Risk, Verifiable Scenarios
Suitable starting points include literature synthesis, data quality-control report generation, and assisted analysis workflow orchestration. The initial focus should be on establishing data registration, audit logging, and evaluation baselines.
Phase 2: Introduce Tool Calling and Human Review
In the second phase, integrate tool calling and human review checkpoints into existing research workflows. The main goals are to validate reproducibility and measure improvements in researcher efficiency.
Phase 3: Expand to Multi-Step Autonomous Orchestration
Only after the earlier capabilities are established should the system expand to multi-step autonomous orchestration. Human approval and rollback mechanisms must remain in place.
Several risks require particular attention.
First, model hallucinations must not replace evidence. Every important conclusion should be traceable to data, tool output, or a literature source.
Second, teams should avoid irreproducible prompt engineering. Prompt templates, model versions, tool versions, and parameters should all be version-controlled.
Third, cost and latency must be managed. Long contexts and repeated tool calls can create significant overhead, so systems should use budgets, caching, and fallback strategies.
Finally, data security and compliance are essential. Sensitive data should remain within controlled environments, logs should be de-identified, and permissions should follow the principle of least privilege.
7. Conclusion
Engineering AI for Science is not a competition centered on the capabilities of a single model. It is a systematic redesign of scientific workflows.
A reliable research agent should be built on unified model access, use scientific tools for execution, rely on task orchestration as its control center, and be protected by data governance, evaluation, and auditing. Models should handle understanding and explanation, tools should perform deterministic computation, and experts should make the final decisions.
Only by treating reproducibility, auditability, and measurable performance as top priorities can AI for Science move from demonstrations to genuine research productivity.
