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.
- Medea’s novelty is not that it answers biology questions, but that it converts them into a stateful, verifiable workflow.
- The Proposal object is the center of gravity, because it preserves intent, constraints, and feedback across planning, execution, and literature review.
- Its analysis loop matters because it writes code, runs it, captures failures, and uses the error stream to repair itself instead of pretending the first answer was enough.
- The project is powerful precisely because it is opinionated about tools, data, and execution, which makes it research-grade rather than general-purpose.
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.
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.
| System | State handling | Biological context verification | Code execution | Failure behavior |
|---|---|---|---|---|
| Generic chat LLM | Ephemeral text | Usually none | No | Confident guessing |
| Notebook workflow | Human-managed | Manual | Yes, by the researcher | Human notices and fixes errors |
| Medea | Structured Proposal | Explicit pre-run checks | Yes, by the agent | Can 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.
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.
| Step | Generic assistant | Medea |
|---|---|---|
| Generate code | Suggests a snippet | Writes code from the proposal |
| Run code | Usually external to the model | Runs in a controlled subprocess |
| Handle errors | Human retries manually | Feeds stderr back for repair |
| Prove progress | Narrative only | Observable 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 layer | Why it matters | What it prevents |
|---|---|---|
| ID normalization | Maps symbols to valid biological entities | Hallucinated genes and diseases |
| Knowledge bases | Grounds hypotheses in known biology | Unmoored speculation |
| Functional omics tools | Lets the agent inspect data directly | Answering without measurement |
| Model checkpoints | Specialize analysis for biology | Generic 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.
| Approach | Strength | Weakness |
|---|---|---|
| Generic LLM | Fast, broad, easy to use | Weak verification and weak state |
| Notebook workflow | Flexible and familiar | Heavy manual coordination |
| Standard agent framework | General orchestration patterns | Usually domain-agnostic |
| Medea | Verified, tool-rich scientific workflow | Depends 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.