create_relationship
Create a typed relationship between two entities. The relationship_type vocabulary is a runtime registry, not a fixed list: call list_relationship_types to read what this instance accepts, and register_relationship_type to add to it.
Instructions
Create a typed relationship between two entities. The relationship_type vocabulary is a runtime registry, not a fixed list: call list_relationship_types to read what this instance accepts, and register_relationship_type to add to it. Use EMBEDS when a container entity (e.g. blog post, document) embeds an asset entity (e.g. image, attachment): source_entity_id = container, target_entity_id = asset. For images/files stored in Neotoma: store the file via store (get source_id), create an image/media entity with source_id, then create_relationship(EMBEDS, post_entity_id, image_entity_id). Optional metadata: caption, order. Both source_entity_id and target_entity_id must be entities you own; store the entity first (or in the same store call), then link it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| user_id | No | Optional explicit user id; inferred from authentication when omitted. | |
| metadata | No | Optional metadata attached to the relationship (e.g. `caption`, `order` for `EMBEDS` edges). | |
| source_id | No | Optional `sources` row id stamped as provenance on the relationship observation. | |
| source_entity_id | Yes | Existing entity id at the source end of the edge. | |
| target_entity_id | Yes | Existing entity id at the target end of the edge. | |
| relationship_type | Yes | Relationship type. The vocabulary is a runtime registry, not a closed enum: call list_relationship_types to read what this instance accepts, and register_relationship_type to add to it. Names are identifier-shaped and casing-agnostic (both SCREAMING_SNAKE and lower_snake are in use). |