Using the Official SDK (Tool Integration)
You can use the official@larkup/sdk to expose your knowledge base as a tool for the Vercel AI SDK. This enables the LLM to search your documents dynamically for current answers that reflect the available context.
Connecting via OpenAI Compatible Endpoint
Because the Larkup server automatically exposes an OpenAI compatible API, you can use the@ai-sdk/openai package to connect directly, treating the RAG server as an LLM provider.
Using a local Agent Server as a remote tool
Start the Agent profile in Settings → Larkup Server. The card shows its endpoint, Scalar reference at/reference, and machine-readable OpenAPI document at
/openapi.json.
Use the Agent client as an AI SDK tool executor. This calls the running agent
over HTTP, so the parent agent can be a separate application or model.
POST /chat and the explicit
POST /agent/chat alias. Both accept {"messages":[...]} and return an AI SDK
UI-message stream. For an OpenAI-compatible model provider, use
http://localhost:8080/v1 with createOpenAI.
