Skip to main content

Chemist AI Agent for Inverse Design of Materials with Natural Language Prompts

Project description

dZiner

Tests License

An agentic framework for rational inverse design of materials by replicating and incorporating the expertise of human domain experts across various design tasks and target properties.

The model starts by inputting the material's initial structure as a textual representation. The AI agent dynamically retrieves design guidelines for Property X from scientific literature, the Internet or other resources. Based on these domain-knowledge of guidelines, and any additional design constraints provided in natural language, the agent proposes a new candidate and assesses its chemical feasibility in real-time. Next, it estimates Property X for the new candidate, incorporating epistemic uncertainty, using a cost-efficient surrogate model. Optionally, as part of a human-in-the-loop process, the human chemist can review the agent's new candidates and chain-of-thoughts, providing feedback and suggesting further modifications or constraints, creating an opportunity for human-AI collaboration to guide the exploration process. The agent continues exploring the chemical space, guided by chemistry-informed rules, until it meets the convergence criteria.

Human-in-the-loop Inverse Design

Collaborative efforts between a human expert and AI agents hold significant promise. In the case of molecular design for WDR5 ligands, we examined human guidance to refine the modifications based on docking scores and structural generation.

https://github.com/user-attachments/assets/01ee84a4-0357-4b9c-9305-2258304340a2

Closed-loop Inverse Design

We applied dZiner to the rational inverse design of likely synthesizable organic linkers for metal-organic frameworks with high CO2 adsorption capacity at 0.5 bar of pressure. These MOFs come with pcu topology and three types of inorganic nodes: Cu paddlewheel, Zn paddlewheel, and Zn tetramer (three most frequent node-topology pairs in the hMOF dataset). Design constraints such as keeping molecular weight lower than 600 g/mol and excluding certain potentially unstable functional groups (nitrosylated, chloro-, fluoro- amines) are simply added to the model as natural language text.

How Can I Use dZiner for My Own Materials Inverse Design Problem?

dZiner can work with different textual representation for materials. You can even apply your own surrogate model to your own materials inverse design problem. Here are some example notebooks that can help you get started:

Installation

Note that with GPU installation, the domain-knowledge tool that uses RAG becomes faster.

Installation (GPU)

You can clone the source code and install in developer mode:

conda create -n dziner python=3.11.9
conda activate dziner

git clone https://github.com/mehradans92/dziner.git && cd dziner
pip install -e .
conda install -c pytorch/label/nightly -c nvidia faiss-gpu=1.8.0
python -m ipykernel install --user --name dziner --display-name "dziner"

Installation (CPU)

If you do not have a gpu in your machine (OSX for example) you will need to execute the following instead:

conda create -n dziner python=3.11.9
conda activate dziner

git clone https://github.com/mehradans92/dziner.git && cd dziner
pip install -e .
conda install -c pytorch/label/nightly faiss-cpu
python -m ipykernel install --user --name dziner --display-name "dziner"

Surrogate Models

Make sure you follow additional installation of packages for different surrogate models. Requirements can be found in each folder.

cd dziner/surrogates/YOUR_MODEL_OF_INTEREST
pip install -r requirements.txt

Adding an API Key

If you are using closed-source LLMs from OpenAI or Anthropic, you will need to have a valid OPENAI_API_KEY or ANTHROPIC_API_KEY. If you are on a windows machine you can add keys in your Environment Variables. For linux systems set the key by adding this line to ~/.bashrc:

export OPENAI_API_KEY=your_openai_api_key
export ANTHROPIC_API_KEY=your_anthropic_api_key

If you are using the jupyter notebook examples in this repo you may need to restart your kernel after adding the key to your environment

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dziner-0.1.tar.gz (36.7 kB view details)

Uploaded Source

Built Distribution

dziner-0.1-py2.py3-none-any.whl (39.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dziner-0.1.tar.gz.

File metadata

  • Download URL: dziner-0.1.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for dziner-0.1.tar.gz
Algorithm Hash digest
SHA256 774d63e71e854a3f13ef9acc303fee22dd42777a64b6962f7d415a518440bae0
MD5 cfad702044961626e10eff27e8062dee
BLAKE2b-256 69c4a32fafd3a7a98a531c8203257fbef1d58f1706712881310ffbedc87c2887

See more details on using hashes here.

File details

Details for the file dziner-0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: dziner-0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 39.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12

File hashes

Hashes for dziner-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 169d9da0d74732487b729944a4195ac2ee5cc535318e36bdce265685d6963922
MD5 1b0e4846c6cd805c30f6ed897d5f735d
BLAKE2b-256 1808c9a8e48da9f2b0dc98466c57f2cdd21f5ff23c8eca16d6eeeaeb85d56b85

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page