Lux.Reflection (Lux v0.4.0)

View Source

A Reflection represents a Agent's decision-making process and self-awareness. It can evolve over time as the Agent learns and adapts to new situations.

Summary

Functions

Analyzes the reflection's history to identify patterns and improve decision making.

Creates a new reflection module.

Performs a reflection cycle for a agent, deciding on next actions.

Updates the reflection's context with new information.

Types

t()

@type t() :: %Lux.Reflection{
  context: map(),
  description: String.t(),
  history: [map()],
  id: String.t(),
  last_reflection_time: DateTime.t() | nil,
  llm_config: map(),
  metrics: map(),
  name: String.t(),
  patterns: [map()],
  state: :idle | :reflecting | :learning | :adapting
}

Functions

learn(reflection)

Analyzes the reflection's history to identify patterns and improve decision making.

new(attrs \\ %{})

Creates a new reflection module.

reflect(reflection, agent, context)

Performs a reflection cycle for a agent, deciding on next actions.

update_context(reflection, new_context)

Updates the reflection's context with new information.