Vibe.Memory.Provider behaviour (vibe v0.2.1)

Copy Markdown View Source

Behaviour for memory providers managed by Vibe.Memory.Manager.

Summary

Types

context()

@type context() :: map()

Callbacks

init(keyword)

@callback init(keyword()) :: {:ok, term()} | {:error, term()}

on_delegation(t, t, context, term)

(optional)
@callback on_delegation(String.t(), String.t(), context(), term()) :: :ok

on_pre_compress(list, context, term)

(optional)
@callback on_pre_compress([map()], context(), term()) :: String.t()

on_session_end(list, context, term)

(optional)
@callback on_session_end([map()], context(), term()) :: :ok

on_turn_start(non_neg_integer, t, context, term)

(optional)
@callback on_turn_start(non_neg_integer(), String.t(), context(), term()) :: :ok

prefetch(t, context, term)

(optional)
@callback prefetch(String.t(), context(), term()) :: String.t()

shutdown(term)

(optional)
@callback shutdown(term()) :: :ok

sync_turn(t, t, context, term)

(optional)
@callback sync_turn(String.t(), String.t(), context(), term()) :: :ok

system_prompt_block(term)

(optional)
@callback system_prompt_block(term()) :: String.t()