Raxol.Agent.Memory.Stack (Raxol Agent v2.6.0)

Copy Markdown View Source

A Raxol.Agent.Memory provider that composes several providers into one.

The built-in ETS store can run alongside an external semantic service (or several) without an agent having to choose between them. The stack is itself a Memory provider, so Raxol.Agent.Memory.Manager and the memory actions see a single provider that happens to fan out:

  • store/2 and forget/2 go to every provider.
  • search/2 queries every provider, normalizes each provider's results to a [0, 1] rank score, merges, dedupes by content (keeping the best), and takes the requested limit.
  • prefetch/2 and build_system_prompt/1 are inherited from use Raxol.Agent.Memory and ride on the merged search/2.

The providers are passed in opts[:providers] as a list of {module, opts} (or bare modules). A failing provider degrades to empty/no-op rather than breaking the stack. Build the context tuple with Raxol.Agent.Memory.stack_context/3.