NINA imaging sequence and PHD2 guiding graph running side by side at the Bhagalpur observatory

Building an Agentic AI Night Operator for My Remote Observatory

28 Aug 2026By Akshay Kumar

A clear, moonless night at the observatory yields about six usable hours of integration time. Losing half of that window because a sequencer continued exposing into thick haze9 usable hours out of 12. The rest went to haze.9 usable hours out of 12. The rest went to haze. is not an equipment failure, but a situational blind spot. I ran into the same issue on M81 and M82The first night, scrapped over a camera angle.The first night, scrapped over a camera angle., where an entire night of data was scrapped because the camera angle did not match the earlier sessions.

Both times, the hardware functioned normally. The sequencer simply did not know the plan was no longer useful because it had no awareness of its surroundings, so it continued executing the original instructions until morning. The goal of this night operator is to bridge that gap by supervising telemetry, respecting hard mathematical boundaries, and adapting the session dynamically overnight.

The Three Tiers of Observatory Operation

To understand where true autonomy begins, it helps to distinguish how remote observatories operate across three distinct tiers:

SequencerN.I.N.A.
GuidingPHD2
Level 1: Remote Operable
Core Mechanism
Remote Desktop, Tailscale, IoT relays
Session Planning
Manual target selection per night
Weather Handling
Wake up, check radar, and click park
Human Role
Active desk operator
Level 2: AutomatedCURRENT STATE
Core Mechanism
NINA Advanced Sequencer, PHD2
Session Planning
Manual sequence construction before sunset
Weather Handling
Hard threshold triggers (pause/abort)
Human Role
Advance scheduler and morning triage
Level 3: AgenticTARGET
Core Mechanism
State-aware supervisor (Hermes) + Local LLM
Session Planning
Goal-driven seasonal backlog balancing
Weather Handling
Correlates telemetry, waits, or pivots to standby
Human Role
Sets seasonal goals and reviews logs

My setup in Bhagalpur currently operates solidly at the Automated tierFirst light, January 2026First light, January 2026. The telescopes stay mounted on permanent piers with persistent polar alignment, routed cabling, and dedicated mini-PCs that boot on power restoration.

Pier 1 switchboard at the observatory with IoT-controlled power sockets and routed cabling beneath the William Optics 71GT APO on the iOptron CEM40
Current automated infrastructureIoT switches, Tailscale mesh VPN, NUC auto-boot

Reliable baseline systems already run on site: power sockets run through IoT switches, mini-PCs boot on power restoration, and Tailscale provides encrypted mesh networking. These deterministic foundational layers do not need an AI model.

The observatory still relies on an on-site caretaker to unlock and roll back the roof, though adding rain sensors and a motorized roof driver will eventually automate that physical link once the software supervisor is proven. The true bottleneck is not mechanical. It is the absence of context during execution.

Architecture: Deterministic Inner Loops, Probabilistic Outer Loops

When bringing AI into an automated setup, it is easy to fall into two common traps:

Connecting NINA's API to a Model Context Protocol (MCP) server lets a language model turn "Point to the Moon and expose 5ms" into a slew command. That is a useful testing tool, but it remains a basic natural language interface, acting as little more than a conversational remote control.

ProtocolMCP

Real operational autonomy requires a clean separation between two distinct layers:

How the night shift is layeredHardware at the bottom. NINA and PHD2 control it. A session recorder reads their output and feeds state upward to Hermes, which runs the night shift. Hermes consults a language model for judgement, but every proposal passes a deterministic constraint check before any action reaches NINA. Hermes escalates to people only when a person is genuinely required.PEOPLEAkshayover TelegramObservatory supporton site, for the roofESCALATEDISPATCHonly when a person is neededSUPERVISIONHERMESworkflow state · memory of the nightschedule · messaging · permissionsdecides what to do with an answerJUDGEMENTClaude Opustoday, over an APIswappableASKproposesCONTINUEmost of the nightCONSTRAINT CHECKaltitude · local horizon · mount limitstime remaining · deterministic, in millisecondsACTonly what survives the checkCONTROLNINA · PHD2slew · plate-solve · focus · guideexpose · flip · parkSTATEsessionrecorderno opinionswhat the nightactually didHARDWARECEM40 · WO 71GT · ASI2600MM Profilter wheel · focuser · guide camera

The model only provides recommendations. Hermes checks those recommendations against fixed constraints before anything is passed to NINA, and Hermes itself is limited to the four actions shown above.

Alongside NINA and PHD2, an automated session recorder aggregates real-time target data, filter progress, guiding RMS, and environmental telemetry into structured records.

Hermes manages the overall session lifecycle. Built on the open-source agent framework from Nous Research, Hermes monitors workflow state, checks pre-authorized operational boundaries, and coordinates external alerts over Telegram.

FrameworkHermes
Continue
Follow the pre-approved sequence without intervention, covering standard imaging runs.
Ask
Query the model for qualitative decisions, such as ranking standby targets during an unexpected clear window.
Escalate
Alert me directly if an issue falls outside pre-approved parameters and requires manual intervention.
Dispatch
Send an automated dispatch to on-site support in Bhagalpur when a physical action is required.

If a primary target finishes early, the language model might suggest switching to NGC 6888 to complete a missing filter set, even if the object has already set below the local horizon.

hermes-constraint-check.log
validation
PROPOSAL    resume NGC 6888, 1h Ha still needed to close
CHECK       TARGET      ALTITUDE   LIMITS   TIME LEFT   VERDICT
            NGC 6888    -13.0      n/a      48 min      FAIL
RESULT      Target is below the horizon; rejected before reaching sequencer.

Because Hermes evaluates physical constraints before passing any plan to NINA, impossible suggestions are rejected instantly.

Supervised Desk Work via MCP: The Proving Ground

Before deploying Hermes as an unattended background daemon, the underlying toolchain is validated interactively through the Model Context Protocol (MCP). Exposing NINA's API through an MCP server lets a language model inspect system state and test complex multi-step routines during supervised desk work.

Claude Desktop
Akshay

Point the C8 at the Moon and give me a run along the terminator. The 676 is already on it.

19:40
Claude

nina.mount_slew(target=Moon)

nina.camera_mode(camera=ASI676MC readout=high-speed)

Slewing the CEM70 to the Moon, checking pointing, and switching the 676 to high frame rate. I will balance exposure using the histogram before starting the run.

19:40

nina.capture_preview(exposure=5ms)

histogram peak at 62 percent, no clipping

nina.capture_video(frames=1000 exposure=5ms gain=121 roi=2048x2048)

Moon_2026-08-22_1940.ser, 4.2 GB

Run finished. 1000 frames captured at 5 ms (gain 121), saved as Moon_2026-08-22_1940.ser (4.2 GB) on the NAS. Frame quality stayed consistent throughout.

19:44
Akshay

Good. Cool the 2600 on the north pier to minus five. Also, how much new OIII do I have on IC 405 so far?

19:46
Claude

nina.camera_cooler(pier=north setpoint=-5)

sessions.query(target=IC405 filter=OIII since=2026-08-01)

28 subs, 140 min, 3 nights

Cooler set. IC 405 has 28 new OIII subs across three pre-dawn sessions this month (2 hours 20 minutes), with framing matching the March baseline.

19:46

Supervised testing session with Claude controlling the setup via MCP.

MCP translates conversational commands into structured JSON tool calls, letting the model query project databases and coordinate hardware commands while NINA handles execution. The raw video files and sub-exposures remain untouched on network storage until manual post-processing on the workstation. The stacked lunar terminator close-up in the galleryThe best twenty percent of the frames, stacked in AutoStakkertThe best twenty percent of the frames, stacked in AutoStakkert shows the result of a run like this.

This MCP setup is the engineering testbed: it validates that tool definitions, API serialization, and hardware feedback loops work flawlessly. But it is strictly a stepping stone. Hermes packages these proven tool integrations into an autonomous daemon that monitors telemetry across hours, evaluates contingencies, and runs the entire observing session without human presence.

Walkthrough: An Unattended Prototype Night

To show how telemetry logging, constraint checks, and the decision engine operate together in a production scenario, here is the chronological breakdown of an automated observing session planned for the upcoming winter season.

The project queue holds two primary targets: NGC 7000, which needs a final 3h20m of Hα before setting in the west, and IC 40534.5 hours on the Auriga complex, March 202634.5 hours on the Auriga complex, March 2026, which requires several hours of OIII data once the 32% Moon sets at 21:51. High clouds are forecast after 02:00.

The Flaming Star Nebula, IC 405, in a narrowband SHO palette, assembled from 34.5 hours of data collected over several weeks
IC 405, the Flaming Star Nebula34.5 hours collected across multiple sessions

Multi-filter projects like the Auriga complexThe OIII master channel, 140 frames of 300sThe OIII master channel, 140 frames of 300s require filter tracking across months of variable weather, where automated scheduling prevents wasted acquisition time.

The inputs for the schedule are fully deterministic: ephemeris tables provide altitude and moonset timings, the forecast provides cloud trends, and the local session database tracks remaining filter requirements. The operator synthesizes these variables into an organized plan.

The Target Selection Dashboard on this site already performs the mathematical side of this calculation. It computes visibility windows, checks horizon limits, and ranks reachable targets. The night operator automates the final step: executing and supervising that plan within verified boundaries.

Thumbnail for Explore the Target Selection Dashboard
EARLIER BUILD
Explore the Target Selection Dashboard
Session Timeline16:3006:45
HA IMAGINGOIII IMAGINGSTANDBY RUNWEATHER HOLD
  1. Session timeline from 16:30 to 06:45.
  2. 18:20 to 21:55: NGC 7000 Ha, Ha imaging.
  3. 22:00 to 01:40: IC 405 OIII, OIII imaging.
  4. 01:40 to 02:30: IC 405 BONUS, OIII imaging.
  5. 02:30 to 03:25: CLOUD HOLD, weather hold.
  6. 03:25 to 04:05: M42 CORE, standby run.
  7. 16:55: SUNSET.
  8. 18:12: ROOF OPEN.
  9. 21:51: MOONSET.
  10. 04:05: PARK.
  11. 06:30: REPORT.

The full prototype night at a glance, from plan formulation to the morning report.

16:45: Automated Plan Formulation

Hermes initiates ten minutes before sunset, querying ephemeris data, filter requirements, and forecasts. It discards targets that violate horizon limits and formats an initial schedule for Telegram review.

Telegram
Hermes (Observatory Bot)

ephem.night(site=observatory)

sunset 16:55, moonset 21:51, moon 32 percent

sessions.progress(targets=NGC7000,IC405)

Ha 2h30m of 5h50m, OIII 2h20m of 6h

weather.forecast(window=tonight)

clear, high cloud possible after 02:00

Tonight looks usable through most of the evening, with high clouds expected after 02:00. The moon is at 32 percent and sets at 21:51. NGC 7000 has 2h30m of Ha collected and needs 3h20m more. It transits near sunset and loses altitude through the evening, and Ha is resilient to early moonlight. IC 405 has 2h20m of its planned 6h OIII sequence completed and will be well placed after moonset. Proposed plan: Start with NGC 7000 in Ha, then switch to IC 405 in OIII after moonset. Shall I initialize the rig at 17:45 and request the roof?

16:45

16:48: Defining Operational Boundaries

I approve the schedule, specify a plate-solve rotation check on IC 405 to guarantee framing alignment with March data, and set an approved standby list in case weather interrupts the primary plan.

Telegram
Akshay

Approved. Confirm the IC 405 sensor rotation matches March before starting that sequence. If the plan is interrupted, choose from the standby list; otherwise park the mount.

16:48
Hermes (Observatory Bot)

Understood. I will verify the IC 405 angle against the March reference framing before starting OIII exposures. Standby list confirmed: M42 in LRGB (30s for core detail), M45 in LRGB, and NGC 2244 in Ha. I will only select among these if the main targets become unusable. Otherwise the session will end in park.

16:48
Thumbnail for Handling framing errors from rotation mismatches
BACKGROUND
Handling framing errors from rotation mismatches

Checking the plate-solve rotation angle against previous session logs prevents multi-night integration errors. Setting the standby list in advance gives the agent clear, bounded options if conditions change overnight.

17:45: Pre-Flight Hardware Initialization

Hermes runs the startup routine. NINA connects to hardware, cools the camera sensors, homes the filter wheel, and verifies available storage.

Hermes (Observatory Bot)

Camera connected and cooling towards −10 C. Mount connected. Filter wheel homed, Ha in position. PHD2 running, guide camera connected. Disk space: 1.4 TB available. Sequence loaded: NGC 7000 Ha → IC 405 OIII.

17:53

Camera stable at −10.0 C. Readiness checks passed. Requesting roof opening.

18:01

18:05: Physical Ground Dispatch in Bhagalpur

Because the roll-off roof is manually operated, the automated schedule still interfaces with a physical human on site. The operator sends the opening request directly to the caretaker over Telegram in Hindi.

Telegram
Hermes (Observatory Bot)

टेलिस्कोप तैयार है। छत खोल दीजिए और खुल जाए तो मैसेज कर दीजिए।

18:05
Observatory Support

खोल दिया

18:12
Hermes (Observatory Bot)

धन्यवाद।

18:12

Dispatch to local caretaker to unlock and roll back the observatory roof.

With the roof confirmed open, Hermes updates the session log and starts the sequence on plan.

Telegram
Hermes (Observatory Bot)

nina.start_sequence(queue=NGC7000-Ha)

started, slewing to NGC 7000

Roof confirmed open by the caretaker at 18:12. Starting the approved sequence with NGC 7000 in Ha.

18:13

nina.slew_center(target=NGC7000)

solved and centered, offset 6 arcsec

nina.autofocus(filter=Ha)

settled, HFR 2.24

phd2.guide_stats(window=5m)

RMS 0.55 arcsec, stable

First 300s Ha frame is in and looks clean. Autofocus and guiding are stable. Next message only if something needs attention.

18:26

18:20 to 02:30: Routine Imaging

NINA manages active exposures, plate solving, autofocus routines, meridian flips, and PHD2 autoguiding.

IMAGINGNGC 7000 · Hαframe 34 of 40RUNNING SINCE 18:20
A single unprocessed 300-second hydrogen-alpha exposure straight out of the camera
LATEST FRAMESingle 300s Hα sub from first light, straight out of the camera
Exposure
300s
HFR
2.28
Stars
412
Guiding
0.52 arcsec
Cooler
−10.0 C
Ambient
12.4 C
Dew point
10.8 C
Next
Filter change 21:55

Telemetry snapshot during standard acquisition with NINA running the active sequence.

During standard data acquisition, the supervisor remains quiet, recording telemetry and monitoring equipment health without adding computational overhead to the imaging sequence.

02:30: Weather Interruption and Assessment

At 02:30, high clouds cause the Half-Flux Radius (HFR) to spike while guide-star SNR drops sharply, prompting NINA to pause the active sequence.

Hermes (Observatory Bot)

phd2.guide_stats(window=15m)

guide-star SNR falling, RMS 1.4 arcsec

weather.forecast(window=now)

high cloud band overhead, clearing after 03:00

Image quality has degraded over recent frames and guide-star SNR has dropped. Hardware status is normal, matching the forecast of passing high clouds. NINA has paused the sequence based on HFR limits. No intervention needed. I will monitor conditions and reassess if the sky clears.

02:30

Hermes matches the HFR pause against weather telemetry, verifies that the hardware is functioning normally, and waits for conditions to clear rather than generating false alarms.

03:05: Contingency Rescheduling in a Narrow Window

IC 405 reached its six-hour integration target at 01:40, so the frames captured before the cloud pause were bonus depth beyond the goal. By 03:05, forecasts show a remaining 45-minute clear window before dawn. Hermes filters the pre-approved standby list against altitude and horizon limits.

hermes-standby-filter.log
validation
WINDOW      03:20 to 04:05, approx 45 min usable
CHECK       TARGET      ALTITUDE   LIMITS   VERDICT
            M42         53.8       ok       PASS
            M45         47.6       ok       PASS
            NGC 2244    69.0       ok       PASS
RESULT      All 3 targets clear physical constraints; querying model for project priority.

With all three standby targets physically reachable, Hermes evaluates their project utility:

Telegram
Hermes (Observatory Bot)

timer.start(duration=20m label=override-window)

armed, expires 03:25

The primary plan is complete. IC 405 hit its 6h OIII target before the cloud arrived, and there is a 45-minute window remaining before dawn. Among the approved standby targets, M42 is the most productive choice: a short 30s LRGB run will capture the missing unclipped Trapezium core. The other standby targets require longer runs to be useful. Unless you override this within 20 minutes, I will start M42 once transparency recovers. Checking again at 03:15 and executing at 03:25.

03:05

timer.check(label=override-window)

10m remaining, no reply received

Standby plan active; loading M42 sequence at 03:25 unless overridden.

03:15

timer.expired(label=override-window)

20m elapsed, no override received

nina.load_sequence(target=M42 preset=trapezium-30s)

Loading approved M42 sequence into NINA. Imaging will start as soon as HFR conditions clear.

03:25

Hermes selects the appropriate sequence, loads it into NINA, and resumes imaging automatically.

04:05: Morning Park and Dispatch

When the standby window closes, Hermes parks the mount, warms the sensors, and sends the morning roof closure message to the caretaker.

Telegram
Hermes (Observatory Bot)

nina.park_and_warm(pier=north)

parked, cooler off

M42 window complete with 68 usable 30s frames. Mount parked, sensor warming, session archived. Roof closure queued with the morning dispatch.

04:08

scheduler.wake(at=06:30 job=morning-report)

watchdog.report(window=16:45 to 06:30)

heartbeat continuous, no gaps

Morning summary: NGC 7000 Ha sequence finished (40 subs at 300s). IC 405 OIII sequence reached its 6h target. M42 added 68 core subs. Roof confirmed closed at 05:58. Watchdog heartbeat logged continuously for 13h 45m with no errors. Thumbnails and logs are saved in the session directory.

06:30

The morning report confirms that all acquisition targets, hardware resets, and watchdog checks completed without requiring manual intervention.

Expanding from Prototypes to Seasonal Portfolios

Selecting between standby targets across a single evening is an effective prototype, but true autonomy means moving from nightly fallback logic to seasonal portfolio management.

In amateur astrophotography, the core challenge is not picking an object for an isolated hour; it is balancing multi-night projects across a four-month winter season. A complete portfolio might include a faint broadband reflection nebula, a widefield four-panel narrowband mosaic, and an opportunistic comet pass.

Season PortfolioWinter 2026-2027
26.5 / 68 HRS39% Banked
Auriga SHO MosaicNarrowband MosaicHigh
18.5 / 40 HRS
Moonlight tolerant, stable seeing
M81 / M82 Integrated FluxFaint BroadbandCritical
8 / 25 HRS
Moonless, sub-2.0 arcsec transparency
C/2026 Transiting CometTarget of OpportunityOpportunistic
0 / 3 HRS
Pre-dawn, rapid ephemeris tracking

This is where the supervisory layer demonstrates its value:

Implementation Roadmap: From Scripts to Seasonal Autonomy

Developing this architecture follows a phased engineering progression, ensuring deterministic reliability at each level before adding autonomous complexity:

  1. Phase 01RUNNING

    Deterministic Baseline

    • Permanent pier alignment, Tailscale mesh VPN, IoT power management.
    • Deterministic NINA Advanced Sequencer execution and native PHD2 guiding.
    • Manual on-site roof dispatch via Telegram.
  2. Phase 02CURRENT FOCUS

    Tooling and Telemetry Plumbing

    • NINA API wrapped inside a Model Context Protocol (MCP) server for desk-supervised tool execution.
    • Automated session recorder capturing sub-exposure telemetry, FWHM/HFR trends, and filter counts.
    • Pre-flight hardware initialization checks (sensor cooling, filter homing, storage audits).
  3. Phase 03NEXT STEP

    Bounded Nightly Prototypes

    • Hermes daemon running in background across isolated 1-2 night prototype runs.
    • Hard constraint engine evaluating horizon math before model invocation.
    • Automated overnight contingency handling (weather pause evaluation and pre-approved standby target selection).
    • Unattended morning park routines and structured Telegram watchdog reports.
  4. Phase 04TARGET STATE

    Seasonal Intent and Goal Engine

    • Transitioning from nightly fallback lists to seasonal portfolio balancing (40h narrowband mosaic plus 25h broadband IFN).
    • Autonomous moon-phase and seeing-quality allocation across competing project quotas.
    • Targets of opportunity interception (fast-moving transiting comets via orbital ephemeris).
    • Local offline inference on the on-site RTX PRO 5000 workstation.
    • Motorized roof interlocks and on-site rain sensors to remove manual dispatch.

The jump from Phase 2 (MCP Tooling) to Phase 3 (Nightly Prototypes) proves the mechanics: can an agent observe live state, respect horizon math, and make a safe decision without crashing the telescope?

The real destination, however, is Phase 4 (Seasonal Intent). Once bounded decisions work reliably over an isolated night, we remove the concept of manually building nightly queues altogether. The human operator defines the high-level seasonal portfolio; the supervisor manages the nightly trade-offs to bring that portfolio across the finish line by spring.

Failure Modes and Observability

Operating an unattended observatory requires accounting for failures in both hardware communication and automated reasoning:

To keep debugging straightforward, raw equipment telemetry is logged separately from agent reasoning transcripts. NINA and PHD2 record physical hardware performance, while Hermes logs the contextual decisions and prompt interactions that triggered each action.

The core architectural balance remains consistent: keep deterministic control within NINA and PHD2, enforce hard mathematical boundaries, and use the supervisory model only when conditions require an adaptive decision.

Thumbnail for Building the observatory this sits on top of
PREVIOUS LOG
Building the observatory this sits on top of