Installation
The SDK is available on npm. You can install it using your preferred package manager:Initialization
Import and initialize the client. It automatically picks up theLARKUP_API_URL and LARKUP_API_KEY from your environment.
http://localhost:8080. When constructor values are omitted, the client reads LARKUP_API_URL and LARKUP_API_KEY.
Basic Usage
Adding a Document
addDocument() embeds and stores the document immediately. No second index call is required.
Bulk Indexing with Progress
indexDocuments() accepts sequential and parallel scheduling. It yields a progress event after every server response and a final completion event.
mode: "sequential" when request order matters or the embedding provider has a strict rate limit. Parallel mode only controls client request scheduling. The server’s semantic, hybrid, vector store, embedding, and chunking configuration remains authoritative.
Querying
Streaming Chat
Usechat() when you want to render tokens as they arrive:
chatText() when you only need the completed answer:
Agent Server
UseLarkupAgentClient when the Larkup Server toggle is set to Agent. It exposes the
Agent’s loaded tools and consumes its AI SDK UI-message stream.
capabilities() to inspect grouped integrations—selected built-ins, skills, sandbox, one entry per MCP connection, and plugins. A capability marked configured is selected in the Project but is not executable by this runtime; active entries are loaded. tools() remains available when you need the raw tool list. configuration() returns the UI prompt, selected tools, skills, and sandbox configuration; sandbox() checks readiness without exposing credentials. Use chatText() when you only need the completed answer. Use chat() to access the raw AI SDK stream.
Choose a chat model
Every generated runtime exposesGET /models. Use the SDK to inspect the
providers and models that the runtime can actually use, then send modelId on
an individual chat request. This does not change the deployment default.
Corpus Inspection and Export
Media
Marketplace Hub
Tool discovery uses a separate Hub client because Marketplace installation is a local CLI control operation.API Coverage
Local Demo
The repository includes a complete demo configured forhttp://localhost:8080:

