AGN-Egent

Agentic spectral decomposition of active galactic nuclei. A power-law continuum, Fe II, and tied narrow + broad lines, with an LLM in the quality-control loop.

Try it: Hβ and Hα broad + narrow

CSV with two columns: wavelength (observed-frame, Å) and flux. The browser fits a power-law continuum, a broad Gaussian and the narrow lines in the Hβ and Hα windows and shows each region separately. Add a Claude key (optional) to run the agentic QC, where Claude reviews the fit just like the full pipeline. Need a file to try? Grab a real AGN spectrum CSV (the redshift is in the filename).

Claude QC review

Lightweight in-browser preview. The full method (PyQSOFit fitting, anchored continuum, Fe II / host components, tied multiplets, Monte-Carlo errors and the multi-step agentic loop) runs in Python. Clone the repository and open the example notebook. Your API key is sent only from your browser directly to Anthropic; it is never stored.

How it works

1 · Continuum
The continuum is a single power law, fit on line-free windows. Fe II, the Balmer continuum, and host starlight are separate additive components, never part of the continuum.
2 · Lines
Each Balmer line is fit with one or more broad Gaussians, plus narrow lines ([O III], [N II], [S II]) tied in velocity and width. Hβ and Hα can be fit jointly or each in its own region.
3 · Agentic QC
A reviewer (rule-based or a vision LLM) checks the residuals and edits the model from a fixed set of moves: add or remove a broad or narrow Gaussian, or drop a component that is only fitting noise.

Example output

Hβ and Hα broad/narrow decomposition for SDSS 650-52143-166
SDSS 650-52143-166 (z = 0.2942), the spectrum behind the Load example button above, fit one region at a time. Left: Hβ with [O III] 4959/5007; right: Hα with [N II]/[S II]. The orange power-law continuum, the blue broad Gaussian and the green narrow lines are separated, and the lower panel shows the pull (residual / noise) with ±3σ bands. Measured broad FWHM ≈ 6,963 km/s (Hβ) and 5,162 km/s (Hα). This is exactly what you get by clicking Load example and running it in your browser.

Citation

Built on the Egent framework (Ting, Mahmud Saad, Liu & Shen 2025, arXiv:2512.01270) and PyQSOFit (Guo, Shen & Wang 2018). Spectra from SDSS; validation against Shen et al. (2011).