Database endpoints
Train GraphSAGE embeddings
Train node embeddings from graph relationships and row features, and optionally save them for similarity search.
POST /v1/tenants/{tenant}/graph/{schema}/graphsage
- Prepare links and featuresChoose the relation and numeric row-feature column.
- Train node embeddingsCombine graph neighborhoods with feature values.
- Check persisted outputVerify saving before searching the learned vectors.
Before you start
Use your database bearer token.
Populate the graph and a numeric-array feature column first. The example uses three finite values per row in features. Saving embeddings requires schema DDL permission.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
schema | string | Required |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
application/json
Limits and accepted values
- feature_col names the per-row numeric-array feature column.
- Defaults: feature_dim 128, embedding_dim 128, hidden_dim 128 (each 1..1024), num_layers 2 (1..4), neighbor_sample_size 25 (1..50), aggregator mean (mean | max_pool | lstm), walks_per_node 10, walk_length 80, window_size 5, negative_samples 5, epochs 5, initial_lr 0.025, min_lr 0.0001, seed 0.
- persist defaults to false;
- persist=true also requires the schema DDL privilege.
- Graphs above 100,000 nodes are refused.
| Field | Type | Required |
|---|---|---|
aggregator | string | Optional |
embedding_dim | integer | Optional |
epochs | integer | Optional |
feature_col | string | Required |
feature_dim | integer | Optional |
hidden_dim | integer | Optional |
initial_lr | number | Optional |
min_lr | number | Optional |
negative_samples | integer | Optional |
neighbor_sample_size | integer | Optional |
num_layers | integer | Optional |
persist | boolean | Optional |
rel | string | Required |
seed | integer | Optional |
walk_length | integer | Optional |
walks_per_node | integer | Optional |
window_size | integer | Optional |
Read the result
embeddings maps nodes to numeric vectors. Check persisted before calling the matching similarity-search endpoint. final_loss describes training, not a guarantee of useful recommendations.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 200 | OK |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 404 | Check the resource ID and API route. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 503 | Honor Retry-After when present; check write outcomes. |