Gemini 4 Carbon: Rebuild a Drug-Discovery pKa Reference Set from Raw Lab Data
From Raw Lab Data to a Drug-Discovery Reference Set
pKa is the pH at which a molecule gains or loses a proton. It shapes how a drug dissolves, crosses membranes and binds its target, so it's one of the first properties drug scientists measure.
Measuring it is routine for the instrument. Turning the raw recordings into trusted reference values is expert work. A trained analyst corrects the electrode readings, fits the UV spectra across the pH range, carries methanol–water measurements back to pure water, and decides which runs to trust. Run after run, that takes a lot of time and care.
So we gave the analysis to Gemini 4 Carbon in Eigent. One brief and 97 raw instrument files - every computed result blanked out, no internet, no hints - came back as a complete pKa reference set for 35 drug-like compounds. 99.7% of the individual measurements were correct: the best score of any model we've tested on this task so far.
The Workflow at a Glance
One brief took it from raw files to a finished reference set. Every stage left something we could check.
| Stage | What happened | What it produced |
|---|---|---|
| Decode | Worked out the instrument's undocumented file format and its electrode calibration | pH and corrected pH for every reading |
| Fit | Fitted the UV spectra across the pH range, at many wavelengths at once | A pKa for each of the 291 titrations |
| Extrapolate | Carried the methanol–water results back to pure water | An aqueous pKa for each of the 97 runs |
| Judge | Accepted or excluded runs on evidence - precipitation, wrong spectra, unphysical slopes | Compound means from trusted runs only |
| Deliver | Wrote the answer and the script that produced it | The reference set and one Python analysis script |
| Check | Scored the answer and confirmed the run stayed offline | Results at every level, and an audit trail |
Here's how Gemini 4 Carbon did it - including where it fell short, and why.
What It Delivered
- A complete pKa reference set - a pKa and methanol content for every titration, an aqueous pKa for every run, and a mean, standard deviation and accepted-run list for every compound.
- The analysis as code - one Python script that rebuilds the whole answer from the raw files. Rerun it and you get the same answer back, byte for byte.
- A written method summary - how the readings were calibrated, how the spectra were fitted, how the runs were extrapolated, and which runs were left out and why.
The Setup
- Eigent 1.0.7, in a single session with Single Agent mode and Gemini 4 Carbon as the model.
- A local folder holding only the raw instrument files from an automated titrator, a list of the compounds with their structures, physical constants for methanol–water mixtures, and a Python environment with the usual scientific libraries and RDKit.
- Offline, and on its own. The brief ruled out the internet, and nobody answered questions during the run. Every judgment call - which run to trust, which setting to follow - was the agent's own.
- Raw signals only. Every number the instrument software had computed was blanked, so nothing in the files stated the answer.
- No method hints. The brief described the measurements and what to report, not how to analyse them. Choosing the physical chemistry was part of the job.
How Gemini 4 Carbon Worked
Gemini 4 Carbon worked through the task in the terminal, as a single agent, with no human input. The run fell into five phases.
-
Orientation. It read the compound list and the calibration constants, parsed the instrument's XML across every assay type, and posted its first status update: "now analyzing instrument recordings, medium composition, and electrode/UV equations."
-
Reverse-engineering the instrument. It worked out how the titrator turns electrode millivolts into pH, and how the four-parameter electrode calibration maps that to the true hydrogen-ion concentration. It derived the algebra behind one composition constant from the dispensed volumes -
a = 1 + b·(0.2 + 0.025/V)- matching the file to 3 × 10⁻⁵. Then it surveyed the analyst's settings in all 97 files: pH and wavelength windows, turbidity limits and the number of transitions. -
Building and testing the analysis. It built multi-wavelength spectral fits, tried them on one compound, then ran them on all 291 titrations. It checked its dilution correction directly against single-species plateaus, and used RDKit to classify each compound as an acid, a base or an ampholyte. It also found every sweep where the analyst had manually overridden a setting - and followed those choices.
-
Quality control, like a lab scientist. Its second status update: "now examining edge cases, turbid sweeps, multiprotic zwitterions, and outlier runs." What it caught:
- C21_4 - the compound had precipitated out of water. The run's spectra matched the other runs at only 0.20, so it left the run out of the compound mean.
- C27_1 - a low-absorbance vial with the wrong spectrum, spotted by fitting two UV bands separately.
- C29_2 - an unphysical extrapolation slope (+200, against +98 and +114 for its sister runs), so it left the run out.
- Negative absorbance at 500 nm - traced to an air bubble in a reference spectrum.
It went through the lab's experiment chronology and the re-runs from January–February 2022 to understand why some compounds had extra runs. And it tested its own method against independent evidence: it compared weighted and unweighted extrapolation on the 15 compounds that were also measured directly in water. The weighted version had the lower error - 0.0604 against 0.0623 - so it kept that one.
-
Delivery. It wrote a single 451-line analysis script, ran it, and validated the schema, types and ranges of the output.
In all: 76 model calls and 85 terminal commands, with no failed calls and no human input.
The Result
Two things landed in the folder: the reference set - 291 titrations, 97 runs and 35 compounds - and the script that built it. Gemini 4 Carbon's final message summarised the method - medium composition and electrode calibration, multi-wavelength UV fitting, aqueous extrapolation and run curation - and listed every run it left out, with the reason.
How It Scored
We scored the answer against the reference set, outside the agent's folder. The grading is strict: every titration, run and compound is a separate pass/fail check, and a titration passes only if its pKa falls within the statistical uncertainty of the reference fit and its methanol content is right. A run passes only if all three of its titrations pass, and a compound only if every run it uses passes, so one error can cascade.
| Level | Correct |
|---|---|
| Titrations | 290 / 291 |
| Runs | 91 / 97 |
| Compounds | 32 / 35 |
That's 99.7% of individual measurements correct, each one within the statistical tolerance of the reference fit.
We also audited the run itself, through the tool calls in Dev mode. In Eigent 1.0.7, Single Agent sessions always carry web search, browser and fetch tools, so this check matters: a run that looked anything up doesn't count.
| Check | What we found |
|---|---|
| It used no outside data | No web search, browser or fetch calls. None of the 85 terminal commands touched the network, a package installer, or any path outside the task folder. |
| It didn't touch the inputs | The input data is byte-identical to the original files. |
| The answer is its own analysis | Rerunning the script reproduces the answer byte for byte. |
Where It Fell Short - and Why
Gemini 4 Carbon didn't pass every check. Two method choices account for every miss:
- How to weight the extrapolation. It weighted the methanol–water extrapolation by measurement uncertainty, a choice that differs from the reference convention. That cost 5 runs and 3 compounds. Gemini 4 Carbon made the choice on evidence - the weighted fit had the lower error against the compounds measured in water - and the brief didn't specify a method.
- Which pH scale to use. It applied the analyst's recorded pH window on a different pH scale from the reference. That cost 1 titration and 1 run.
Neither is a gap in the analysis itself. Both are conventions a domain expert would recognise - the kind of house rule a lab would normally write into its instructions.
This was also a single run. Scores on a task this hard can vary from run to run.
What We Learned
- Raw data keeps the agent honest. With the vendor's computed numbers blanked, every value had to come from the signals - and the agent had to show its work.
- Describe the measurement, not the method. Gemini 4 Carbon chose the physical chemistry itself, and justified each choice with evidence from the data.
- Code is the deliverable. A script that rebuilds the answer is something a scientist can rerun, read and review.
- The misses are conventions, not mistakes. Where it fell short, it made a defensible choice that a lab's house rules would have settled.
Raw instrument files don't have to wait in a queue for analysis. Hand them to Gemini 4 Carbon in Eigent - then review the reasoning, not just the result.
Credits: built with Gemini 4 Carbon and Eigent. Music: "Dance With You" by Everet Almond.



