Skip to main content

addDocuments

client.knowledge.addDocuments(id: string, data: AddKnowledgeDocumentsRequest): Promise<unknown>

Adds one or more documents to a knowledge collection.

Uploads documents that will be automatically processed, chunked, and indexed for retrieval. Supports multiple documents in a single request.

Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the target collection
dataAddKnowledgeDocumentsRequestYesThe documents to add, including their content and metadata

Returns

Promise<unknown> — A promise that resolves when the documents have been added and processing has begun

Example

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

const client = new CodeBoltClient();

const result = await client.knowledge.addDocuments('id', /* AddKnowledgeDocumentsRequest */);
console.log(result);