Conversation memory policy for an agent.
The policy is definition data. Runtime stores are supplied per run through harness options.
Summary
Functions
Returns true when the policy captures the complete conversation.
Returns the supported memory capture modes.
Normalizes an optional memory policy, including boolean shorthand.
Returns the supported prompt injection positions.
Builds a memory policy from keyword or map attributes.
Builds a memory policy and raises if the attributes are invalid.
Returns the Zoi schema for an agent memory policy.
Returns the supported memory scopes.
Types
@type capture() :: :manual | :conversation | :off
@type inject() :: :instructions | :context
@type scope() :: :agent | :session
Functions
Returns true when the policy captures the complete conversation.
@spec captures() :: [capture()]
Returns the supported memory capture modes.
@spec from_input(t() | keyword() | map() | true | false | nil) :: {:ok, t() | nil} | {:error, term()}
Normalizes an optional memory policy, including boolean shorthand.
@spec injects() :: [inject()]
Returns the supported prompt injection positions.
Builds a memory policy from keyword or map attributes.
Builds a memory policy and raises if the attributes are invalid.
@spec schema() :: Zoi.schema()
Returns the Zoi schema for an agent memory policy.
@spec scopes() :: [scope()]
Returns the supported memory scopes.