production beginner

Persistence Storage Agent

Focused round-trip example for Persist.hibernate/2 and Persist.thaw/3 using ETS-backed checkpoints.

persistence storage operations ops-governance l1

Related guides and notebooks

lib/agent_jido/demos/persistence_storage/actions/increment_action.ex 19 lines
defmodule AgentJido.Demos.PersistenceStorage.IncrementAction do
  @moduledoc """
  Increments the demo counter.
  """

  use Jido.Action,
    name: "increment",
    description: "Increments counter",
    schema: [
      amount: [type: :integer, default: 1]
    ]

  @impl true
  def run(%{amount: amount}, context) do
    current = Map.get(context.state, :counter, 0)
    {:ok, %{counter: current + amount, status: :updated}}
  end
end