Docs
Edges & Graph
Manage typed, weighted relationships between vectors in a bucket to build knowledge graphs.
The Edge API turns a flat vector bucket into a knowledge graph by adding typed, weighted relationships between nodes (vectors). Use edges to model citations, hierarchies, causal chains, and contradictions.
Add Edges
bashPOST /v1/buckets/{bucket_id}/edges| Field | Type | Default | Description |
|---|---|---|---|
edges | EdgeInput[] | -- | Array of edges to add (max 10,000) |
edges[].source | string | -- | Source node (vector) ID |
edges[].target | string | -- | Target node (vector) ID |
edges[].relation | string | related_to | Relation type |
edges[].weight | float | 1.0 | Edge weight (0.0 to 1.0) |
Available relation types: contradicts, supersedes, caused_by, is_a, related_to, has_child, follows.
bashcurl -X POST https://api.schift.io/v1/buckets/{bucket_id}/edges \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-d '{
"edges": [
{"source": "doc-1", "target": "doc-2", "relation": "supersedes"},
{"source": "doc-3", "target": "doc-1", "relation": "contradicts", "weight": 0.9}
]
}'List Edges
bashGET /v1/buckets/{bucket_id}/edges/{node_id}| Query Param | Type | Default | Description |
|---|---|---|---|
direction | string | both | outgoing, incoming, or both |
relation | string | -- | Filter by relation type |
bash# All edges for a node
curl https://api.schift.io/v1/buckets/{bucket_id}/edges/doc-1 \
-H "Authorization: Bearer $SCHIFT_API_KEY"
# Only outgoing supersedes edges
curl "https://api.schift.io/v1/buckets/{bucket_id}/edges/doc-1?direction=outgoing&relation=supersedes" \
-H "Authorization: Bearer $SCHIFT_API_KEY"Delete Edge
bashDELETE /v1/buckets/{bucket_id}/edgesbashcurl -X DELETE https://api.schift.io/v1/buckets/{bucket_id}/edges \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SCHIFT_API_KEY" \
-d '{"source": "doc-1", "target": "doc-2", "relation": "supersedes"}'