Jido.Agent.Store.File (Jido v2.0.0-rc.1)

View Source

File-based agent store adapter.

Simple restart-safe storage that persists each agent to a separate file. Suitable for development and simple production use cases.

Usage

Jido.Agent.InstanceManager.child_spec(
  name: :sessions,
  agent: MyAgent,
  persistence: [
    store: {Jido.Agent.Store.File, path: "priv/agent_state"}
  ]
)

Options

  • :path - Directory path for state files (required). Created if it doesn't exist.

File Format

Files are named by hashing the key and stored as Erlang term format.