core beginner

Counter Agent

A real Jido agent that counts up and down using Actions, Signals, and signal routing. Demonstrates the core agent pattern: immutable state, validated actions, and LiveView integration.

getting-started state actions signals

Related guides and notebooks

lib/agent_jido/demos/counter/actions/reset_action.ex 15 lines
defmodule AgentJido.Demos.Counter.ResetAction do
  @moduledoc """
  Resets the counter to zero.
  """
  use Jido.Action,
    name: "reset",
    description: "Resets the counter to zero",
    schema: []

  @impl true
  def run(_params, _context) do
    {:ok, %{count: 0}}
  end
end