Mnemosyne.Supervisor (mnemosyne v0.1.6)

Copy Markdown View Source

Top-level supervisor for the Mnemosyne runtime.

Starts the process tree with :rest_for_one strategy: SessionRegistry -> RepoRegistry -> TaskSupervisor -> RepoSupervisor -> SessionSupervisor.

Shared defaults (config, LLM adapter, embedding adapter, notifier) are stored in :persistent_term and applied to each repo opened via Mnemosyne.open_repo/2.

Summary

Functions

Returns a specification to start this module under a supervisor.

Returns shared defaults (config, LLM adapter, embedding adapter) for the given supervisor instance.

Derives the session Registry name for the given supervisor.

Derives the repo Registry name for the given supervisor.

Derives the RepoSupervisor name for the given supervisor.

Derives the SessionSupervisor name for the given supervisor.

Derives the TaskSupervisor name for the given supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get_defaults(sup_name \\ __MODULE__)

@spec get_defaults(module()) :: %{
  config: term(),
  llm: module(),
  embedding: module(),
  notifier: module()
}

Returns shared defaults (config, LLM adapter, embedding adapter) for the given supervisor instance.

registry_name(sup_name)

@spec registry_name(module()) :: module()

Derives the session Registry name for the given supervisor.

repo_registry_name(sup_name)

@spec repo_registry_name(module()) :: module()

Derives the repo Registry name for the given supervisor.

repo_supervisor_name(sup_name)

@spec repo_supervisor_name(module()) :: module()

Derives the RepoSupervisor name for the given supervisor.

session_supervisor_name(sup_name)

@spec session_supervisor_name(module()) :: module()

Derives the SessionSupervisor name for the given supervisor.

task_supervisor_name(sup_name)

@spec task_supervisor_name(module()) :: module()

Derives the TaskSupervisor name for the given supervisor.