Jidoka.Agent.Spec.Memory (Jidoka v0.9.0)

Copy Markdown View Source

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

capture()

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

inject()

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

scope()

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

t()

@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
}

Functions

capture_conversation?(memory)

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

Returns true when the policy captures the complete conversation.

captures()

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

Returns the supported memory capture modes.

from_input(memory)

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

Normalizes an optional memory policy, including boolean shorthand.

injects()

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

Returns the supported prompt injection positions.

new(attrs \\ [])

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

Builds a memory policy from keyword or map attributes.

new!(attrs \\ [])

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

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

schema()

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

Returns the Zoi schema for an agent memory policy.

scopes()

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

Returns the supported memory scopes.