Agent skill for choosing active spaces with AEGISS

Open
#111 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@robertodr is already working on this.

Since Oct 30, 2026.

  • #120 by @robertodr — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
python

Research direction

Start by reading the proposed order of work and the linked documentation and API pages; the first step requires an interview with the AEGISS authors, and a linked open pull request (#120) shows work is already underway. The scope spans documentation, bundled skill files, CLI installation and link rewriting, CI checks, and evaluations across six scenarios. Done means the documented workflow and reference files, distribution and checks, and evaluation sign-off all meet the stated pass bar.

Written by the indexing model from the issue text.

Description

documentation enhancement

🤖 AI text below 🤖

Motivation

More and more users drive their analyses through coding agents (Claude Code, Codex, pi, …). An agent left alone with AEGISS copies the quick start and keeps its defaults. It doesn't apply the judgement that makes the selection good: sizing the DMRG window, keeping the high-entropy orbitals away from its edges, choosing thresholds and ao_labels, the canonical vs localized window caveat, spin-summed vs spin-resolved entropies for UHF, and the index base. An agent skill can encode that judgement as ordered steps with checks between them, and make AEGISS easier to adopt.

Audiences, in priority order:

  • A. Computational chemists using an agent to choose an active space for their molecule.
  • B. Agents or developers adding AEGISS to a larger pipeline.
  • C. People evaluating AEGISS (what it is, how it compares with AVAS and AutoCAS, when to use it).
Proposed feature

One aegiss skill. SKILL.md holds branch A as an ordered workflow, and branches B and C are disclosed reference files.

Single source of truth

Every chemistry rule and API fact lives once, in the docs. The skill holds the steps, their checks and links to the versioned docs pages (https://algorithmiq.github.io/AEGISS/latest/…, rewritten to /X.Y/ or /dev/ at install time).

The rules that are not written down yet come from an interview with the AEGISS authors and go into a new docs page, Choosing parameters (docs/parameters.md, in the mkdocs.yml nav), plus small edits to index.md / uhf.md where a rule belongs there. The interview fills every [interview] value below and the expected outcomes of the evaluation scenarios, and asks what new users get wrong. The interview notes are not committed; only the rules that come out of them are.

SKILL.md: the workflow (branch A)

Description (draft): "AEGISS active-space selection (DMRG entropy screening + AO projection). Use when choosing an active space or CAS for a molecule, adding AEGISS to a pipeline, or comparing AEGISS with AVAS/AutoCAS."

select_aegiss reruns DMRG on every call, so the staged workflow runs run_dmrg_subprocess once, keeps the entropies and re-screens with select_by_entropy / select_by_spin_entropy and select_by_ao_projection(restricted_space=…). select_aegiss appears only in the hand-off script.

  1. Environment. aegiss imports, block2main is on PATH, and MEM, SCRATCH_DIR and OMP_NUM_THREADS are set. The skill's aegiss-version matches aegiss.__version__; if not, the agent suggests reinstalling the skill. Check: a short smoke run succeeds.
  2. Frame the chemistry. Process of interest, charge and spin, reference (RHF/ROHF/UHF), expected CAS size, candidate ao_labels. Ask the user for what can't be worked out; suggest MolTagger for clusters. Check: an expected CAS(n,m) range and a draft label set are written down.
  3. SCF. Check: converged; ⟨S²⟩ checked for UHF; canonical vs localized decided (if localized, step 4 also checks that the window contains the orbitals of interest).
  4. Projection-only probe (seconds, no DMRG): select_by_ao_projection on the full space plus mo_ao_contributions. Check: the number and composition of candidates match step 1; otherwise the labels are revised before any DMRG.
  5. Cheap DMRG. ncas ≈ [interview]× the expected CAS, max_bond_dim = [interview], entropies kept. Check: every orbital above τ_E is at least [interview] orbitals from the window edge; otherwise widen the window and repeat.
  6. Screen and project on the saved entropies, tuning fraction / contribution / top_n. Check: the final set has a sensible electron count and stays the same under a small change of threshold ([interview]).
  7. Production or hand-off. If ncas or the bond dimension is above [interview], write a select_aegiss script with the tuned parameters and how they were chosen, and stop. Otherwise run it.
  8. Report. CAS(n,m), indices in the user's base (to_display_all), saved orbitals and plots, caveats.

Other entry points: a user who brings existing entropies or outputs starts at step 5; branches B and C go straight to their reference file.

Reference files
  • parameters.md (branch A, opened from steps 1, 4 and 5). Decision tables: window size per system class, cheap and production bond dimension, fraction/fraction_type, contribution vs top_n, global vs subset ranking, typical ao_labels (π systems, 3d metals, bond breaking, lone pairs). Each row is a rule plus a docs link.
  • integration.md (branch B). Public entry points and return types, the RHF array vs UHF {"alpha", "beta"} split, 0-based indices internally vs AEGISS_ORB_BASE at boundaries, block2main as a subprocess (PATH, SCRATCH_DIR, MEM, cleanup), and a minimal "mf in, CASSCF out" pattern. API details link to the api/ pages instead of being copied.
  • overview.md (branch C). The six steps in short, the relation to AVAS and AutoCAS, when AEGISS is a poor fit (from the interview), and the citation requirement, linking to index.md and citing.md.
Distribution
  • Location. The source of truth is src/aegiss/skill/ (SKILL.md, parameters.md, integration.md, overview.md). Hatchling already ships it in the wheel.
  • Repo install. skills/aegiss → ../src/aegiss/skill is a symlink, so npx skills add Algorithmiq/AEGISS works. To verify: whether the skills CLI follows symlinks or finds SKILL.md anywhere in the repo. If it does neither, copy the files and add a prek sync check.
  • New CLI subcommand next to config in aegiss/cli.py:
    • aegiss skill path prints the location of the bundled skill.
    • aegiss skill install [DIR] [--agent claude|codex|pi] [--project] [--force] copies the skill. It defaults to ./.agents/skills/aegiss; the folder for each agent is confirmed against that agent's documentation. It rewrites /latest/ to /X.Y/ (or /dev/ for .devN builds), stamps aegiss-version in the frontmatter, and won't overwrite an existing skill without --force.
  • Docs. A "Using AEGISS with coding agents" section in installation.md (or its own page if it grows) and one line in the README.md documentation list.
Checks in CI (existing just recipes)
  • just doctest also covers src/aegiss/skill/*.md: snippets that need DMRG are notest, and the cheap ones (SCF, projection-only probe) run.
  • The lychee link check covers the skill files.
  • tests/test_cli.py covers installing into a temporary directory, link rewriting (0.1.0 → /0.1/, 0.2.0.dev3 → /dev/), the --force guard and the version stamp.
  • A wheel test checks that aegiss/skill/SKILL.md is in the package.
Evaluation

tools/skill-evals/ (tracked, not shipped, not in CI) contains:

  • scenarios.md: the prompt, starting files, expected outcome (from the interview) and rubric for each scenario:
    1. Benzene π (RHF): CAS(6,6) expected; geometry in docs/tutorials/data/.
    2. N₂ at a stretched geometry: bond breaking.
    3. A small 3d transition-metal complex: Fe 3d-style labels and the hand-off script.
    4. A UHF radical (allyl or a triplet): spin-summed vs spin-resolved choice.
    5. Branch B: "add AEGISS selection into my pipeline that takes an mf and returns a CASSCF object".
    6. Branch C: "how is AEGISS different from AVAS, and should I use it for X?"
  • results.md: scenario × {baseline, with skill} × date / AEGISS version / agent.

Rubric (each item passes or not):

  • Outcome: the final space is an acceptable one (for scenario 3: a correct hand-off script).
  • Process: probe before DMRG, window margin checked, nothing run above the hand-off threshold, the UHF entropy choice justified.
  • Correctness: the code runs, and indices are reported in the user's base.
  • Branch B: RHF and UHF return types handled, block2main/scratch requirements stated.
  • Branch C: accurate claims, citation mentioned.

Each run is a fresh session with the same model, once without and once with the skill; the baseline is recorded before the skill is written. Pass bar: every rubric item passes on all six scenarios with the skill, and the baseline shows the skill made a difference. The evals are rerun when the skill files or the public API change (the PR template gets a reminder line for this). One AEGISS author signs off on the skill PR, with the results attached.

Order of work
  1. Author interview → Choosing parameters page and doc edits (own PR).
  2. Baseline evaluation without the skill (tools/skill-evals/).
  3. Skill files in src/aegiss/skill/.
  4. aegiss skill CLI, repo path, CI checks, docs (can share a PR with 3).
  5. Evaluation with the skill, author sign-off, release.
Affected area

Configuration and CLI; Documentation and tutorials.

Additional context

Approaches considered: three separate skills (run / integrate / explain) were rejected because they mean three descriptions loaded every turn and overlapping content. A thin skill on top of llms.txt was rejected because the ordered steps and checks, which are the point of the skill, would end up spread across the docs.

Out of scope here, tracked as follow-ups:

  • #108 — let select_aegiss reuse precomputed entropies
  • #109 — llms.txt for the documentation site
  • #110 — Claude Code plugin marketplace entry
Dominant language
Python
Stars
0
Forks
0
Avg merge
19h 42m
Merged PRs (30d)
33

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Algorithmiq/AEGISS

All issues in Algorithmiq/AEGISS

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.