Skip to main content

createRecord

client.knowledgeGraph.createRecord(id: string, data: CreateKGRecordRequest): Promise<KGRecord>

Creates a new record (node) in a knowledge graph instance.

Records represent entities or concepts in the graph. Each record has a type, properties, and can be connected to other records through edges.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the graph instance
dataCreateKGRecordRequestYesRecord creation payload including type and properties

Returns

Promise<KGRecord> — A promise that resolves to the newly created

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.knowledgeGraph.createRecord('id', /* CreateKGRecordRequest */);
console.log(result);