Relation endpoints manage the directed edges between nodes in the knowledge graph. Each relation is a typed, directed edge that connects a source node to a target node. Every relation carries aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/DrDigett/Babel/llms.txt
Use this file to discover all available pages before exploring further.
weight value between 0.0 and 1.0 that influences both the graph physics simulation and edge visibility — only edges whose weight is ≥ 0.7 are rendered in the graph view. Lower-weight relations are stored in the database and queryable through the API but are hidden from the visual graph.
GET /api/relations
List all relations. Optionally scope the result to edges that originate from or point to a specific node.Query parameters
Return only relations whose source is this node ID.
Return only relations whose target is this node ID.
Response
Returns a JSON array ofRelation objects.
POST /api/relations
Create a new directed relation between two existing nodes.Request body
ID of the source node. Must be an existing node UUID.
ID of the target node. Must be an existing node UUID and must differ from
sourceId.Semantic type of the relation. Must be one of the nine valid values:
| Value | Meaning |
|---|---|
es_autor_de | The source authored the target |
dirigio | The source directed the target |
trata_sobre | The source content is about the target concept |
pertenece_a | The source belongs to the target school or category |
influyo_a | The source influenced the target |
critica_a | The source critiques the target |
inspiro | The source was inspired by the target |
ocurre_en | The source takes place during the target event or era |
similar_a | The source is thematically similar to the target |
Float between
0.0 and 1.0 representing the strength of the relation. Defaults to 1.0. Edges with weight below 0.7 are stored but not displayed in the graph view.Validation
sourceIdandtargetIdmust be provided and must be different.- Both referenced nodes must already exist — a missing node returns
404. typemust be one of the nine validRelationTypevalues.weightmust be a number in the range[0.0, 1.0].
Response
Returns201 Created with the created Relation object.
DELETE /api/relations/:id
Delete a relation by its ID. This removes only the edge — neither the source nor target node is affected.Path parameters
The UUID of the relation to delete.
Response
Returns{ "success": true } on deletion.
TypeScript interface
TheRelation type returned by all endpoints is defined in @babel-plus/shared: