Lux.Agent behaviour (Lux v0.3.0)

View Source

A Agent defines an autonomous agent's capabilities, behaviors and goals. The actual execution and supervision is handled by the Lux runtime.

Summary

Types

collaboration_protocol()

@type collaboration_protocol() :: :ask | :tell | :delegate | :request_review

memory_config()

@type memory_config() :: %{backend: module(), name: atom() | nil}

scheduled_action()

@type scheduled_action() :: {module(), pos_integer(), map(), map()}

scheduled_beam()

@type scheduled_beam() :: {module(), String.t(), keyword()}

signal_handler()

@type signal_handler() :: {module(), module()}

t()

@type t() :: %Lux.Agent{
  accepts_signals: [Lux.SignalSchema.t()],
  beams: [Lux.Beam.t()],
  description: String.t(),
  goal: String.t(),
  id: String.t(),
  lenses: [Lux.Lens.t()],
  llm_config: map(),
  memory_config: memory_config() | nil,
  memory_pid: pid() | nil,
  module: module(),
  name: String.t(),
  prisms: [Lux.Prism.t()],
  scheduled_actions: [scheduled_action()],
  signal_handlers: [signal_handler()]
}

Callbacks

chat(t, message, opts)

@callback chat(t(), message :: String.t(), opts :: keyword()) ::
  {:ok, String.t()} | {:error, term()}

Functions

chat(agent, message, opts)

handle_signal(agent, signal)

module_to_name(module)

schedule_action(name, module, interval_ms, input, opts)