# `Jidoka.Agent.Spec.Memory`
[🔗](https://github.com/agentjido/jidoka/blob/v0.9.0/lib/jidoka/agent/spec/memory.ex#L1)

Conversation memory policy for an agent.

The policy is definition data. Runtime stores are supplied per run through
harness options.

# `capture`

```elixir
@type capture() :: :manual | :conversation | :off
```

# `inject`

```elixir
@type inject() :: :instructions | :context
```

# `scope`

```elixir
@type scope() :: :agent | :session
```

# `t`

```elixir
@type t() :: %Jidoka.Agent.Spec.Memory{
  capture: (:manual | :conversation) | :off,
  enabled: boolean(),
  inject: :instructions | :context,
  max_entries: integer(),
  metadata: map(),
  namespace: nil | nil | any(),
  scope: :agent | :session
}
```

# `capture_conversation?`

```elixir
@spec capture_conversation?(t() | nil) :: boolean()
```

Returns true when the policy captures the complete conversation.

# `captures`

```elixir
@spec captures() :: [capture()]
```

Returns the supported memory capture modes.

# `from_input`

```elixir
@spec from_input(t() | keyword() | map() | true | false | nil) ::
  {:ok, t() | nil} | {:error, term()}
```

Normalizes an optional memory policy, including boolean shorthand.

# `injects`

```elixir
@spec injects() :: [inject()]
```

Returns the supported prompt injection positions.

# `new`

```elixir
@spec new(keyword() | map()) :: {:ok, t()} | {:error, term()}
```

Builds a memory policy from keyword or map attributes.

# `new!`

```elixir
@spec new!(keyword() | map()) :: t()
```

Builds a memory policy and raises if the attributes are invalid.

# `schema`

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

Returns the Zoi schema for an agent memory policy.

# `scopes`

```elixir
@spec scopes() :: [scope()]
```

Returns the supported memory scopes.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
