Type System & Adaptors
Connectify's type system catches mismatched connections before you run anything. When types don't match exactly but a known conversion exists, an adaptor bridges them automatically.
Built-in types
Every port carries a semantic type. The built-ins are:
| Type | Pill | What it represents |
|---|---|---|
jpg / png / image | image | Bitmap images. Concrete formats are subtypes of image. |
tensor | tensor | N-dimensional numeric arrays. Carries shape + dtype metadata. |
float / int | float | Scalar numerics. Used for metrics and scalar config. |
string / text | string | Strings and string sequences (for tokenized or raw text). |
label | label | Supervisory labels — class ids, regression targets, or structured annotations. |
table | — | Columnar tabular data with named columns and dtypes. |
checkpoint | — | Reference to model weights. |
Compatibility rules
Two ports connect cleanly when one of the following holds:
- Exact match. Output
jpg→ inputjpg. - Subtype match. Output
jpg→ inputimage(jpg is a kind of image). - Adaptor available. Output
jpg→ inputpng— Connectify offers to insert ajpg → pngadaptor.
When none of these hold, the connection is rejected and the editor explains why.
Adaptors
An adaptor is a small named conversion that sits on an edge. It has an identity, a label, and a settings block. When two ports' types differ but a known adaptor exists, Connectify shows the Adaptor Dialog:
- Accept — insert with default settings.
- Configure — adjust settings (e.g., JPEG quality on a
png → jpgadaptor) before inserting. - Cancel — abandon the connection.
Built-in adaptors
| From | To | Adaptor | Common settings |
|---|---|---|---|
jpg | png | JPG→PNG | colorspace, dpi |
png | jpg | PNG→JPG | quality, background |
image | tensor | Image→Tensor | channels, normalize, dtype |
tensor | image | Tensor→Image | channels, denormalize, clamp |
float | tensor | Float→Tensor | shape (scalar by default) |
string | tensor | String→Tensor | tokenizer, pad, truncate |
table | tensor | Table→Tensor | columns, dtype |
Stacking adaptors
If a single adaptor can't bridge a gap, Connectify looks for a two-step chain. For example, jpg → tensor is implemented as jpg → image → tensor. Stacked adaptors render as a single labeled chip on the edge so the canvas stays clean.
Adaptor chains are bounded
Connectify won't search chains longer than two steps. If no path exists, the connection is rejected — write a Custom node or a missing adaptor.
Registering custom types
Plugins can register types via types.register(). Registered types automatically get:
- A color-coded port pill.
- Eligibility for adaptor matching (you provide the adaptor function).
- Compatibility with subtype matching, if the type declares a parent.
from connectify import types
types.register(
'embedding_vec',
parent='tensor', # Subtype of tensor
shape=(768,),
dtype='float32',
color='#7c3aed',
)
Writing a custom adaptor
from connectify import Adaptor, types
class TextToEmbedding(Adaptor):
from_type = types.text
to_type = types.embedding_vec
label = 'Text → Embedding'
settings = { 'model': str } # which embedder to use
def convert(self, value, model):
return embed_with(model, value)
Drop the adaptor into plugins/ and reload. It joins the catalog and is offered automatically whenever those types meet.