latestOpenAPI 3.0.32026-08-227451,2751.8 MB

d0fc0114da66

KnowledgeGraph

Find nearest-neighbor concepts to a candidate

Returns the top-K active concept nodes most similar to a candidate concept by symmetric cosine similarity over the node embedding column. The App Modeling Agent uses this to see the nearest existing concepts when resolving a candidate, and judges whether the candidate is the same concept, a variant, or genuinely new. No score threshold is applied — every returned neighbor is ranked, none filtered out. The candidate is embedded server-side using the same symmetric document format as the stored embeddings (title: <label>: <candidate_name> | text: <candidate_text>) with RETRIEVAL_DOCUMENT task type, so candidate-vs-stored cosine distance is meaningful. When candidate_text is omitted, the candidate name alone is used as the embedding text. Writer-only endpoint (consumes embedding API quota); concept_type is restricted to the agent's writable labels (Page, Workflow, Feature). Returns 503 when the embedding service is unavailable, so the caller treats it as a transient failure rather than reading an empty neighborhood as "this candidate is unique".

post/knowledgeGraph/nodes/similarityNeighbors

Request body

workspace_idstring required

The workspace ID

application_idstring required

The application ID

concept_type'Page' | 'Workflow' | 'Feature' required

The concept type to look up neighbors against (writer-only labels only)

candidate_namestring required

The candidate concept name; used both as the title prefix and as the embedding text fallback when candidate_text is absent

candidate_textstring

Optional candidate prose to embed (mirrors the stored concept's content column). When supplied, the embedding input is title: <concept_type>: <candidate_name> | text: <candidate_text>. When absent, the candidate name alone is reused as the embedding text. Capped at 20000 characters to mirror the concept-content cap.

limitinteger

Maximum number of neighbors to return (a result-count cap, not a similarity cutoff). Defaults to a small set the agent can inspect; the cap of 50 keeps responses within the agent context budget.

Response

Top-K similar nodes (may be empty when no concepts of the given label exist).