MnemosyneZvex.Schema (mnemosyne_zvex v0.1.0)

Copy Markdown

Builds the per-repo Zvex.Collection.Schema used by MnemosyneZvex.Backend and centralises atom->string conversion for the node_type column.

Summary

Functions

Builds a Zvex collection schema from backend opts.

Stringifies a node-type atom for the node_type zvex column. Used by both the encoder (writes) and the filter builder (reads) so the two sites cannot diverge.

Returns the canonical list of node-type atoms supported by the backend.

Schema layout version. Bumped if breaking column changes are introduced.

Functions

build(opts)

@spec build(keyword()) :: Zvex.Collection.Schema.t()

Builds a Zvex collection schema from backend opts.

Required: :dimension. Optional: :index (default :hnsw), :metric (default :cosine), :index_opts (default [m: 16, ef_construction: 200]).

node_type_string(type)

@spec node_type_string(atom()) :: String.t()

Stringifies a node-type atom for the node_type zvex column. Used by both the encoder (writes) and the filter builder (reads) so the two sites cannot diverge.

node_types()

@spec node_types() :: [atom()]

Returns the canonical list of node-type atoms supported by the backend.

version()

@spec version() :: pos_integer()

Schema layout version. Bumped if breaking column changes are introduced.