El Agente Gráfico: A Semantic Execution Runtime for Scientific Agents
Organizations: Department of Chemistry, University of Toronto, 80 St. George St., Toronto, ON M5S 3H6, Canada · Vector Institute for Artificial Intelligence, W1140-108 College St., Schwartz Reisman Innovation Campus, Toronto, ON M5G 0C6, Canada · Department of Computer Science, University of Toronto, 40 St George St., Toronto, ON M5S 2E4, Canada · Department of Mathematics, University of Toronto, 40 St George St., Toronto, ON M5S 2E4, Canada ·
Abstract
Large language models (LLMs) can plan scientific workflows and generate code, but these capabilities do not specify how scientific state is validated, transferred and recorded across heterogeneous computational and experimental operations. Here we present El Agente Gráfico, a semantic execution runtime for scientific agents that uses typed execution graphs to enforce admissible scientific state transitions, record provenance and confine model judgement to explicit decision points. Using the same top-level LLM and task-specific rubrics on six university-level quantum chemistry exercises, El Agente Gráfico improved performance while reducing model cost by approximately 80% and wall-clock time by more than fourfold relative to our previous multi-agent architecture. Across ensemble spectroscopy and metal-organic framework (MOF) design, the runtime supported typed-state transfer, parallel execution and cross-session persistence. Open-ended studies of a disulfide redox mechanism and the vibrational hypothesis of olfaction required the agent to define the chemical scope and computational pathway of each investigation. A graph-construction skill distilled from these studies then enabled coding agents to author typed execution graphs for MOF literature mining. Together, these results show how typed execution graphs turn reusable procedural knowledge into scientific protocols that can be inspected, revised and transferred across computational and physical systems.
Figures & tables
| llm model | Numerical eval. (%) | llm Judge eval. (%) | Trace tokens | llm api ( api ) requests | Token cost (USD) | Task duration (s) | Context window saturation (%) | Error recovery cost (%) | Carryover tokens (%) |
|---|---|---|---|---|---|---|---|---|---|
| El Agente Q [ 7 ] | 88.25 (human evaluation) | 1,649,616 | 168.43 | 4.67 | 1,827 | n/a | n/a | n/a | |
| sonnet-3.7 | 93.69 | 90.94 | 284,036 | 9.14 | 0.92 | 404 | 19.46 | 5.07 | 86.30 |
| sonnet-4.5 | 96.07 | 95.67 | 320,397 | 6.58 | 1.09 | 273 | 26.79 | 9.02 | 83.28 |
| gpt-4.1 | 93.71 | 96.52 | 113,175 | 5.11 | 0.25 | 208 | 3.59 | 8.17 | 66.79 |
| gpt-5 | 98.88 | 98.50 | 83,613 | 3.32 | 0.17 | 228 | 9.78 | 9.59 | 53.21 |
| gpt-5.1 | 98.37 | 96.61 | 99,775 | 3.65 | 0.17 | 211 | 10.43 | 8.69 | 58.19 |
Appendix figures & tables28 assets
Supplementary material from the paper’s appendix.
Appendix
| LLM model | Input tokens ($/M) | Output tokens ($/M) | Maximum context window |
|---|---|---|---|
| gpt-4.1 | 2 | 8 | 1,047,576 |
| gpt-5 | 1.25 | 10 | 400,000 |
| gpt-5.1 | 1.25 | 10 | 400,000 |
| gpt-5.2 | 1.75 | 14 | 400,000 |
| minimax-m2 | 0.2 | 1 | 205,000 |
| qwen3-max | 1.2 | 6 | 262,144 |
| Question | Level | Weight | Task |
|---|---|---|---|
| Organic compounds | 1 | 20% | Correct input file, i.e., level of theory, required keywords, charge, and multiplicity; |
| 20% | Convergence of calculation, i.e., SCF, geometry optimization, and absence of imaginary frequency; | ||
| 20% | Report generation; | ||
| 20% | Successful extraction and documentation of all report values; | ||
| 20% | Successful generation of XYZ from SMILES. | ||
| 2 | 20% | Correct input file, i.e., level of theory, required keywords, charge, and multiplicity; |
| pass@k | pass ˆ k | |||||||
|---|---|---|---|---|---|---|---|---|
| LLM Model | @1 | @3 | @5 | @10 | ˆ 1 | ˆ 3 | ˆ 5 | ˆ 10 |
| gpt-4.1 | 0.81 | 0.99 | 1.00 | 1.00 | 0.81 | 0.52 | 0.34 | 0.11 |
| gpt-5 | 0.94 | 1.00 | 1.00 | 1.00 | 0.94 | 0.83 | 0.74 | 0.53 |
| gpt-5.1 | 0.87 | 1.00 | 1.00 | 1.00 | 0.87 | 0.65 | 0.48 | 0.22 |
| gpt-5.2 | 0.84 | 1.00 | 1.00 | 1.00 | 0.84 | 0.59 | 0.42 | 0.17 |
| minimax-m2 | 0.53 | 0.90 | 0.98 | 1.00 | 0.53 | 0.15 | 0.04 | 0.00 |
| pass@k | pass ˆ k | |||||||
|---|---|---|---|---|---|---|---|---|
| LLM Model | @1 | @3 | @5 | @10 | ˆ 1 | ˆ 3 | ˆ 5 | ˆ 10 |
| gpt-4.1 | 0.68 | 0.97 | 1.00 | 1.00 | 0.68 | 0.30 | 0.13 | 0.02 |
| gpt-5 | 0.82 | 1.00 | 1.00 | 1.00 | 0.82 | 0.56 | 0.38 | 0.13 |
| gpt-5.1 | 0.76 | 0.99 | 1.00 | 1.00 | 0.76 | 0.43 | 0.24 | 0.06 |
| gpt-5.2 | 0.82 | 1.00 | 1.00 | 1.00 | 0.82 | 0.56 | 0.38 | 0.13 |
| minimax-m2 | 0.55 | 0.91 | 0.98 | 1.00 | 0.55 | 0.16 | 0.05 | 0.00 |
| pass@k | pass ˆ k | |||||||
|---|---|---|---|---|---|---|---|---|
| LLM Model | @1 | @3 | @5 | @10 | ˆ 1 | ˆ 3 | ˆ 5 | ˆ 10 |
| gpt-4.1 | 0.63 | 0.95 | 0.99 | 1.00 | 0.63 | 0.25 | 0.10 | 0.01 |
| gpt-5 | 0.82 | 0.99 | 1.00 | 1.00 | 0.82 | 0.54 | 0.36 | 0.12 |
| gpt-5.1 | 0.70 | 0.97 | 1.00 | 1.00 | 0.70 | 0.34 | 0.16 | 0.02 |
| gpt-5.2 | 0.75 | 0.99 | 1.00 | 1.00 | 0.75 | 0.42 | 0.23 | 0.05 |
| minimax-m2 | 0.43 | 0.81 | 0.94 | 1.00 | 0.42 | 0.07 | 0.01 | 0.00 |
| Stage | Input Representation | Output Representation | Translation Mechanism |
|---|---|---|---|
| CIF → Topology | CIF file path | Topology ( ogm ) | CrystalNets.jl classification → PORMAKE topology → Topology ogm wrapper |
| CIF → Building Blocks | CIF file path | MetalNode / OrganicLinker ( ogm ) | PORMAKE MOFDecomposer → ASE Atoms fragments → deduplicate_building_blocks → create_ontomofs_building_block (splits real atoms vs docking points into ConceptualAtoms + XYZ ) |
| kg → Python Objects | SPARQL result iri | Topology , MetalNode , OrganicLinker | pull_from_kg with recursive hydration ( recursive_depth=-1 ) |
| PORMAKE IDs → ogm components | String identifiers (topology / node / linker) | Topology , MetalNode , OrganicLinker | Resolve identifiers to PORMAKE definitions → wrap as ogm objects ( ConceptualAtoms + docking points) → canonicalize and enqueue in state.build_queue |
| ogm → PORMAKE | BuildingBlock ( ogm ) | PORMAKE BuildingBlock | Lazy property access ( e.g. , cached PORMAKE BuildingBlock construction inside ogm wrapper) |
| PORMAKE → ConstructedMOF | PORMAKE Framework | ConstructedMOF ( ogm ) | from_pormake_framework → ConceptualAtoms.from_ase_atoms → provenance wiring |
| Phase | Gráfico | Claude Code |
|---|---|---|
| Development | Detected the reversed UNSW-100/UNSW-101 CIF contents and encoded composition-, name- and space-group-based identity checks. The completed graph blocked both mismatched pairs; three tests passed before reserved-paper access. | Authored the graph and completed 23 tests without an article–CIF identity check. Its final development run calculated both mismatched UNSW pairs; extraction varied across model calls. |
| First reserved-paper pass | Applied unchanged, the development-stage gate calculated CAU-23 and one KMF-1 deposition, blocked the reversed Zr pair, and blocked Zr-bptc for insufficient formula evidence; the run returned partial . | Processed the KMF-1 and Zr-framework papers without detecting the Zr reversal. CAU-23 entered a paper_failed carrier after its extraction call reached the 180-s timeout. |
| Revision after observation | Explained the conflicts and, after user authorization, added atom-site composition fallback and provenance-backed local-CIF overrides for both reversed pairs. Six tests passed, and both folders were rerun. | Increased the extraction timeout to 300 s, added one retry and reran the reserved folder. It did not add a structure-identity check or revise the local-CIF associations. |
| Measure | Gráfico | Claude Code |
|---|---|---|
| Scope | Three consecutive traces covering initial authoring and reserved-paper execution, explanation of the blocked identities and the user-authorized repair. | Session start through the workflow completion. |
| Model requests | 42 calls to gpt-5.6-sol . | 154 billable model iterations: 27 on Claude Fable 5 and 127 on Claude Opus 4.8, including fallback iterations. |
| Input-side accounting | 3,234,165 input tokens, including 3,111,841 cache-read tokens (96.2%) and 122,324 uncached tokens. | 25,623,337 token events: 9,675 base-input tokens, 748,189 one-hour cache-write tokens and 24,865,473 cache-read tokens (97.0%). |
| Output tokens | 32,141, including 7,985 reasoning tokens. | 139,253. |
| API-equivalent model cost | US3.131771), summed from public-price cost fields in the trace telemetry. | US28.104450), reconstructed from recorded usage and public API rates. |
| Dimension | Gráfico | Claude Code |
|---|---|---|
| Graph topology | Separate paper-parsing and paper-extraction maps, each followed by a join; a subsequent per-record identity, preparation and calculation map terminated in a result join. | A paper-level map combined parsing and extraction before a paper join; a second map processed each (MOF, CCDC) pair before a result join. |
| Failure representation | Invalid identities, preparation failures and calculation failures produced result rows. Extraction failure was retained in run state and provenance but did not produce a paper-level result carrier. | Explicit carriers represented analysed, paper-failed, no-CCDC and CIF-not-found lanes; preparation and calculation exceptions were also retained. |
| Structure identity | Compared deposition number, formula-derived diagnostic elements, recognizable block name and space group. A later revision added atom-site composition fallback and explicit local-CIF overrides that were revalidated. | Resolved each mined identifier to the matching local filename. It did not compare the paper-derived framework identity with CIF formula, name or space group. |
| Solvent removal | Selected FSR when CoRE-MOF outputs and checks passed; otherwise retained the raw CIF with a warning. ASR was not selected automatically. | Selected ASR whenever available, then FSR, and finally the raw CIF if cleaning failed. |
| Zeo++ settings | High-accuracy mode; Å probe radius; 4,000 surface-area and pore-volume samples per atom. | High-accuracy mode; Å probe radius; 2,000 surface-area samples and 50,000 pore-volume samples per atom. |
| Tests | Three tests before the first reserved-paper run, a fourth dry-run test after that pass, and six after the identity-repair revision. | Twenty-three unit and integration tests before the final reserved-paper rerun. |
| Framework | Reported BET | Gráfico | Claude Code |
|---|---|---|---|
| PRI-1 | 317.3 (CO 2 ) | 0; CCDC 641709, FSR | 0; CCDC 641709, ASR |
| ALF | 588 | 0; CCDC 2098663, FSR | 0; CCDC 2098663, ASR |
| ZJU-300 | 796.2 | 0; CCDC 2218592, FSR | 0 for CCDC 2218592–2218594, ASR; the final extraction omitted the BET value |
| Ca-tcpb | 260.65 | 107.59; CCDC 2277051, FSR | 102.17; CCDC 2277051, ASR |
| UNSW-100 | 1,490 | Blocked at article-reported CCDC 2448651 by identity checks | 0; local 2448651.cif, raw; its contents mismatch article-defined UNSW-100 |
| UNSW-101 | Not numerically reported | Blocked at article-reported CCDC 2448652 by identity checks | 933.82; local 2448652.cif, ASR; its contents mismatch article-defined UNSW-101 |
| Framework | Reported BET | Gráfico post-diagnostic | Claude Code final | Qualification |
|---|---|---|---|---|
| CAU-23 | 1,250 | 1,367.69; CCDC 1878820, FSR | 1,396.96; CCDC 1878820, ASR | Aligned identity; and relative to the reported BET. Claude’s value followed the timeout/retry revision. |
| KMF-1 | 1,130 | 1,033.80; CCDC 1984701, FSR | 1,040.98 and 1,014.92; CCDC 1984701 and 1984702, ASR | Aligned identities; , and , respectively. |
| Zr-bptc | 1,030 | 0; CCDC 1557153, raw | 0; CCDC 1557153, raw | Both curation paths failed and retained the solvated deposited structure; zero accessibility is not a comparison with the activated experimental material. |
| Zr-abtc | 1,318 | 1,191.97; article CCDC 1557154, local 1557155.cif, FSR | 2,907.24; local 1557154.cif, ASR | The supplied 1557154 CIF matches article-defined Zr-tptc-(Me) 2 rather than Zr-abtc; the Claude Code value therefore does not evaluate the reported Zr-abtc material. |
| Zr-tptc-(Me) 2 | Not reported | 2,566.82; article CCDC 1557155, local 1557154.cif, FSR | 1,496.95; local 1557155.cif, ASR | The supplied 1557155 CIF matches article-defined Zr-abtc rather than Zr-tptc-(Me) 2 ; no experimental BET was mined for the latter. |
| Dimension | Evidence in this study | Open requirement | Future evaluation |
|---|---|---|---|
| Protocol semantics | Typed state, admissible transitions and explicit failure carriers | Static and domain-specific conformance checks, with versioned schema migration | Held-out protocol suites and regression testing across workflow revisions |
| Protocol authoring | Skill-guided graph generation by two coding agents | Evidence-gated revision of graphs and skills | Repeated cross-model authoring with independent scientific audit |
| Execution substrate | Native-object transfer, persistent relational state and parallel graph lanes | Isolated, resource-aware and distributed execution that preserves identity and provenance | Cross-environment replay, recovery and resource accounting |
| Physical grounding | Digital-twin-to-robot protocol transfer and conversion of laboratory feedback into a tested constraint | Typed multimodal feedback, calibration and uncertainty-aware twin updates | Repeated closed-loop experiments on held-out targets |