Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
b67bff0
Add MCP instructions for using ChemGraph MCP with OpenCode
tdpham2 Mar 10, 2026
303ca53
Add status to current OpenCode/MCP integration
tdpham2 Mar 10, 2026
0dc658e
Initial push for ChemGraph-RAG agent
tdpham2 Mar 13, 2026
d690427
Add a demo for Rag-agent using Argo
tdpham2 Mar 13, 2026
93b6282
Merge pull request #96 from argonne-lcf/main
tdpham2 Mar 13, 2026
038f9da
Fix lintting
tdpham2 Mar 13, 2026
cd3d63f
Merge pull request #98 from argonne-lcf/dev-rag
tdpham2 Mar 13, 2026
84f9012
Increase max character limit for title
tdpham2 Mar 16, 2026
cde7e2d
Update llm_agent to write to database
tdpham2 Mar 16, 2026
a29f43c
Add CLI for memory-related functions
tdpham2 Mar 16, 2026
3b7447b
Add an example for memory-related operations
tdpham2 Mar 16, 2026
c5fca55
Update documentations
tdpham2 Mar 16, 2026
c5fbf1d
Add tests for creating and logging session
tdpham2 Mar 16, 2026
0761c2e
Add test for memory
tdpham2 Mar 16, 2026
6506af2
Merge pull request #101 from argonne-lcf/dev-memory
tdpham2 Mar 16, 2026
a2ae6a4
Update how log_dir is initialized
tdpham2 Mar 23, 2026
2b78a90
remove deepdiff from pyproject.toml
tdpham2 Mar 23, 2026
40924f3
Update vibrational analysis output to avoid overwritten files
tdpham2 Mar 23, 2026
caf7ae0
Update CLI for evaluation
tdpham2 Mar 23, 2026
e2119e5
Update default tools for single_agent
tdpham2 Mar 23, 2026
22e9b00
Update chemgraph.eval module
tdpham2 Mar 23, 2026
3b045ac
Merge pull request #105 from argonne-lcf/dev-eval
tdpham2 Mar 23, 2026
a533a0f
Add instructions for using OpenCode + ChemGraph MCP tools on Aurora
tdpham2 Mar 23, 2026
da9379e
Rename examples to chemgraph_opencode
tdpham2 Mar 23, 2026
d1694dd
Merge pull request #94 from argonne-lcf/dev-opencode
tdpham2 Mar 23, 2026
aa0760f
Add evaluation documentations
tdpham2 Mar 26, 2026
5593209
Update config.toml for evaluation
tdpham2 Mar 26, 2026
10a52e2
Merge pull request #106 from argonne-lcf/dev-eval
tdpham2 Mar 26, 2026
3b03cd6
Add XANES tools and update single-agent graph logic
vitorgrizzi Feb 2, 2026
d32369d
fix dup bug
vitorgrizzi Feb 6, 2026
fe1266a
fix git bug
vitorgrizzi Feb 6, 2026
fcd7dcb
fix xanes tools
vitorgrizzi Feb 13, 2026
61990c0
fix parsl output
vitorgrizzi Feb 17, 2026
9d2e8d6
enhance xanes_tools.py integration
vitorgrizzi Feb 20, 2026
c3ec505
bug fix
vitorgrizzi Feb 20, 2026
fceda82
bug fix
vitorgrizzi Feb 27, 2026
6da4811
pickle fix
vitorgrizzi Feb 28, 2026
32235ab
fix atomsdata import
vitorgrizzi Feb 28, 2026
1daf6a8
fix xanes tools
vitorgrizzi Feb 28, 2026
f18e55a
file support to xanes
vitorgrizzi Mar 6, 2026
460b81d
AtomsData xanes docstring
vitorgrizzi Mar 6, 2026
bf79b5f
AtomsData xanes docstring fix
vitorgrizzi Mar 6, 2026
59038ad
fix xanes
vitorgrizzi Mar 6, 2026
359793a
fix type hinting
vitorgrizzi Mar 6, 2026
3552e70
rebase
vitorgrizzi Mar 26, 2026
48e78ca
Add XANES MCP server, refactor xanes_tools, and create single_agent_x…
tdpham2 Mar 27, 2026
2880dcf
Add Python>=3.11 version for mp_api
tdpham2 Mar 30, 2026
0049084
Update output from fetch_xanes_data and add plot_xanes_data to LangGr…
tdpham2 Mar 31, 2026
aac7b77
Update xanes graph
tdpham2 Mar 31, 2026
cc5c585
Add xanes mcp with Parsl tools
tdpham2 Mar 31, 2026
449a3b9
Add xanes mcp tools
tdpham2 Mar 31, 2026
079e81f
Add examples for ChemGraph running XANES via MCP tools
tdpham2 Mar 31, 2026
e4c4000
Add examples for ChemGraph running XANES via MCP tools with http tran…
tdpham2 Mar 31, 2026
9fabe2d
Remove argo_user and base_url from script
tdpham2 Mar 31, 2026
8a086f4
Merge pull request #107 from vitorgrizzi/main
tdpham2 Mar 31, 2026
5d2e762
Add missing loader.py for llm-judge
tdpham2 Mar 31, 2026
6f374cc
Move structured_output() to JSON via prompt
tdpham2 Apr 13, 2026
d7dc7c2
Update formatter agent output
tdpham2 Apr 13, 2026
7324967
Update evaluation pipeline to use structured output for evaluation
tdpham2 Apr 13, 2026
a42dd58
Update ground_truth data for evaluation and script to generate ground…
tdpham2 Apr 13, 2026
1b02004
Update ase input schema
tdpham2 Apr 13, 2026
fcc5121
Add structured_output option to CLI
tdpham2 Apr 13, 2026
561752d
Update structured_output to default evaluation mode
tdpham2 Apr 13, 2026
0b1fc19
Add structured_output_judrge
tdpham2 Apr 13, 2026
a0f8df6
Add retry to FormatterAgent
tdpham2 Apr 14, 2026
54c4a34
Add formatter_max_retries to agent initialization
tdpham2 Apr 14, 2026
0a8a5b1
Update evaluation logic when FormatterAgent fails
tdpham2 Apr 14, 2026
b7e2d3c
Add checkpointing to evaluation
tdpham2 Apr 16, 2026
6bef089
Add --resume option to config and cli to restart evaluation
tdpham2 Apr 16, 2026
5a4076f
Merge pull request #111 from argonne-lcf/dev-eval
tdpham2 Apr 17, 2026
6371f7b
Add thread lock to MACE
tdpham2 Apr 17, 2026
f61a41c
Refactor CLI into chemgraph.cli package, unify model routing, and fix…
tdpham2 Apr 22, 2026
5282399
Fix copy-paste bugs in Anthropic model loader and Argo model mapping
tdpham2 Apr 22, 2026
5040c10
Merge pull request #113 from argonne-lcf/dev-bugfix
tdpham2 Apr 22, 2026
7822dae
Fix linting
tdpham2 Apr 22, 2026
ce66256
Fix linting for examples/ and scripts/
tdpham2 Apr 22, 2026
4277336
Fix linting for tests/
tdpham2 Apr 22, 2026
b78cc98
Fix test_memory.py
tdpham2 Apr 22, 2026
403a6c9
Fix test memory for windows
tdpham2 Apr 22, 2026
338e72f
Move test-pypi to workflow dispatch only
tdpham2 Apr 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 92 additions & 0 deletions .github/workflows/dependency_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Dependency Tests

on:
push:
branches: [ toml_dev ]
pull_request:
branches: [ toml_dev ]

jobs:
test_install:
name: Verify Install (${{ matrix.install_extras }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
install_extras: [core, calculators, uma, ui, parsl, viz]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
if [ "${{ matrix.install_extras }}" == "uma" ]; then
# 1. Install the main package (installs mace-torch + old e3nn)
pip install .

# 2. FORCE UNINSTALL the conflicting packages
echo "💥 Forcefully removing mace-torch and e3nn for UMA compatibility..."
pip uninstall -y mace-torch e3nn

# 3. MANUALLY install the UMA dependencies
# (We cannot use pip install .[uma] because it would trigger the resolution error)
pip install "fairchem-core==2.13.0" "e3nn>=0.5"

elif [ "${{ matrix.install_extras }}" == "core" ]; then
pip install .
else
pip install ".[${{ matrix.install_extras }}]"
fi
- name: Verify Imports
run: |
python -c "
import importlib
import sys

def check_import(package_name):
try:
importlib.import_module(package_name)
print(f'✅ {package_name} imported successfully')
return True
except ImportError as e:
print(f'❌ {package_name} failed to import: {e}')
return False

extras = '${{ matrix.install_extras }}'
failures = []

# Core imports that should always work
core_packages = ['chemgraph']
for pkg in core_packages:
if not check_import(pkg):
failures.append(pkg)

# Mapping of extras to key packages they provide
extra_packages = {
'calculators': ['tblite'],
'uma': ['fairchem.core', 'e3nn'],
'ui': ['streamlit', 'stmol'],
'parsl': ['parsl'],
'viz': ['pyppeteer', 'grandalf', 'nest_asyncio']
}

if extras != 'core':
# Check packages for specific extra
if extras in extra_packages:
for pkg in extra_packages[extras]:
if not check_import(pkg):
failures.append(pkg)

if failures:
print(f'Failed to import: {failures}')
sys.exit(1)
else:
print('All expected packages active!')
"
18 changes: 9 additions & 9 deletions .github/workflows/test-pypi-package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Test PyPI Package

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: # Allow manual triggering
workflow_dispatch:
inputs:
version:
description: 'PyPI version to test'
required: true
default: '0.3.4'

jobs:
test-pypi-install:
Expand All @@ -28,12 +28,12 @@ jobs:

- name: Install chemgraphagent from PyPI
run: |
pip install --no-cache-dir --upgrade "chemgraphagent==0.3.0"
pip install --no-cache-dir --upgrade "chemgraphagent==${{ inputs.version }}"

- name: Verify package installation
run: |
python -c "import chemgraph; print('ChemGraph imported successfully')"
python -c "import ui; print('UI module imported successfully')"
python -c "from chemgraph.cli import main; print('CLI module imported successfully')"
# Test that CLI command is available
chemgraph --help || echo "CLI help command executed"

Expand All @@ -49,4 +49,4 @@ jobs:
- name: Check package version
run: |
pip show chemgraphagent
python -c "from importlib.metadata import version; v=version('chemgraphagent'); print('Installed:', v); assert v=='0.3.0', f'Expected 0.3.0, got {v}'"
python -c "from importlib.metadata import version; v=version('chemgraphagent'); print('Installed:', v); assert v=='${{ inputs.version }}', f'Expected ${{ inputs.version }}, got {v}'"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ test_outputs/

.venv
combine*

# OpenCode (user-local config; copy from opencode.example.jsonc)
opencode.json
chemgraph_mcp_logs/
vllm/
logs/
error_log.txt
Expand Down
84 changes: 84 additions & 0 deletions .opencode/opencode.example.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
// ChemGraph OpenCode MCP Configuration
//
// Copy this file to opencode.json and customize for your environment:
//
// cp .opencode/opencode.example.jsonc opencode.json
//
// Then set CHEMGRAPH_PYTHON to your ChemGraph Python interpreter:
//
// export CHEMGRAPH_PYTHON=/path/to/your/venv/bin/python
//
// For example:
// export CHEMGRAPH_PYTHON=env/chemgraph_env/bin/python # local venv
// export CHEMGRAPH_PYTHON=.venv/bin/python # standard venv
// export CHEMGRAPH_PYTHON=$(which python) # active environment
//
"$schema": "https://opencode.ai/config.json",
"mcp": {
// ── General chemistry tools ─────────────────────────────────────────
// Provides: molecule_name_to_smiles, smiles_to_coordinate_file,
// run_ase (energy/opt/vib/thermo/ir), extract_output_json
"chemgraph": {
"type": "local",
"command": [
"{env:CHEMGRAPH_PYTHON}",
"-m",
"chemgraph.mcp.mcp_tools"
],
"enabled": true,
"environment": {
"CHEMGRAPH_LOG_DIR": "./chemgraph_mcp_logs"
}
}

// ── Additional MCP servers (uncomment to enable) ────────────────────
//
// MACE + Parsl (HPC ensemble calculations)
// Requires: parsl, mace-torch, HPC environment
//
// "chemgraph-mace-parsl": {
// "type": "local",
// "command": [
// "{env:CHEMGRAPH_PYTHON}",
// "-m",
// "chemgraph.mcp.mace_mcp_parsl"
// ],
// "enabled": true,
// "environment": {
// "CHEMGRAPH_LOG_DIR": "./chemgraph_mcp_logs"
// }
// },
//
// gRASPA + Parsl (gas adsorption simulations)
// Requires: parsl, gRASPA binary, HPC environment
//
// "chemgraph-graspa-parsl": {
// "type": "local",
// "command": [
// "{env:CHEMGRAPH_PYTHON}",
// "-m",
// "chemgraph.mcp.graspa_mcp_parsl"
// ],
// "enabled": true,
// "environment": {
// "CHEMGRAPH_LOG_DIR": "./chemgraph_mcp_logs"
// }
// },
//
// Data analysis (CIF splitting, JSONL aggregation, isotherm plotting)
//
// "chemgraph-data-analysis": {
// "type": "local",
// "command": [
// "{env:CHEMGRAPH_PYTHON}",
// "-m",
// "chemgraph.mcp.data_analysis_mcp"
// ],
// "enabled": true,
// "environment": {
// "CHEMGRAPH_LOG_DIR": "./chemgraph_mcp_logs"
// }
// }
}
}
75 changes: 75 additions & 0 deletions DEPLOYMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ChemGraph Deployment Guide

This guide describes how to deploy ChemGraph using Docker. The deployment supports both an interactive Command Line Interface (CLI) and a JupyterLab environment.

## Prerequisites

- Docker
- Docker Compose (v2 or later recommended) (Optional, but easier)
- API Keys for Large Language Models (LLMs) (e.g., OpenAI, Anthropic, Gemini, Groq)

## Building the Docker Image

To build the Docker image locally:

```bash
docker build -t chemgraph:latest .
```

## Running the Application

### Option 1: Using Docker Compose (Recommended)

This method simplifies managing environment variables and volumes.

1. **Configure API Keys**: Create a `.env` file in the root directory (or ensure your environment variables are set in your shell).
```env
OPENAI_API_KEY=your_key_here
ANTHROPIC_API_KEY=your_key_here
GEMINI_API_KEY=your_key_here
GROQ_API_KEY=your_key_here
```

2. **Run CLI Interactively**:
```bash
docker-compose run --rm chemgraph-cli
```
This drops you into the ChemGraph interactive shell.

3. **Run JupyterLab**:
```bash
docker-compose up chemgraph-jupyter
```
Access JupyterLab at `http://localhost:8888`.

### Option 2: Using Docker CLI Directly

1. **Run CLI Interactively**:
```bash
docker run -it --rm \
-v "$(pwd):/app" \
-e OPENAI_API_KEY=$OPENAI_API_KEY \
chemgraph:latest
```
*Note: Add other API keys as `-e VAR_NAME=value` flags as needed.*

2. **Run JupyterLab**:
```bash
docker run -it --rm \
-p 8888:8888 \
-v "$(pwd):/app" \
chemgraph:latest \
jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root --LabApp.token=''
```

## Development

The `Dockerfile` and `docker-compose.yml` map the local directory to `/app` in the container. This means changes you make to the code locally are immediately visible in the container (for Python code, thanks to `-e .` editable install behavior, though `Dockerfile` uses standard install, mapping the volume overlays the source code).

### Rebuilding Dependencies

If you change `pyproject.toml` or `environment.yml`, you need to rebuild the image:

```bash
docker-compose build
```
Loading
Loading