Skip to content

feat: birth autofit_assistant — the generic inference assistant #1

Description

@Jammy2211

Overview

Birth autofit_assistant: the PyAutoFit AI Assistant, following the proven autolens_assistant pattern (AGENTS.md canonical + skills + wiki + science-project machinery), paired to PyAutoFit + autofit_workspace. The defining inversion versus the lensing assistant: the user brings their own scientific domain, so domain adaptation (paper ingestion, likelihood wrapping, model composition) is the first-class first-run experience rather than an afterthought.

Launch decisions (human, 2026-07-10, in-session): repo born public; skeleton hand-authored with the clone-v1 plan as a file-inventory checklist only; worked demos are the canonical 1D Gaussian + an SNe cosmology distance-modulus fit on open data.

Plan

  • Phase 0 — birth + skeleton (direct to main; an empty repo cannot take a PR for its first push): README, LICENSE, AGENTS.md/CLAUDE.md, modes/, config/, Makefile, activate.sh, sources.yaml, wiki scaffolding, safety invariants generalised for inference.
  • Phase 1 — workspace pairing: port the autoassistant/ package (API audit + gate, refresh_api_docs, to_notebook, citation currency, benchmark runner) with af_ naming; first tranche of af_* skills grounded in autofit_workspace/scripts/.
  • Phase 2 — core statistics wiki: priors, model composition, per-sampler pages (matched to the installed PyAutoFit roster), nested sampling, MCMC/HMC, initialization/chaining, EP & graphical models, evidence/model comparison, samples/aggregator.
  • Phase 3 — domain adaptation + demos: af_adapt_to_domain onboarding driving paper ingestion, likelihood wrapping (Analysis-class generation around user code), and model composition; start-new-project; the two worked demos.
  • Phase 4 — parity + publish gate: benchmarks with card↔README parity, teacher mode anchored to HowToFit, HPC link, llms.txt, smoke/citation CI, Heart newborn_validation checklist.

Phases 1–4 each end at PR-open per the autonomy contract; merge stays human.

Detailed implementation plan

Affected Repositories

  • autofit_assistant (primary — new, develops in-place)
  • autofit_workspace (read-only grounding for skills)
  • PyAutoFit / PyAutoConf (read-only; sources.yaml clones @ main)
  • autolens_assistant (read-only reference; its benchmark-calibration worktree claim untouched)

Branch Survey

Repository Current Branch Dirty?
./autofit_assistant (empty, new) n/a

Branch model: Phase 0 lands directly on main (birth commits — empty repos cannot receive PRs). Phases 1–4 on feature/afa-phase-<n>-<slug> branches, PRs into main, stacked if a prior phase's PR is unmerged.

Implementation Steps

Phase 0 (main):

  1. README.md — what the assistant is, quickstart, the domain-adaptation pitch (agentic-AI-first framing per docs doctrine; no llms.txt mechanics in user prose).
  2. AGENTS.md — canonical instructions: session-start ritual (maintainer-mode check, wiki/project/profile.md calibration, API drift-check), safety invariants (code gate, never write into output//sources/, wiki/core/ read-only, source-edit boundary, never rewrite history; the real-data gate generalises to "plot/inspect the user's dataset before first fit"), the three-layer model (instructions/skills/wiki).
  3. CLAUDE.md (@AGENTS.md stub), .gemini/settings.json pointer.
  4. modes/{assistant,teacher,maintainer}.md — teacher anchors to HowToFit.
  5. config/, Makefile, activate.sh, sources.yaml (PyAutoFit, PyAutoConf, autofit_workspace @ main), .gitignore (output/, sources/, pycache, .maintainer), LICENSE (family-standard).
  6. wiki/{core,literature,project}/ scaffolding — literature ships near-empty by design with schema AGENTS.md (grown per-user during domain adaptation); skills/ dir with _style.md + _bootstrap_skill.md meta-skills.

Phase 1 (PR):

  1. Port autoassistant/ → audit_skill_apis.py (+ PreToolUse gate hook + self-enforcement path for non-hook harnesses), refresh_api_docs.py, to_notebook.py, literature.py --check-citations (incl. fifth wiki-currency leg), benchmark.py, tests.
  2. First af_* skills grounded against autofit_workspace/scripts/{overview,cookbooks,features,searches,model,plot,simulators}: setup_environment, compose_model, configure_search, run_search, chain_searches, load_results, custom_analysis, simulate_dataset, plot_fit, debug_fit_failure, to_notebook, audit_skill_apis, refresh_api_docs, update_wiki.
  3. API audit green against installed stack before PR.

Phase 2 (PR):

  1. wiki/core/concepts/: bayesian-inference, model-composition-and-priors (incl. sigma=0 point-mass idiom, latent variables), non-linear-search overview, one page per shipped sampler family (roster audited from installed PyAutoFit at write time), nested-sampling, mcmc-and-hmc, initialization-and-chaining, sampler-benchmarks, graphical-models-and-ep, evidence-and-model-comparison, samples-and-posteriors.
  2. EP/graphical + sampler pages are generalised public rewrites of PyAutoMemory/methods_wiki content — PyAutoMemory itself is never referenced (privacy seam); originals remain the private superset.
  3. wiki/core/stack/: overview, autoconf, autofit. wiki/core/operations/: installation, sandbox, hpc.

Phase 3 (PR):

  1. Skills: af_adapt_to_domain (onboarding interview → wiki/project/profile.md + domain journal), af_ingest_paper (grows wiki/literature per-user), af_wrap_likelihood (user code → Analysis class; data/noise conventions, log_likelihood_function contract, JAX triage), af_compose_model; start-new-project + contribute-upstream project-workflow skills.
  2. Demos: 1D Gaussian (canonical) + SNe Ia distance-modulus fit on open data (e.g. Pantheon+ subset) exercising af_wrap_likelihood end-to-end, incl. a model-comparison story.

Phase 4 (PR):

  1. benchmarks/ (prompts/, runs/, RESULTS.md, AGENTS.md) with test-enforced card↔README parity; inference-flavoured cards.
  2. Teacher mode content wiring to HowToFit chapters; hpc/ batch templates + sync (CPU-first, GPU path where the likelihood is JAX-able); llms.txt; smoke CI via the reusable family workflow; firewall/policy + url_fixups riders.
  3. Heart newborn_validation.md checklist run (repo already public — the checklist still validates content/hygiene).

Key Files

  • autolens_assistant/AGENTS.md — the reference pattern being generalised
  • autolens_assistant/autoassistant/*.py — tooling being ported with af_ naming
  • PyAutoMemory/methods_wiki/concepts/*.md — private sources for Phase 2 public rewrites
  • PyAutoMind/issued/autofit_assistant_birth.md — the design prompt (four pillars)

Notes

  • Feature Agent recommended re-homing as research/; overruled by the judgment tier at launch — scoping was already completed at intake (design in the prompt), and the prior research anchor research/autofit_assistant/autofit_assistant_planning.md is absorbed here (retire it when this ships).
  • Autonomy: supervised effective (--auto launch 2026-07-10). No Heart-ack given at launch — any Heart YELLOW at ship parks. Judgment forks become batched questions on this issue.

Original Prompt

Click to expand starting prompt

autolens_assistant is proving to be very good, and is now excelling at various science cases.

It is time to make autofit_assistant, noting that this has the following differences:

  • Autolens is tied to a specific scientific domain (lensing), whereas autofit_assistant is a tool to help someone perform inference in their own specific scientific domain. That means, when someone begins using autofit_assistant, one of their first tasks is probably going to be also training or adapting it to their scientific domain. This probably includes paper ingestion, manually providing code with a likelihood function (ideally) and the model composition.

  • AutoFit assistant would benefit from a wiki on all the core statistics concepts it uses during inference albeit many are probably there from the general foundation model. Nevertheless, the EP wiki we made would be valuable here, probably some stuff specific to each source code sampler, maybe stuff on priors, have a think.

  • like the autolens_assistant pairs to the autolens_workspace via skills, we want to do the exact same with the autofit assistant.

  • All the core features of the autolens_assistant (making a science project, open data repository design, benchmarks, assistant and teacher mode, HPC link, etc) should be kept and designed suitable for autofit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions