Magnolia: A Persistent-Memory Agent Framework for Computational Chemistry
Organizations: Université Côte d’Azur, CNRS, ICN, Nice, France · Inria, Université Côte d’Azur, CNRS, I3S, France
Abstract
Chemistry has recently entered a high-data regime as molecular databases from high-throughput platforms or computational studies have become available. Increasing automation within the chemical sciences leads to a more digital and precision chemistry. Dedicated scientific agents are becoming central to guiding the chemist through an ever-increasing amount of data and findings, including negative ones. Here, we introduce Magnolia, a persistent-memory artificial intelligence agent framework that integrates computational protocols, from docking to quantum chemistry, lab notebooks and chat logs relying on large language models (LLMs). It relies on a three-tier memory system: session-level observations are automatically captured and distilled into structured learnings, confirmed and elevated to project-tier entries and, when human-validated, promoted to cross-project rules that actively guide subsequent work and provide direct chemical feedback. We illustrate Magnolia on four case studies: quantum-chemical evaluation of aromatic systems (COMPAS database), molecular dynamics of butane and of modified DNA, and a protein-peptide docking campaign. Across these projects, Magnolia tracked 317 runs and accumulated 116 project-tier entries, from which four cross-project rules were promoted; in controlled replays of four tasks, runs with memory passed the checks that runs without it failed (for example, ten of ten docking-configuration checks, against one to four of ten). By combining automation, reproducibility, and human-in-the-loop control, our Magnolia framework streamlines docking, molecular dynamics and quantum chemistry calculations with direct analysis and LLM-augmented feedback, offering accelerated access to computational (bio)chemistry.
Figures & tables
| Molecule | IE | E(HOMO) xTB | E(HOMO) B3LYP | Adiabatic IP |
|---|---|---|---|---|
| benzene | 9.244 | 10.95 | 6.88 | 9.00 |
| naphthalene | 8.144 | 10.27 | 5.95 | 7.73 |
| phenanthrene | 7.891 | 10.22 | 5.89 | 7.45 |
| triphenylene | 7.870 | 10.31 | 6.01 | 7.43 |
| chrysene | 7.600 | 10.04 | 5.68 | 7.09 |
| benz[a]anthracene | 7.450 | 9.91 | 5.48 | 6.90 |
| Store | Tracked runs | Tier 1 | Tier 2 | Tier 3 |
|---|---|---|---|---|
| Quantum-chemistry benchmark (CS1) | 0 | 7 | 0 | 0 |
| Butane MD (CS2) | 6 | 8 | 0 | 0 |
| Modified-DNA MD (CS3) | 116 | 12 | 7 | 0 |
| Docking campaign (CS4), June–July store | 178 | 381 | 85 | 4 |
| Docking campaign (CS4), earlier pilot store | 17 | 3 | 24 | 0 |
| Total | 317 | 411 | 116 | 4 |
| Type | Count | Example title |
|---|---|---|
| Scientific finding | 23 | “P2Rank restraints protocol yields superior scoring over experimental site restraints” |
| General observation / correction | 40 | “Mutations are NOT additive: a single-residue variant shifts the binding mode and proves context-dependence” |
| Failure pattern | 14 | “cmrest blind docking unreliable: 30+ point variation from input conformation bias” |
| Error resolution | 16 | “Template-built peptide PDBs have garbage geometry from hardcoded offsets” |
| Parameter guidance | 13 | “Always use max walltime for cpucourt partition (72h)” |
| Success pattern | 10 | “N-terminal ALA extension outperforms C-terminal: AIR-free vs parent” |
| Memory off | Memory on | Oracle | ||||
|---|---|---|---|---|---|---|
| Task | ds | kimi | ds | kimi | ds | kimi |
| Docking-configuration recall (10 checks) | 1, 4 | 4, 4 | 10, 10 | 10, 10 | 10, 10 | 10, 10 |
| Covalent-docking protocol recall (13 items) | 1, 1 | 0, 1, 1 | 13, 13 | 12, 12 | 13, 13 | 13, 13 |
| Warhead production conventions (2 runs per cell) | 0/2 | 0/2 | 2/2 | 2/2 | 2/2 | 2/2 |
| Flexible-residue range (1 value per run) | 0/5 | 1/3 | 3/3 | 2/2 | 3/3 | 2/2 |
| Operation | Measurement |
|---|---|
| Session boot (scan, handover merge, context) | 34–109 s, dominated by the store scan and the handover merge |
| Memory retrieval ( memory_get_context ) | 8–13 s; over 90% in two model calls (re-ranking); local scoring 50–700 ms |
| Distillation call | 1–6 s per call (small model) |
| Model volume for memory maintenance | 1.6 M tokens in one month (about 2,900 calls), busiest project |
| Store size, session logs included | below 20 MB (largest project); boot context below 35 KB |
| Replay run cost | 0.034 per run, flash-tier API pricing |
| System | bp | atoms | OPC waters | Na + | Cl - | / Å 3 | edge / Å |
| 5-CAC | |||||||
| XCD seq1 | 20 | 51606 | 12564 | 58 | 20 | 442198 | 95.0 |
| XCD seq2 | 22 | 73254 | 17943 | 62 | 20 | 616951 | 106.3 |
| XCD seq3 | 24 | 73010 | 17849 | 66 | 20 | 617316 | 106.3 |
| XCD seq4 | 26 | 88414 | 21667 | 70 | 20 | 741914 | 113.1 |
| XCD seq5 | 28 | 111330 | 27363 | 74 | 20 | 922901 | 121.7 |
| Stage | Ensemble | Length | Restraints | Thermostat / Barostat | Output |
|---|---|---|---|---|---|
| (kcal mol -1 Å -2 ) | |||||
| min1 | — | 5000 cycles | 500 | — | every 50 steps |
| min2 | — | 5000 cycles | none | — | every 50 steps |
| heat | NVT | 100 ps | 10 | Langevin ( ps -1 ), | 1 ps coords, |
| ( ntb=1 ) | (50 000 steps) | linear 0 300 K; ntx=1 , irest=0 | 10 ps restart | ||
| equil | NPT | 100 ps | 2 | 300 K, 1 atm |
| Class | Entries | First | Last | Promoted rule | After rule |
|---|---|---|---|---|---|
| cluster-trust | 4 | 06-01 | 06-18 | – | – |
| oom | 4 | 06-01 | 06-01 | 06-01 | 0 |
| output-collision | 6 | 06-01 | 06-16 | – | – |
| p2rank | 2 | 06-01 | 06-01 | – | – |
| tooling | 6 | 06-01 | 06-17 | – | – |
| transfer | 17 | 06-01 | 07-13 | – | – |
AI Agents for Scientific Discovery
AI agents for scientific discovery use language models, tools, and experiments to generate, test, and refine scientific knowledge.
See all 288 papers