Medea: The AI Scientist That Turns Biology Questions Into Verified Analyses

Inside the Harvard-built agent that plans experiments, checks biological context, writes code, runs it, and cross-checks the literature before it speaks.

8 to 10 min read View on GitHub More from mims-harvard

A wide editorial illustration of a researcher’s desk split into two worlds. On one side are scattered gene lists, paper printouts, and sticky notes. On the other side is a clean machine-like workflow where a proposal document moves through verification, code execution, and literature review. It explains that Medea turns biological intent into a controlled analysis pipeline.
Medea’s core idea is simple: treat scientific intent as a structured object that can survive planning, execution, and review.
Key Takeaways

Most AI agents in science start by chatting. Medea starts by formalizing intent. A user question becomes a Proposal, and that proposal survives the trip through planning, context verification, code generation, execution, debugging, and literature reasoning. That is the difference between a model that talks about biology and a system that tries to do biology with receipts.

Medea Does Not Start With a Prompt. It Starts With a Proposal.

The unusual move in Medea is architectural, not rhetorical. Instead of passing a raw prompt from step to step, the system treats the research plan as a structured object. In the repository, that object is handed around in an exact format, which means the agent can keep intent intact without stuffing the entire conversation back into context every time.

The Proposal lifecycle turns a question into a durable research artifact that can be checked, repaired, and reviewed.

That matters because scientific work is stateful. A model can forget a gene list, drift from the original hypothesis, or quietly substitute a similar sounding entity. Medea’s answer is to make the plan explicit and persistent, then treat every later step as a transformation of that plan rather than a fresh guess.

Why Biomedical LLMs Keep Getting the Wrong Biology

Biomedical language is crowded with near-misses. Gene symbols overlap with common words, disease labels can be ambiguous, and cell type names often carry hidden assumptions about species, tissue, or assay context. If the model skips verification, it can look fluent while building on the wrong substrate.

SystemState handlingBiological context verificationCode executionFailure behavior
Generic chat LLMEphemeral textUsually noneNoConfident guessing
Notebook workflowHuman-managedManualYes, by the researcherHuman notices and fixes errors
MedeaStructured ProposalExplicit pre-run checksYes, by the agentCan debug or abstain

The point is not that other workflows cannot be rigorous. The point is that Medea bakes rigor into the path of least resistance. Verification happens before expensive analysis, not after a failed run has already polluted the workflow.

The Planning Module Is the Gatekeeper

research_planning.py is where Medea decides what kind of work a question deserves. The module does more than paraphrase the user’s request. It selects tools, checks whether the biological entities are real and appropriately scoped, and then emits a concrete plan that downstream modules can execute.

# Simplified Proposal flow
proposal = research_planning.generate_proposal(user_query)
proposal = context_verification.validate(proposal)
if proposal.is_valid:
    tools = tool_selector.pick(proposal)
    plan = proposal.attach_tools(tools)
else:
    plan = proposal.abstain(reason="invalid or unsupported context")

That gatekeeping step is easy to underestimate. In a normal LLM workflow, the model is rewarded for continuing to speak. In Medea, the system is allowed to stop. That is a meaningful scientific behavior, because abstention is often better than a polished mistake.

The Analysis Module Writes Code, Runs It, and Repairs It

The analysis module is where Medea stops resembling a chatbot and starts looking like an instrument. It generates Python, launches it in a subprocess, streams logs in real time, and feeds failures back into the model when the run breaks. The loop is simple to describe and hard to fake: write, execute, inspect, repair.

A close-up editorial illustration of a terminal window running generated Python code. Error messages stream out of stderr into a debugging panel, then loop back into a code editor that is being revised. A small tray labels stdout, stderr, and retry. It explains how Medea self-corrects during execution instead of stopping at the first failure.
Medea’s analysis loop is not just generation. It is generation, execution, and repair under visible constraints.

This is the closest thing to agentic science in the repo. The model does not just propose an analysis. It has to survive the consequences of its own code. That makes the system materially different from a summary bot that merely describes what a bioinformatics pipeline might do.

StepGeneric assistantMedea
Generate codeSuggests a snippetWrites code from the proposal
Run codeUsually external to the modelRuns in a controlled subprocess
Handle errorsHuman retries manuallyFeeds stderr back for repair
Prove progressNarrative onlyObservable stdout and executed artifacts

Literature Reasoning Is a Second Brain, Not a Side Quest

Medea separates computation from literature for a good reason. Data analysis can produce a candidate target, a pathway, or a cluster. Literature reasoning checks whether the result makes sense in the published record. That separation keeps evidence from collapsing into one undifferentiated answer.

In practice, this means the system can triangulate. It can find a hypothesis in omics data, test it with code, and then compare the result against papers before it reports back. The literature module is not decoration. It is a control layer that helps the agent decide whether the data are strong enough to justify a conclusion.

The Tool Space Is the Real Product

The hidden moat in Medea is the tool space. PubMed, Enrichr, Human Protein Atlas, DepMap, single-cell models, and identifier normalization utilities turn general reasoning into domain capability. The agent is only as useful as the instruments it can reach, and this repo puts a lot of effort into making those instruments coherent.

Tool layerWhy it mattersWhat it prevents
ID normalizationMaps symbols to valid biological entitiesHallucinated genes and diseases
Knowledge basesGrounds hypotheses in known biologyUnmoored speculation
Functional omics toolsLets the agent inspect data directlyAnswering without measurement
Model checkpointsSpecialize analysis for biologyGeneric reasoning overfit to text

That is why Medea reads less like a single model and more like a lab bench. The intelligence comes from orchestration, but the reliability comes from the tools.

What Medea Is Better Than, and What It Is Not

Compared with a generic LLM, Medea is far more disciplined about context and evidence. Compared with a notebook workflow, it removes a lot of the glue work that researchers normally perform by hand. Compared with a standard multi-agent framework, it is narrower and more opinionated, which is a strength when the domain is biomedical discovery.

ApproachStrengthWeakness
Generic LLMFast, broad, easy to useWeak verification and weak state
Notebook workflowFlexible and familiarHeavy manual coordination
Standard agent frameworkGeneral orchestration patternsUsually domain-agnostic
MedeaVerified, tool-rich scientific workflowDepends on a curated environment and APIs

So the niche is clear. Medea is not trying to be the universal answer engine. It is trying to be a controlled research system for a specific kind of biomedical work, where the cost of a wrong biological assumption is high.

The Research-Grade Tradeoff

Medea’s strengths are the same things that make it less portable. It depends on a curated tool stack, specific execution assumptions, and external data services that must stay available. That tradeoff is sensible for research, where reproducibility and domain fidelity matter more than generality.

The larger idea is more interesting than the implementation detail. Medea suggests a future where scientific agents are judged less by how fluently they describe a result and more by how carefully they earn it.