link
Assert a typed memory-to-memory edge, alongside the ones the write pipeline infers.
link(source: str, target: str, kind: str, weight: float | None = None) -> LinkResultlink(request: LinkRequest) -> LinkResponseParameters
ParameterTypeRequired
sourcestring (wire: 64-bit integer)requiredThe memory the edge leaves.
targetstring (wire: 64-bit integer)requiredThe memory it points at.
kindEdgeKindrequiredOne of caused, followed_by, derived_from, similar_to, contradicts, supports, references, part_of. Anything else is BadEdgeKind. On the wire these are integer discriminants, not lowercase strings.
weightfloatoptionalEdge strength. Defaults server-side.
Returns
FieldTypePresence
source / target / kind / weight—alwaysEchoed back as stored.
created_at_unix_nanos64-bit integeralwaysWhen the edge was written.
already_existedbooleanalwaystrue when the edge was already there. This is what makes link idempotent — a repeat is a success, not a duplicate.
Example
brain.link(source=outage_id, target=rollback_id, kind="caused", weight=0.9)See also
Was this page helpful?