Skip to main content
Create a directed relationship between two entities in the knowledge graph. Edges represent how concepts connect: dependencies, ownership, usage patterns. Use consistent relation names.

Parameters

sourceId
string
required
ID of the source entity (the “subject”). Example: in “AuthService depends_on Database”, AuthService is the source.
targetId
string
required
ID of the target entity (the “object”). Example: in “AuthService depends_on Database”, Database is the target.
relation
string
required
Relationship type. Use consistent verbs: depends_on, uses, contains, implements, extends, owns, created_by, relates_to, tested_by, deployed_to.
fact
string
Additional context about the relationship. Embedded for semantic search. Example: "Connects via connection pool with max 10 connections.".
validAt
string
When this relationship became valid (ISO 8601). Useful for tracking evolving architecture.
scope
string
default:"project"
Storage scope.
ValueDescription
projectStored under the current project (default)
globalShared across all projects

Example

{
  "sourceId": "node_abc",
  "targetId": "node_xyz",
  "relation": "uses",
  "fact": "The project uses React 19 for the frontend",
  "scope": "project"
}