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
FieldTypeDefaultDescription
edgesEdgeInput[]--Array of edges to add (max 10,000)
edges[].sourcestring--Source node (vector) ID
edges[].targetstring--Target node (vector) ID
edges[].relationstringrelated_toRelation type
edges[].weightfloat1.0Edge 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 ParamTypeDefaultDescription
directionstringbothoutgoing, incoming, or both
relationstring--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}/edges
bashcurl -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"}'