SDK ReferenceFunctions
createKnowledgeClient()
Function: createKnowledgeClient()
createKnowledgeClient(
opts?):KnowledgeClient
Defined in: packages/sdk/src/sdk.ts:129
Build a Knowledge client bound to a Libra project (via its API key). Upload
docs, then retrieve (context) or chat with citations. See knowledge-agents.md.
import { createKnowledgeClient } from "@unispec-ai/sdk"; const kb = createKnowledgeClient({ apiKey: process.env.UNISPEC_API_KEY }); await kb.createKnowledge({ name: "support-docs", instructions: "Cite sources." }); const base = kb.knowledge("support-docs"); await base.uploadText({ title: "FAQ", text: "Refunds are available within 30 days." }); await base.waitUntilReady(); const { message, citations } = await base.chat([{ role: "user", content: "30-day refund?" }]);
Parameters
opts?
MemoryClientOptions = {}