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

View Source

An agent's mutable cognitive substrate — what the agent currently believes and wants.

Memory is stored under the reserved key :__memory__ in agent.state. It complements Thread (append-only episodic log) and Strategy (execution control) as the third pillar of agent cognition.

Memory is an open map of named spaces. Every agent starts with two built-in defaults — tasks (ordered list) and world (key-value map) — but custom spaces can be added for domain-specific cognitive structures.

Examples

memory = Memory.new()
memory.spaces.world  #=> %Space{data: %{}, rev: 0}
memory.spaces.tasks  #=> %Space{data: [], rev: 0}

Summary

Functions

Create a new memory with default world and tasks spaces.

Returns the list of reserved (non-deletable) space names.

Returns the Zoi schema for Memory.

Types

t()

@type t() :: %Jido.Memory{
  created_at: integer(),
  id: binary(),
  metadata: map(),
  rev: integer(),
  spaces: map(),
  updated_at: integer()
}

Functions

new(opts \\ [])

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

Create a new memory with default world and tasks spaces.

reserved_spaces()

@spec reserved_spaces() :: [atom()]

Returns the list of reserved (non-deletable) space names.

schema()

@spec schema() :: Zoi.schema()

Returns the Zoi schema for Memory.