OriginChainDB
Database endpoints

Train Node2Vec embeddings

Train node embeddings from graph walks, and optionally save them for similarity search.

POST /v1/tenants/{tenant}/graph/{schema}/node2vec

Turn graph walks into node vectorsSimilarity search needs embeddings that were saved during training.
  1. Select the relationChoose walk and training settings.
  2. Learn from graph walksTrain a numeric representation for each visited node.
  3. Check the persisted flagConfirm saved embeddings before querying them.

Before you start

Use your database bearer token.

Connection setup

Populate the schema's relations before training. Saving embeddings requires schema DDL permission; a tiny example graph demonstrates the request, not model quality.

Path parameters

FieldTypeRequired
tenantstringRequired
schemastringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • Defaults: walks_per_node 10, walk_length 80 (their product is capped at 10,000,000), window_size 5, negative_samples 5, dim 128 (max 1024), epochs 5, initial_lr 0.025, min_lr 0.0001 (must not exceed initial_lr), p 1.0, q 1.0, seed 0, persist false.
  • persist=true also requires the schema DDL privilege.
  • Graphs above 100,000 nodes are refused.
FieldTypeRequired
dimintegerOptional
epochsintegerOptional
initial_lrnumberOptional
min_lrnumberOptional
negative_samplesintegerOptional
pnumberOptional
persistbooleanOptional
qnumberOptional
relstringRequired
seedintegerOptional
walk_lengthintegerOptional
walks_per_nodeintegerOptional
window_sizeintegerOptional

Read the result

embeddings maps nodes to learned vectors. With persist: true, check persisted before using the Node2Vec similarity endpoint. Training statistics do not establish application-level result quality.

Response statuses

HTTP status reference
StatusWhat to do
200OK
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
404Check the resource ID and API route.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
500Check the outcome before retrying a write.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd