PhoenixAI.Store.Adapter.ProfileStore behaviour (PhoenixAI.Store v0.1.0)

Copy Markdown View Source

Sub-behaviour for adapters that support long-term memory profile storage.

Adapters implementing this behaviour can store, retrieve, and delete per-user profile summaries. save_profile/2 uses upsert semantics — writing for the same user_id overwrites the previous profile.

Summary

Callbacks

delete_profile(user_id, keyword)

@callback delete_profile(
  user_id :: String.t(),
  keyword()
) :: :ok | {:error, term()}

load_profile(user_id, keyword)

@callback load_profile(
  user_id :: String.t(),
  keyword()
) ::
  {:ok, PhoenixAI.Store.LongTermMemory.Profile.t()}
  | {:error, :not_found | term()}

save_profile(t, keyword)

@callback save_profile(
  PhoenixAI.Store.LongTermMemory.Profile.t(),
  keyword()
) :: {:ok, PhoenixAI.Store.LongTermMemory.Profile.t()} | {:error, term()}