Behaviour for agents running in the observe/think/act loop (Agent.Process).
Formalizes the callbacks that Agent.Process modules implement. Using this behaviour gives compile-time warnings for missing callbacks.
Summary
Callbacks
Execute an action. Returns updated state.
Snapshot state for crash recovery.
Initialize agent state from options.
Observe events and produce an observation map.
Called when pilot releases.
Called when pilot takes over.
Handle a directive from the orchestrator or pilot.
Restore state from a snapshot.
Decide what to do based on the observation.
Types
Callbacks
Execute an action. Returns updated state.
Snapshot state for crash recovery.
Initialize agent state from options.
@callback observe(events(), state()) :: {:ok, observation(), state()}
Observe events and produce an observation map.
Called when pilot releases.
Called when pilot takes over.
Handle a directive from the orchestrator or pilot.
Restore state from a snapshot.
@callback think(observation(), state()) :: {:act, action(), state()} | {:wait, state()} | {:ask_pilot, term(), state()}
Decide what to do based on the observation.
Returns:
{:act, action, new_state}-- execute an action{:wait, new_state}-- do nothing this tick{:ask_pilot, question, new_state}-- escalate to human