Recollect.WorkingMemory.Server (recollect v0.5.1)

Copy Markdown View Source

GenServer holding a bounded working memory buffer for a single scope.

State: %{scope_id: binary(), entries: [%{id, importance, content, metadata, inserted_at}], max: pos_integer()}

Summary

Functions

Returns a specification to start this module under a supervisor.

Clear all entries from working memory.

Push a new entry into the working memory buffer.

Read all entries, sorted by importance DESC.

Get the scope_id for this server.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

clear(pid)

Clear all entries from working memory.

push(pid, content, opts \\ [])

Push a new entry into the working memory buffer.

read(pid, opts \\ [])

Read all entries, sorted by importance DESC.

scope_id(pid)

Get the scope_id for this server.

start_link(opts)