The transport's view of the store.
Everything here goes through the AgentDb facade. A request handler needs
presentation -- a page of results, a status summary -- and not the machinery
behind them, so this module shapes what the facade returns and stops there.
Reading the database or the model manager from here would make the HTTP
surface a second way into the store's internals, and a change to either would
become a change to the wire.
Summary
Functions
Bulk enable/disable over an explicit URI list.
Bulk group assignment over an explicit URI list.
The size of the store's disposable read caches.
Removes the subtree at uri.
Why a store operation failed, in words and from the shared taxonomy.
Removes a memory and its provenance.
A document's full content.
A document's LLM-facing layers, keyed the way the console labels them.
Reads several documents' layers in one store operation.
A session's messages.
Whether the store is usable, per check.
Imports Agent Skills into a user's skills subtree. See AgentDb.import_skills/2.
How much of the store's content each index covers.
How much background work is outstanding, by status.
Recursive paged document URIs under scope for operations listings.
A page of the document names under prefix.
Paged installed-skill inventory across users.
Memory statistics: counts per type and status, pending, never surfaced.
How the store's models are doing, including a load in progress.
Operation, job, and model counts by outcome.
Memories waiting for review.
Promotes a waiting memory candidate.
Writes a document, creating it or replacing it.
How far behind the queue is, and which jobs are failing.
Recent operational failures, newest first.
Rejects a waiting memory candidate.
Maps a wire role to the atom the store writes, or :unknown.
A bounded, read-only view of the BEAM runtime.
Searches the store. See AgentDb.search/2 for the options.
Enables or disables the subtree at uri.
Assigns the operator group tag for the subtree at uri. Empty clears.
Why a skill import was refused, in words.
What the store holds and how much room it takes on disk.
Renders a store error on a controller connection.
Functions
Bulk enable/disable over an explicit URI list.
Bulk group assignment over an explicit URI list.
@spec cache_stats() :: map()
The size of the store's disposable read caches.
Removes the subtree at uri.
Why a store operation failed, in words and from the shared taxonomy.
Removes a memory and its provenance.
A document's full content.
A document's LLM-facing layers, keyed the way the console labels them.
Returns %{l0: layer, l1: layer, l2: layer} where each layer is
%{text: String.t(), source: :stored | :fallback | :unavailable, chars: non_neg_integer()}.
The store answers these layers under their own names (abstract, overview,
content) because that is its vocabulary; the console's L0/L1/L2 labels are
presentation, and translation at the transport edge is what that edge is for.
One call to the facade, so a layer's meaning is the same wherever it is
shown.
Reads several documents' layers in one store operation.
A session's messages.
Whether the store is usable, per check.
A 200 or a 503 rather than an error: a store serving without a model is serving, and a monitor should be able to see which part is down.
@spec import_skills(String.t(), AgentDb.Skills.Source.source()) :: {:ok, map()} | {:error, term()}
Imports Agent Skills into a user's skills subtree. See AgentDb.import_skills/2.
@spec index_coverage() :: map()
How much of the store's content each index covers.
@spec job_stats() :: map()
How much background work is outstanding, by status.
Recursive paged document URIs under scope for operations listings.
A page of the document names under prefix.
Paged installed-skill inventory across users.
Memory statistics: counts per type and status, pending, never surfaced.
@spec model_status() :: map()
How the store's models are doing, including a load in progress.
@spec operation_stats() :: map()
Operation, job, and model counts by outcome.
Memories waiting for review.
Promotes a waiting memory candidate.
Writes a document, creating it or replacing it.
@spec queue_detail(pos_integer()) :: map()
How far behind the queue is, and which jobs are failing.
@spec recent_errors(pos_integer()) :: [map()]
Recent operational failures, newest first.
Rejects a waiting memory candidate.
@spec role(String.t()) :: :user | :assistant | :system | :unknown
Maps a wire role to the atom the store writes, or :unknown.
@spec runtime_snapshot() :: map()
A bounded, read-only view of the BEAM runtime.
Searches the store. See AgentDb.search/2 for the options.
Enables or disables the subtree at uri.
Assigns the operator group tag for the subtree at uri. Empty clears.
Why a skill import was refused, in words.
@spec storage_stats() :: map()
What the store holds and how much room it takes on disk.
@spec transport_error(Plug.Conn.t(), term()) :: Plug.Conn.t()
Renders a store error on a controller connection.