adk_memory_service behaviour (erlang_adk v0.2.5)

View Source

adk_memory_service - Behaviour for long-term, semantic memory.

Erlang ADK separates short-term working memory (sessions) from long-term semantic/vector memory. This behaviour defines the interface for querying and updating long-term knowledge.

Summary

Types

filter/0

-type filter() :: map().

query/0

-type query() :: binary().

result/0

-type result() :: #{id => binary(), content => binary(), metadata => map(), score => float()}.

Callbacks

add/3

-callback add(Pid :: pid(), Content :: binary(), Metadata :: map()) -> {ok, binary()} | {error, term()}.

add_session_to_memory/3

-callback add_session_to_memory(Pid :: pid(), SessionId :: binary(), Events :: [adk_event:event()]) ->
                                   ok | {error, term()}.

delete/2

-callback delete(Pid :: pid(), Id :: binary()) -> ok | {error, term()}.

init/1

-callback init(Config :: map()) -> {ok, pid()} | {error, term()}.

search/4

-callback search(Pid :: pid(), Query :: query(), Filter :: filter(), Limit :: pos_integer()) ->
                    {ok, [result()]} | {error, term()}.