# `Jido.Memory`
[🔗](https://github.com/agentjido/jido/blob/v2.3.0/lib/jido/memory.ex#L1)

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}

# `t`

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

# `new`

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

Create a new memory with default world and tasks spaces.

# `reserved_spaces`

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

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

# `schema`

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

Returns the Zoi schema for Memory.
