Inspiration#
Science has no logs.
When a piece of software breaks, a developer reads the logs, checks the diff and works out exactly what changed. When an experiment fails, a researcher has a paper notebook, some half-remembered timings and a reagent bottle that may or may not be the same lot as last time.
Benchbook started at the bench. During a wet-lab internship in a cellular immunology lab at Maynooth University, Andrew my big brother spent his days following ELISA and RT-qPCR protocols from printed sheets and writing results into a notebook afterwards. Steps ran over time, a reagent was swapped, a value came out of range, and none of it was recorded at the moment it happened. When an experiment failed, nobody could say for sure why.
It turns out this isn't one frustrated intern's problem:
- In a Nature survey of 1,576 researchers, more than 70% had tried and failed to reproduce another scientist's experiment, and more than half had failed to reproduce their own.
- A 2015 PLOS Biology analysis estimated that over half of US preclinical research is irreproducible, which works out to roughly
$$ 0.50 \times 56.4\ \text{billion USD} \approx 28\ \text{billion USD per year} $$
- In that same analysis, biological reagents and lab protocols were among the four root causes, with reagents and reference materials the single largest contributor.
Those are exactly the two things a paper notebook is worst at tracking. So we built the tool we wished existed: one that guides you through an experiment and records what really happened, instead of asking you to remember it later.
What it does#
Benchbook (benchbook.app) is a live digital lab notebook for PhD researchers. It treats an experiment the way a developer treats code:
| In the lab | In Benchbook | Developer analogy |
|---|---|---|
| Protocol / SOP | Structured steps, timers, tolerances, reagents | Source code |
| Doing the experiment | A guided run on a tablet at the bench | Running in production |
| Something went off-plan | An automatically logged deviation | A failed test |
| Reagent lot and expiry | Snapshotted into every run | package-lock.json |
| Methods section | Generated from what actually ran | Auto-generated docs |
The core flow:
- Import a protocol. Upload an existing SOP (PDF, Word or text) and AI turns it into structured, executable steps with timers, measurement specs and a reagent list.
- Run it at the bench. Benchbook walks you through one step at a time. Timers start with the step, and every value you enter is checked against its spec the moment you type it.
- Deviations are captured automatically. If a step meant to take five minutes is finished in 28 seconds, or a reading falls out of range, or a reagent is expired, Benchbook records it without anyone having to type a note.
- Get a complete record. Every run produces a timestamped record with the materials used (lot numbers and expiry status), all deviations in plain language, and an exportable PDF and CSV. Runs can be shared with a supervisor through a read-only link.
- See patterns over time. Run history and statistics show which protocols and steps drift most often.
How deviation checking works
Each measured step carries a specification. A recorded value \(x\) is in spec when
$$ x_{\min} \le x \le x_{\max} $$
and anything outside that window is flagged and stored alongside the actual value.
Timed steps work the same way. Each one has a planned duration \(t_{\text{plan}}\) and a tolerance \(\tau\) set to the second. A timer deviation is logged when
$$ \left| t_{\text{actual}} - t_{\text{plan}} \right| > \tau $$
so a 5-minute incubation with \(\tau = 30\) s that ends after 28 s gives \(|28 - 300| = 272 > 30\) and is recorded as a deviation, with both times kept in the run record.
How we built it#
We're two brothers: Andrew, a computational biology MSc student who did the lab work that inspired the product, and Anthony, a computer science student who is Benchbook's lead developer.
Stack:
- Frontend: React 18, TypeScript, Vite and TanStack Query, designed for tablets at the bench with a warm amber design language and researcher-first terminology
- Backend: Node.js and Express in TypeScript
- Data: Supabase Postgres with row-level security, so every query is scoped to the signed-in researcher
- AI: Claude for turning SOPs into structured protocols and for drafting methods text, streamed with retries
- PDF export: Puppeteer with headless Chromium, behind a job queue
- Hosting: Vercel for the web app, Railway for the API
How it evolved:
- v1 was a fast prototype on a no-code AI app builder. It proved researchers wanted the idea, but builds kept timing out and layered AI-generated fixes piled up as technical debt.
- v2 was a full rebuild in four phases: the foundation and data model, protocols and AI import, the run execution engine, and finally history, statistics and shared views. We reused the architecture of BenchTrace, an enterprise GMP compliance tool we'd designed earlier, then stripped out the enterprise layer (organisations, roles, e-signatures) so Benchbook stays simple for individual researchers.
- Real users shaped it. A PhD researcher testing Benchbook on real Western blots pointed out that equipment like a gel imager doesn't have an expiry date or lot number, so we split equipment from consumable reagents. Feedback like that drove most of our feature decisions.
Challenges we ran into#
- Long protocols timed out during AI import. A 20-page SOP could take longer to parse than the connection stayed open. We moved import to streaming, added explicit retries and sized token limits to the document.
- PDF generation crashed the server. Several users exporting at once launched several headless Chromium instances and ran the API out of memory. We put PDF rendering behind a single-concurrency queue.
- Records that change after the fact. If a reagent's lot number was edited in the library, old runs would silently show the new lot, which is the opposite of a trustworthy record. Each run now snapshots reagent lots and expiry status at the moment it starts.
- Refetch storms. Deleting a reagent triggered a burst of simultaneous refetches that hit our own rate limiter and returned HTTP 429s. Separately, the limiter was counting by IP rather than by user, which would have penalised everyone in a shared university network. We fixed both.
- Orphaned data. Deleting a protocol could leave reagents linked to nothing. We traced it to a structural association bug and corrected the relationships.
- Leaky errors. An audit found 67 API routes returning raw database error messages to the browser. Every route now goes through one sanitising error handler.
- A race condition on launch perks. Our first users get permanent "founding member" status, capped at a fixed number. Assigning that from application code could hand out more than \(N_{\max}\) slots if two people signed up at the same instant. We moved it into an atomic Postgres function with a transaction-level advisory lock, so the guarantee holds under concurrency:
$$ \left|{\, u : u \text{ is a founding member} \,}\right| \le N_{\max} $$
- Small bugs with big consequences. A JavaScript falsy-zero bug rendered a literal "0" next to steps, and timer tolerances only accepted whole minutes. Both look minor until a scientist with a 30-second tolerance can't record it.
Accomplishments that we're proud of#
- A live product at benchbook.app, free to use, with real researchers running real experiments on it
- Deviation capture that needs zero extra typing from the scientist
- Turning a messy PDF protocol into a runnable, timed, spec-checked workflow in under a minute
- Hardening it for real use: per-user AI rate limits, route-level timeouts, a PDF queue, paginated run history and sanitised errors across every route
- Building it as a researcher-and-developer team, where each of us had to learn the other's world
What we learned#
- A notebook records what you type; an execution platform records what happened. That distinction became the whole product. Researchers don't need another place to write notes, they need the record to write itself while their hands are busy.
- Domain knowledge is a feature. Many of our best decisions (equipment vs. reagents, second-level timer tolerances, lot snapshots) came from someone who had stood at the bench, not from the code.
- Who feels the pain isn't always who pays. Talking to people at DCU Innovate, we learned that PhD students feel the problem but rarely control budgets, while their PIs do and want visibility across the whole lab. That's shaping our Lab tier.
- Prototype fast, then rebuild properly. The no-code v1 got us to real users quickly; knowing when to stop patching and rebuild was the most important technical call we made.
- Data integrity is a design problem, not just a database one. Snapshots, atomic functions and scoped queries matter more in a scientific record than almost anywhere else.
What we built at Hack The Nest#
During the 24 hours of Hack The Nest we focused on three pieces of work: the user interface, the AI pipeline, and the safeguards around both.
1. The interface
We built the UI around one rule: a researcher at the bench has gloves on and their attention on the experiment, not the screen.
- Import screen: upload a PDF or Word SOP, or paste text, then choose which sections of the document become runnable steps and which stay as reference information (purpose, materials, safety notes)
- Run screen: one step at a time, large touch targets for a tablet, a timer that starts with the step and shows its tolerance window, and measurement fields that turn red the moment a value goes out of spec
- Run record: a clean, timestamped summary of what happened, with every deviation written in plain language next to the recorded value, plus the reagent lots and expiry status used in that run
2. The AI pipeline
Turning a messy, human-written protocol into something a machine can run takes more than one prompt. Our pipeline has five stages:
- Extract: pull clean text out of the uploaded PDF, Word file or pasted text
- Segment: split the document into sections, so that the purpose and materials list are stored as metadata instead of being mistaken for steps
- Structure: send the steps to the model, which returns structured JSON: each step's instruction, its duration, whether its timer is strict or advisory, measurement specs \([x_{\min}, x_{\max}]\), and the reagents it uses
- Link: match the extracted reagents against the researcher's own reagent library, so lot numbers and expiry dates carry through to the run automatically
- Generate: after a run, draft a methods section from what actually happened, including the real durations and reagent lots, rather than what the protocol said should happen
Long SOPs (some are 20+ pages) are streamed from the model so the connection stays open, and the output budget is sized to the document instead of always requesting the maximum:
$$ \texttt{max_tokens}(n) = \begin{cases} 4{,}000 & n < n_1 \quad \text{(short protocol)} \ 8{,}000 & n_1 \le n < n_2 \quad \text{(medium)} \ 16{,}000 & n \ge n_2 \quad \text{(long SOP)} \end{cases} $$
where \(n\) is the length of the cleaned input text. Smaller requests finish faster and are less likely to drop.
3. Safeguards
A lab record is only useful if you can trust it, so we treated safety and reliability as features:
- Researcher stays in control: the AI drafts the protocol, but the researcher chooses the sections and reviews the steps before anything becomes runnable
- Retries and friendly failures: model calls retry automatically on network errors, and if a large import still times out the user gets a clear message suggesting the paste-text option instead of a crash
- Per-user AI rate limits: limits are counted per account rather than per IP address, so a whole university network sharing one IP isn't blocked by one heavy user
- Private by default: Supabase row-level security scopes every query to the signed-in researcher, so no one can read another person's protocols or runs
- No leaked internals: every API route sends errors through one sanitising handler, so database messages never reach the browser
- Timeouts and queues: long statistics and export routes have their own timeouts, and PDF generation runs through a queue so heavy exports can't take the server down
- Records that can't drift: each run snapshots reagent lots and expiry status at the moment it starts, and using an expired reagent requires the researcher's explicit acknowledgement, which is logged
Models and AI tools we used
- Claude Sonnet 4.6 (Anthropic API,
claude-sonnet-4-6): protocol structuring and methods-section generation - Claude Code: AI coding assistant used during development and deployed mutiple agents to help with the coding following a plan we had written.
Claude: used for product research
What's next for Benchbook
Lab tier for PIs: a supervisor creates a lab, invites students, and sees experiments and deviations across every member, with a shared protocol library
"GitHub for lab experiments": fork a protocol, run your version, and compare runs side by side to see exactly what changed between the experiment that worked and the one that didn't
Hands-free mode: researchers wear gloves, so voice control ("next step", "absorbance 0.82") is the natural next interface
Regulated labs: a path from Benchbook to BenchTrace for pharma and biotech QC teams that need audit trails and e-signatures
References
- Baker, M. (2016). 1,500 scientists lift the lid on reproducibility. Nature, 533, 452–454.
- Freedman, L. P., Cockburn, I. M., & Simcoe, T. S. (2015). The economics of reproducibility in preclinical research. PLOS Biology, 13(6), e1002165. n
What's next for Benchbook
- Lab tier for PIs: a supervisor creates a lab, invites students, and sees experiments and deviations across every member, with a shared protocol library
- "GitHub for lab experiments": fork a protocol, run your version, and compare runs side by side to see exactly what changed between the experiment that worked and the one that didn't
- Hands-free mode: researchers wear gloves, so voice control ("next step", "absorbance 0.82") is the natural next interface
- Regulated labs: a path from Benchbook to BenchTrace for pharma and biotech QC teams that need audit trails and e-signatures
References
- Baker, M. (2016). 1,500 scientists lift the lid on reproducibility. Nature, 533, 452–454.
- Freedman, L. P., Cockburn, I. M., & Simcoe, T. S. (2015). The economics of reproducibility in preclinical research. PLOS Biology, 13(6), e1002165.
Built With
- claude
- postgresql
- supabase
- typescript