NewWacht Bench is live — AI-assisted development for Wacht

updateKnowledgeBase()

This method updates knowledge base metadata.

Usage

The following example shows a basic usage of the backend client from @wacht/nextjs/server.

import { wachtClient } from '@wacht/nextjs/server';export async function example() {  const client = await wachtClient();  const kbId: string = 'kbid-123';  const request: UpdateAiKnowledgeBaseRequest = {    name: 'Product Docs v2',  };  return client.ai.updateKnowledgeBase(kbId, request);}

Signature

function updateKnowledgeBase(  kbId: string,  request: UpdateAiKnowledgeBaseRequest,  client?: WachtClient,): Promise<AiKnowledgeBase>

Parameters

kbId: string;
Target knowledge base id.
request: UpdateAiKnowledgeBaseRequest;
Request payload object sent to the backend API.
name?: string | undefined;
Display name for the target resource.

Return value

id?: string | undefined;
Knowledge base id.
name?: string | undefined;
Knowledge base name.
description?: string | undefined;
Knowledge base description.

Examples

AI usage pattern

import { wachtClient } from '@wacht/nextjs/server';export async function createKbAndUpload(file: File) {  const client = await wachtClient();  const kb = await client.ai.createKnowledgeBase({    name: 'Support Docs',    description: 'Knowledge base for support runbooks',  });  const doc = await client.ai.uploadKnowledgeBaseDocument(kb.id, file, 'runbook.md', 'Support runbook');  return { kb, doc };}

On this page