Jido.Identity (Jido v2.0.0-rc.4)

View Source

A first-class agent primitive representing who the agent is.

Identity is stored at the :__identity__ key in agent state and captures lifecycle facts (profile).

Identity is immutable — updates produce a new struct with a bumped revision.

Summary

Functions

Bump identity revision and updated_at timestamp

Pure evolution — increments age and bumps revision

Create a new identity

Return a public snapshot of the identity

Types

t()

@type t() :: %Jido.Identity{
  created_at: integer(),
  profile: map(),
  rev: integer(),
  updated_at: integer()
}

Functions

bump(identity, opts \\ [])

@spec bump(
  t(),
  keyword()
) :: t()

Bump identity revision and updated_at timestamp

evolve(identity, opts \\ [])

@spec evolve(
  t(),
  keyword()
) :: t()

Pure evolution — increments age and bumps revision

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new identity

snapshot(identity)

@spec snapshot(t()) :: map()

Return a public snapshot of the identity