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

Default singleton plugin for memory state management.

Declares ownership of the `:__memory__` state key in agent state.
This plugin does not initialize memory by default — memory is
created on demand via `Jido.Memory.Agent.ensure/2`.

## Singleton

This plugin is a singleton — it cannot be aliased or duplicated.
It is automatically included as a default plugin for all agents
unless explicitly disabled:

    use Jido.Agent,
      name: "minimal",
      default_plugins: %{__memory__: false}

## Replacement

Packages that provide a richer memory implementation should replace this
default plugin through the `:__memory__` default-plugin slot:

    use Jido.Agent,
      name: "persistent_memory_agent",
      default_plugins: %{
        __memory__: {MyApp.PersistentMemoryPlugin, %{store: MyApp.Store}}
      }

Do this instead of mounting a second memory plugin in `plugins:`. The
replacement plugin should also declare `state_key: :__memory__` so runtime
integrations can discover memory state at the canonical key.

## State Key

Memory is stored at `agent.state[:__memory__]` as a `Jido.Memory` struct.
Access helpers are provided by `Jido.Memory.Agent`.

## Persistence

This bare-minimum default plugin keeps memory in-process only and
does not externalize on checkpoint. If you need persistence (ETS,
database, etc.), implement your own memory plugin with custom
`on_checkpoint/2` and `on_restore/2` callbacks.

# `__plugin_metadata__`

```elixir
@spec __plugin_metadata__() :: map()
```

Returns metadata for Jido.Discovery integration.

This function is used by `Jido.Discovery` to index plugins
for fast lookup and filtering.

# `actions`

```elixir
@spec actions() :: [module()]
```

Returns the list of action modules provided by this plugin.

# `capabilities`

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

Returns the capabilities provided by this plugin.

# `category`

```elixir
@spec category() :: String.t() | nil
```

Returns the plugin's category.

# `config_schema`

```elixir
@spec config_schema() :: Zoi.schema() | nil
```

Returns the Zoi schema for per-agent configuration.

# `description`

```elixir
@spec description() :: String.t() | nil
```

Returns the plugin's description.

# `manifest`

```elixir
@spec manifest() :: Jido.Plugin.Manifest.t()
```

Returns the plugin manifest with all metadata.

The manifest provides compile-time metadata for discovery
and introspection, including capabilities, requirements,
signal routes, and schedules.

# `name`

```elixir
@spec name() :: String.t()
```

Returns the plugin's name.

# `otp_app`

```elixir
@spec otp_app() :: atom() | nil
```

Returns the OTP application for config resolution.

# `plugin_spec`

```elixir
@spec plugin_spec(map()) :: Jido.Plugin.Spec.t()
```

Returns the plugin specification with optional per-agent configuration.

## Examples

    spec = MyModule.plugin_spec(%{})
    spec = MyModule.plugin_spec(%{custom_option: true})

# `requires`

```elixir
@spec requires() :: [tuple()]
```

Returns the requirements for this plugin.

# `schedules`

```elixir
@spec schedules() :: [tuple()]
```

Returns the schedules for this plugin.

# `schema`

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

Returns the Zoi schema for plugin state.

# `signal_patterns`

```elixir
@spec signal_patterns() :: [String.t()]
```

Returns the signal patterns this plugin handles.

# `signal_routes`

```elixir
@spec signal_routes() :: [tuple()]
```

Returns the signal routes for this plugin.

# `singleton?`

```elixir
@spec singleton?() :: boolean()
```

Returns whether this plugin is a singleton.

# `state_key`

```elixir
@spec state_key() :: atom()
```

Returns the key used to store plugin state in the agent.

# `subscriptions`

```elixir
@spec subscriptions() :: [Jido.Plugin.sensor_subscription()]
```

Returns the sensor subscriptions for this plugin.

# `tags`

```elixir
@spec tags() :: [String.t()]
```

Returns the plugin's tags.

# `vsn`

```elixir
@spec vsn() :: String.t() | nil
```

Returns the plugin's version.
