Ragex. Store. Backend behaviour
(Ragex v0.18.2)
View Source
Behaviour defining the storage contract for Ragex's knowledge graph, embeddings, and vector search.
Two implementations exist:
Ragex.Store.Backend.ETS-- in-memory ETS tables (default, backward-compatible)Ragex.Store.Backend.Dllb-- delegates to the dllb multi-model database
The active backend is selected at startup via:
config :ragex, :store_backend, :ets # or :dllb
Summary
Callbacks
One-time schema bootstrap (e.g. DEFINE TABLE for dllb). ETS is a no-op.
Clear all data.
Switch the store to a specific project path.
Return aggregate stats about the store.
Callbacks
@callback bootstrap() :: :ok | {:error, term()}
One-time schema bootstrap (e.g. DEFINE TABLE for dllb). ETS is a no-op.
@callback clear() :: :ok
Clear all data.
@callback count_nodes_by_type(node_type :: atom()) :: non_neg_integer()
@callback list_embeddings( node_type :: atom() | nil, limit :: non_neg_integer() | :infinity ) :: [tuple()]
@callback list_nodes(node_type :: atom() | nil, limit :: non_neg_integer() | :infinity) :: [map()]
@callback load_project(project_path :: String.t() | nil) :: :ok
Switch the store to a specific project path.
@callback stats() :: map()
Return aggregate stats about the store.
Functions
@spec module() :: module()
Returns the module implementing this behaviour for the configured backend.