Skip to content

BattModels/ElyteAgent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ElyteOS / ElyteAgent

Version: 1.0.1 Authors: Yuhan Chen, Hongyi Lin, Tianyi Zhang, Venkatasubramanian Viswanathan License: MIT Paper: ElyteAgent: A Multi-Agent Workflow for Autonomous Electrolyte Experimentation Code & data: https://github.com/BattModels/ElyteAgent.git


Overview

This repository contains ElyteOS, the experiment orchestration and data-management layer for autonomous electrolyte research, together with the Agent module (src/Agent/) that implements ElyteAgent — a multi-agent, LLM-driven workflow for feasibility-aware autonomous electrolyte experimentation, described in the accompanying paper.

ElyteAgent coordinates three experimental/software infrastructures:

  • Clio — the robotic platform that prepares electrolyte samples by mixing predefined feeder solutions and measures transport properties (ionic conductivity, density, viscosity).
  • SALSA — an automated solubility-testing add-on that determines experimentally accessible salt concentration bounds via an excess-solvent, camera-monitored dissolution workflow.
  • ElyteOS (this repo) — the software layer that handles device control, experiment-token representation, inventory tracking, scheduling, logging, database storage, and visualization.

Rather than a single monolithic automation script, ElyteAgent divides an experimental campaign into four specialized LLM agents that translate natural-language scientific objectives into validated, executable, solubility- and inventory-constrained robotic experiments — recovering from tool-level and hardware-level errors along the way.


Software Architecture

ElyteAgent is organized around four agents (see Fig. 1 of the paper), implemented on top of LangGraph (v0.4.8) with GPT-4o-mini (snapshot 2024-07-18) as the underlying LLM:

Agent (paper) Log tag (code) Responsibility
Conversation Agent CONVERSATION_AGENT Parses natural-language requests into a structured electrolyte design space (solvents, salts, concentration bounds) and generates initial candidate compositions via hit-and-run sampling. Writes design-space metadata and composition tokens to the session file.
Manager Agent MONITOR_AGENT Validates candidate compositions from the Conversation or Optimization agent against feeder-solution inventory, remaining volume, and SALSA-derived solubility bounds. Rejects infeasible formulations, queues feasible ones, tracks Experiment Agent status, and stores completed results in the database.
Experiment Agent EXPERIMENT_AGENT Executes validated experiments through ElyteOS, routing to Clio (electrolyte prep/property measurement) or SALSA (solubility characterization). Maintains a status tracker (progress, results, equipment status, errors); retries failed steps and, if unrecoverable, reports to the Manager Agent — resuming from the last checkpoint once resolved rather than restarting.
Optimization Agent OPTIMIZATION_AGENT Proposes new candidate formulations from accumulated results using Bayesian Optimization (upper-confidence-bound acquisition function over a k-nearest-neighbors surrogate model), balancing exploration and exploitation. Runs until convergence, the requested trial count is reached, or feeder solutions are exhausted.

Every experiment is represented as a shared composition token:

solvent identities|solvent fractions|salt identities|salt molalities

e.g. H2O|100|NaNO3|5.39 — a 100% H₂O solvent with 5.39 mol/kg NaNO₃. This token, plus a shared session file (design space, sampled/queued/completed experiments, optimization state), lets all four agents exchange experiment definitions without manual translation.

Design-level errors (invalid tokens, missing solvents/salts, out-of-bound concentrations, insufficient inventory) are caught by the Manager Agent before anything reaches the hardware. Hardware-execution errors (device faults, communication failures, failed measurements) are caught by the Experiment Agent, which retries and, if needed, escalates while preserving state for resumption.


Project Structure

EEG-Clio-Database-master/
├── Main-backup.py
├── requirements.txt
├── License.txt / NOTICE.txt
└── src/
    ├── Main.py                    # Dash GUI entry point
    ├── Agent/                     # ElyteAgent: LLM multi-agent orchestration layer
    │   ├── Agent.py                #   agent graph (LangGraph), logging, Azure OpenAI setup
    │   ├── Tools.py                #   design-space / composition-ID tools (Conversation Agent)
    │   ├── Experiment_Tools.py     #   hardware-control tools (Experiment Agent)
    │   ├── BeysianOptimization.py  #   Optuna/BO-based optimizer (Optimization Agent)
    │   ├── JSONHelper/             #   system prompts + tool descriptions
    │   ├── Generated JSON/         #   saved experiment queues / session files
    │   └── conversation_history/   #   per-run agent execution logs
    ├── Equipment_Control/         # Serial/HID drivers for pumps, valves, balance,
    │                               # potentiostat, viscometer, thermometer, camera (Clio/SALSA hardware)
    ├── Database/                  # Solvent/salt molar mass tables, DB pipeline
    ├── Db/                        # SQLite databases
    ├── pspython/                  # PalmSens potentiostat Python bindings
    └── assets/                    # Dash static assets (logo, CSS)

Installation Instructions

Software Prerequisites

  • Operating System: Windows 10
  • Python Version: Python 3.8 or higher
  • (Agent layer only) An Azure OpenAI resource with a deployed chat-completion model (the published results use a GPT-4o-mini snapshot, 2024-07-18)

Installation steps

  1. Open a terminal and navigate to the project folder.
  2. Install the core (GUI + equipment control) dependencies:
    pip install -r requirements.txt
  3. Install the additional dependencies required by the Agent layer (not currently pinned in requirements.txt):
    pip install langchain langchain-core "langgraph==0.4.8" langchain-openai openai optuna opencv-python
  4. Locate your Python package install directory:
    pip show dash
    Look for the Location: line in the output and copy that path.
  5. Move the pspython folder into that install directory (needed for PalmSens potentiostat communication):
    move pspython /path/to/python/site-packages/
  6. Configure Azure OpenAI credentials for the Agent layer as environment variables before launching the app:
    set AZURE_OPENAI_ENDPOINT=https://<your-resource-name>.openai.azure.com/
    set AZURE_OPENAI_API_KEY=<your-key>
    or place them in a local .env file that is excluded from version control via .gitignore.

Usage

Key Features

  • End-to-end automated pipeline for lab equipment (Clio, SALSA) to conduct electrolyte experiments.
  • Natural-language experiment design, feasibility validation, execution monitoring, and error recovery via ElyteAgent.
  • Bayesian-optimization-driven, closed-loop suggestion of new experimental conditions (upper-confidence-bound acquisition on a k-NN surrogate).
  • Durable storage of all experiment data, metadata, and session state.
  • Data retrieval, filtering, and visualization through the GUI.

Running the GUI

  1. Open a terminal and navigate to the project folder.
  2. Run:
    python Main.py
  3. Open a browser to http://localhost:8050.

Run an experiment (ElyteAgent / conversational)

Instead of manually building a composition ID, describe the campaign in natural language — e.g. "Explore aqueous NaNO3 with molality ≤ 9 mol/kg and Li2SO4 with molality ≤ 2.5 mol/kg" — and:

  1. The Conversation Agent infers H₂O as the (fixed, 100%) solvent, sets NaNO₃/Li₂SO₄ as design variables with the given bounds, and hit-and-run samples initial candidate compositions into the session file.
  2. The Manager Agent checks each candidate against feeder-solution inventory and SALSA-derived solubility limits, rejecting infeasible formulations (e.g. two salts that numerically fit their own bounds but together exceed available feeder volume) and queuing the rest.
  3. The Experiment Agent runs the physical Clio/SALSA sequence (prepare → start_new_experiment → make_solvent → measure_mass → measure_conductivity → measure_viscosity → measure_temperature → finish_measurement, or the solubility variant: add_salt → add_solvent → stir_liquid → detect_dissolution_status), reporting results or surfacing hardware errors (e.g. "Vial cannot be detected") for you to resolve — you can then say "Please resume the experiment" to continue from the last checkpoint rather than starting over.
  4. The Optimization Agent uses completed results to propose the next batch of candidate compositions, closing the loop until convergence, the requested trial count, or feeder-solution exhaustion.

Agent conversations and tool calls are logged per-run under src/Agent/conversation_history/, and each generated experiment queue / session file is saved as timestamped JSON under src/Agent/Generated JSON/.

Acknowledgements

This work was supported by the Toyota Research Institute.

License

The code is licensed under MIT.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors