Agentic site-occupancy optimizer for atomistic structures. Like a genetic algorithm over lattice sites, but an agent (guided by Skill.md) proposes Na/X swaps instead of GA operators. Structures are relaxed and scored with MatCalc via Main_scripts.py.
Use an environment with ASE and MatCalc (e.g. the postdoc env):
source /home/mahpe/envs/postdoc/bin/activate
cd /home/mahpe/Code/AgenticoptimizerFor the Cursor agent backend:
pip install cursor-sdk
export CURSOR_API_KEY="cursor_..."# Agent-driven optimization (reads config.toml + Skill.md)
python run.py --agent cursor
# Random-swap baseline (no LLM; useful to test the relax loop)
python run.py --agent random --max-iters 3
# Custom config / output
python run.py --config config.toml --out-dir runs/my_run --seed 1 --max-iters 20| Flag | Description |
|---|---|
--config |
Path to config.toml (default: ./config.toml) |
--skill |
Path to Skill.md |
--agent |
cursor (Skill.md + Cursor SDK) or random |
--model |
Cursor model id (default from config: composer-2.5) |
--max-iters |
Max agent swap steps |
--seed |
RNG seed for the initial occupancy |
--out-dir |
Output directory (default: runs/latest) |
cif_path/supercell_size— input structure[swap_params]— lattice element, swap species (Na/X), and composition ratio (X= vacancy)[relax_params]— MatCalc / ASE relaxation settings[agent_params]— iterations, swaps per step, model, skill path, output dir
Written under --out-dir (or agent_params.out_dir):
best.cif— lowest-energy structure foundstep_XXX.cif— structure after each accepted stepsummary.json— energies, occupancies, and swap historyrelaxation.traj— ASE trajectory from the latest relax