English | 中文
EMolAgent is an LLM-based computational chemistry AI assistant that integrates molecular cluster computation (structure construction & optimization + electronic property prediction) and RAG literature Q&A.
Watch the edited demonstration (1:08) · Original English recording, unedited (7:26)
The videos are freely accessible without a GitHub account. For offline viewing, open the edited MP4 or the original English MP4.
- EMolAgent
EMolAgent supports Chinese and English interfaces. You can switch languages anytime within the app:
- How to switch: Use the language selector (🌐) in the login page or the top-right corner of the sidebar
- Preference persistence: Your language choice is saved in cookies and restored on your next visit
- Coverage: UI text, model system prompts, and visualization components all support both languages
EMolAgent/
├── src/emolagent/ # Main package
│ ├── app.py # Streamlit main application
│ ├── core/ # Core modules
│ │ ├── cluster_factory.py # Molecular cluster construction
│ │ ├── uma_optimizer.py # UMA structure optimization
│ │ └── tools.py # LangChain tools
│ ├── database/ # Database module
│ │ └── db.py # User and session management
│ ├── knowledge/ # RAG knowledge base module
│ │ └── knowledge_base.py # Literature Q&A system
│ ├── visualization/ # Visualization module
│ │ └── mol_viewer.py # 3D molecular visualization
│ └── utils/ # Utility modules
│ ├── config.py # Configuration management
│ ├── i18n.py # Internationalization (Chinese/English)
│ ├── logger.py # Logging configuration
│ └── paths.py # Path management
├── config/ # Configuration directory
│ └── settings.yaml # Main config file
├── resources/ # Resource files
│ ├── models/ # Model weights
│ └── db/ # Database files
├── data/ # ChromaDB vector database
├── users/ # User data directory
├── run.py # Launch script
└── pyproject.toml # Project configuration
- Python 3.10
- CUDA 12.8 (for GPU acceleration)
- Conda package manager
- Linux 64bit
Docker allows quick deployment of EMolAgent without manually installing complex dependencies.
- Docker and Docker Compose
- NVIDIA GPU driver
- NVIDIA Container Toolkit
# Install NVIDIA Container Toolkit (Ubuntu)
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart dockergit clone https://github.com/HayesYu/EMolAgent.git
cd EMolAgent# Create models directory
mkdir -p resources/models
# Place model files in resources/models/:
# - uma-m-1p1.pt (apply at https://huggingface.co/facebook/UMA)
# - Electronic structure inference weight file (You can obtain it from https://drive.google.com/drive/folders/17u1Ex9FNi0lza2Kc0vjP4fU-NssIlO-2?usp=drive_link)
# This version is for testing purposes only; the latest version has not yet been released.# Required: Google API Key
export GOOGLE_API_KEY="your-google-api-key"
# Required: Multiwfn
# Download Linux 64bit noGUI version from http://sobereva.com/multiwfn/ (See the manual installation section for details.)
export MULTIWFN_PATH="/path/to/Multiwfn_2026.1.12_bin_Linux_noGUI"
# Optional: RAG literature directory
export LITERATURE_PATH="/path/to/your/literature"# Build image (takes time on first run)
docker-compose build
# Start service
docker-compose up -d
# View logs
docker-compose logs -fOpen http://localhost:8501 in your browser
| Mount Path | Purpose | Required |
|---|---|---|
./data |
ChromaDB + SQLite data | Yes (auto-created) |
./users |
User task output | Yes (auto-created) |
./logs |
Log files | Yes (auto-created) |
./resources/models |
Model files | Yes (must be pre-placed) |
./config/settings.yaml |
Custom config | No |
$MULTIWFN_PATH |
Multiwfn binary | Yes (must be pre-placed) |
$LITERATURE_PATH |
RAG literature | No |
# Stop service
docker-compose down
# Restart service
docker-compose restart
# Check container status
docker-compose ps
# Enter container for debugging
docker-compose exec emolagent bashconda create -n EMolAgent python=3.10
conda activate EMolAgentpip install fairchem-core==2.12.0
pip install torch_geometric
pip install torch_scatter torch_sparse torch_cluster torch_spline_conv pyg_lib -f https://data.pyg.org/whl/torch-2.8.0+cu128.htmlgit clone https://github.com/HayesYu/EMolAgent.gitgit clone https://github.com/Franklalalala/DeePTB.git
cd DeePTB/
git checkout onehotRemove version constraints for scipy and lmdb in pyproject.toml, then install:
pip install .
cd ..git clone https://github.com/Franklalalala/EMolES.git
cd EMolES/
git checkout dev
pip install -e .
cd ..git clone https://github.com/Franklalalala/learn_qh9.git
cd learn_qh9/
pip install .
cd ..git clone https://github.com/deepmodeling/dftio.git
cd dftio/Remove version constraints for scipy, torch, lmdb, torch-scatter in pyproject.toml, then install:
pip install .
cd ..git clone https://github.com/Franklalalala/ai4mol.git-
Download Linux 64bit (noGUI version) from Multiwfn official site
-
Extract and configure:
unzip Multiwfn_2026.1.12_bin_Linux_noGUI.zip
cd Multiwfn_2026.1.12_bin_Linux_noGUI/- Configure environment variables. Edit
~/.bashrc:
vim ~/.bashrcAdd the following:
ulimit -s unlimited
export Multiwfnpath=/path/to/Multiwfn_2026.1.12_bin_Linux_noGUI
export PATH="$Multiwfnpath:$HOME/bin:$PATH"- Apply configuration and set permissions:
source ~/.bashrc
conda activate EMolAgent
chmod +x /path/to/Multiwfn_2026.1.12_bin_Linux_noGUI/Multiwfn- Edit
settings.ini:
vim settings.iniSet nthreads to 64 (or adjust based on your CPU cores):
nthreads=64cd ..# Install MOKIT
conda install mokit -c mokit -c conda-forge -y
# Install system dependencies
sudo apt install -y libcairo2-dev pkg-config python3-dev
# Install RDKit
conda install -c conda-forge rdkit
# Install EMolAgent and its Python dependencies
cd EMolAgent/
pip install -e .-
Apply for
uma-m-1p1.ptmodel access at Hugging Face UMA -
Place
uma-m-1p1.ptinEMolAgent/resources/models/ -
Apply for electronic structure inference weight file access at Google Drive nnenv
Note: This file is for testing purposes only; the latest version has not yet been released.
-
Place electronic structure inference weight file in
EMolAgent/resources/models/
The project uses a YAML config file for centralized parameter management at config/settings.yaml.
Main configuration items:
| Category | Key | Description |
|---|---|---|
database |
solvent_db, anion_db |
Molecular database file paths |
models |
inference_model, uma_checkpoint, uma_model_name |
Model paths and names |
gpu |
available_gpus, max_tasks_per_gpu |
GPU device list and concurrent task limits |
logging |
max_log_size, backup_count |
Log file size and backup count |
visualization |
max_preview_structures |
Max number of structures in preview |
auth |
admin_users |
Admin usernames |
knowledge |
literature_path, collection_name |
Literature path and collection name |
molecules |
default_dme_smiles, default_fsi_smiles |
Default molecule SMILES |
output |
uma_workspace |
Optimizer output directory |
Restart the application after config changes. You can also set EMOL_CONFIG_PATH to use a custom config path.
Register your Google API Key at Google AI Studio
cd /path/to/EMolAgent/
export GOOGLE_API_KEY="Your Google API KEY"
# Option 1: Use launch script (recommended)
python run.py
# Option 2: Run Streamlit directly
streamlit run src/emolagent/app.py-
Place PDF files in the configured literature directory (
knowledge.literature_pathinconfig/settings.yaml) -
Add your username to
auth.admin_usersinconfig/settings.yaml -
After launching, click "Rebuild Index" in the sidebar to use RAG
ESP visualization requires cube files generated by Multiwfn. To enable:
-
Change
gen_esp_cube_flag: bool = FalsetoTrueinEMolES/src/emoles/inference/infer_entry.py -
Ensure Multiwfn is installed and environment variables are configured
To modify default parameters (e.g., GPU concurrency, admin list, model paths), edit config/settings.yaml.
Example:
# Modify GPU config
gpu:
available_gpus: [0, 1, 2, 3] # Use 4 GPUs
max_tasks_per_gpu: 3 # Max 3 concurrent tasks per GPU
# Add admins
auth:
admin_users:
- "hayes"
- "your_username"
# Modify literature path
knowledge:
literature_path: "/your/custom/path/to/literature"This project is licensed under the MIT License.
Thanks to the following open-source projects:
