Jido.Memory.Space
(Jido v2.0.0-rc.4)
View Source
The unit of memory — a named container with typed data and revision tracking.
A Space holds either a map (key-value) or list (ordered items) in its data
field. The type is determined by the data itself — pattern matching and guards
(is_map/1, is_list/1) handle dispatch.
Each space tracks its own revision counter independently, enabling fine-grained concurrency control.
Examples
# Key-value space (world model)
world = Space.new_kv()
world = %{world | data: Map.put(world.data, :temperature, 22)}
# List space (task list)
tasks = Space.new_list()
tasks = %{tasks | data: tasks.data ++ [%{id: "t1", text: "Check sensor"}]}
Summary
Functions
Returns true if the space holds list data.
Returns true if the space holds map data.
Create a new space from attributes.
Create a new key-value (map) space.
Create a new list space.
Returns the Zoi schema for Space.
Types
Functions
Returns true if the space holds list data.
Returns true if the space holds map data.
Create a new space from attributes.
Create a new key-value (map) space.
Create a new list space.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for Space.