Skip to main content

AI SDK

The AI SDK gives you programmatic access to Collate through two complementary paths: MCP Tools for building custom AI applications with any LLM, and AI Studio Agents for invoking ready-to-use AI assistants from Collate’s AI Studio. Available across Python, TypeScript, Java, and a standalone CLI.
You can find the source code for the AI SDK in the GitHub repository. Contributions are always welcome!

Explore the AI SDK

Available SDKs

SDKPackageInstall
Pythondata-ai-sdkpip install data-ai-sdk
TypeScript@openmetadata/ai-sdknpm install @openmetadata/ai-sdk
Javaorg.open-metadata:ai-sdkMaven / Gradle
CLIai-sdkInstall script

Prerequisites

You need:
  1. A Collate instance with AI Studio Agents enabled
  2. A Bot JWT token for API authentication
To get a JWT token, go to Settings > Bots in your Collate instance, select your bot, and copy the token. See How to get the JWT Token for detailed instructions.

Configuration

Set the following environment variables:
export AI_SDK_HOST="https://your-org.getcollate.io"
export AI_SDK_TOKEN="your-bot-jwt-token"
All environment variables:
VariableRequiredDefaultDescription
AI_SDK_HOSTYes-Your Collate server URL
AI_SDK_TOKENYes-Bot JWT token
AI_SDK_TIMEOUTNo120Request timeout in seconds
AI_SDK_VERIFY_SSLNotrueVerify SSL certificates
AI_SDK_MAX_RETRIESNo3Number of retry attempts
AI_SDK_RETRY_DELAYNo1.0Base delay between retries (seconds)

Quick Start

Python

pip install data-ai-sdk
from ai_sdk import AISdk, AISdkConfig

config = AISdkConfig.from_env()  # reads AI_SDK_HOST and AI_SDK_TOKEN
client = AISdk.from_config(config)

# Invoke an agent
response = client.agent("DataQualityPlannerAgent").call(
    "What data quality tests should I add for the customers table?"
)
print(response.response)

# Stream responses in real time
for event in client.agent("DataQualityPlannerAgent").stream("Analyze the orders table"):
    if event.type == "content":
        print(event.content, end="", flush=True)

TypeScript

npm install @openmetadata/ai-sdk
import { AISdk } from '@openmetadata/ai-sdk';

const client = new AISdk({
  host: 'https://your-org.getcollate.io',
  token: 'your-bot-jwt-token'
});

const response = await client.agent('DataQualityPlannerAgent').call(
  'What data quality tests should I add for the customers table?'
);
console.log(response.response);

// Stream responses
for await (const event of client.agent('DataQualityPlannerAgent').stream('Analyze data quality')) {
  if (event.type === 'content') {
    process.stdout.write(event.content || '');
  }
}
Zero runtime dependencies. Works in Node.js 18+, browsers, Deno, and Bun.

Java

<dependency>
  <groupId>org.open-metadata</groupId>
  <artifactId>ai-sdk</artifactId>
  <version>0.1.2</version>
</dependency>
import io.openmetadata.ai.AISdk;

AISdk client = new AISdk.Builder()
    .host("https://your-org.getcollate.io")
    .token("your-bot-jwt-token")
    .build();

InvokeResponse response = client.agent("DataQualityPlannerAgent")
    .call("What data quality tests should I add?");
System.out.println(response.getResponse());

CLI

# Install
curl -sSL https://raw.githubusercontent.com/open-metadata/ai-sdk/main/cli/install.sh | sh

# Configure
ai-sdk configure

# Invoke an agent
ai-sdk invoke DataQualityPlannerAgent "Analyze the customers table"
The CLI provides an interactive TUI with markdown rendering and syntax highlighting.