weftgraph-onnx-embedding-plugin
weftgraphis a code name, not a product name. This crate is a preview release of a graph-storage gear built for CF/Gears and consumed by Constructor Studio, published from the fork vasylcf/gears-rust so thatcargo addis all a consumer needs. It is deliberately not published under thecf-gears-*namespace: the name a first-party graph-storage gear eventually takes is Constructor Fabric's to choose, and this crate must not stand in its way. In-tree the crate iscf-gears-graph-storage-onnx-embedding-plugin, and the library it builds keeps itsonnx_embedding_pluginname, so moving to an official crate later is a one-line change in a consumer's manifest.
The in-process embedding provider of the graph-storage gear: the default ADR-0004 chooses. A MiniLM-class sentence-embedding model runs through ONNX Runtime in the gear's own process, so a small deployment needs no inference service to use vector search.
Artifacts are supplied, never fetched
The model and tokenizer are read from operator-configured paths; the plugin downloads nothing. The embedding-space identity is the SHA-256 of the bytes actually loaded, so two deployments claiming one space either agree on that hash or are visibly different.
The tokenizer, pooling and normalization settings fold into the identity too,
and the shape of those blobs is frozen once the plugin is released: adding or
renaming a field changes the identity of every deployment that upgrades, and
the gear blocks vector search until the graph is re-embedded (see
EmbeddingSpaceId::new in the SDK).
ONNX Runtime is loaded with dlopen at first use (ORT_DYLIB_PATH), never
linked at build time. Building needs no runtime headers; running needs the
shared library. The pinned runtime version follows the workspace's ort crate.
graph-storage:
config:
embedding_provider: onnx
embedding_dimension: 384
embedding_model_path: /app/models/minilm/model.onnx
embedding_tokenizer_path: /app/models/minilm/tokenizer.json
Testing
The contract lane needs the runtime and the artifacts, and skips with a named reason without them:
ORT_DYLIB_PATH=/path/to/libonnxruntime.so \
GRAPH_STORAGE_ONNX_MODEL=/path/to/model.onnx \
GRAPH_STORAGE_ONNX_TOKENIZER=/path/to/tokenizer.json \