Skip to main content

AI SDK

The AI SDK gives you programmatic access to Collate’s AI Studio — create personas and agents, invoke them via the API, and stream responses in real time. 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!

Available SDKs

Prerequisites

You need:
  1. A OpenMetadata 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 OpenMetadata instance, select your bot, and copy the token. See How to get the JWT Token for detailed instructions.

Configuration

Set the following environment variables:
All environment variables:

Client Initialization


Manage Personas

A persona defines the behavioral instructions and personality of an AI Studio Agent. Each persona contains a system prompt that shapes how the agent responds. Multiple agents can share the same persona.

Create a Persona

Persona fields:

List Personas

Get a Persona by Name


Manage Agents

An agent combines a persona’s behavioral instructions with OpenMetadata’s MCP tools to form a purpose-built AI assistant. Agents must be API-enabled to be invoked via the SDK.

Create an Agent

Agent fields: Available abilities: search_metadata, get_entity_details, get_entity_lineage, create_glossary, create_glossary_term, create_lineage, patch_entity

List Agents


Invoke an Agent

Send a message to an API-enabled agent and receive a response.

Single Invocation

The response includes:

Streaming

Use streaming to receive real-time output as the agent generates its response.
Stream event types:

Multi-Turn Conversations

The Conversation class automatically manages context across messages.

Async Support (Python)

All sync methods have async counterparts with the a prefix:

Error Handling

CLI

The CLI provides an interactive TUI with markdown rendering and syntax highlighting.

MCP Tools

OpenMetadata exposes an MCP server that turns your metadata into a set of tools any LLM can use. Unlike generic MCP connectors that only read raw database schemas, OpenMetadata’s MCP tools give your AI access to the full context of your data platform — descriptions, owners, lineage, glossary terms, tags, and data quality results. The MCP endpoint is available at POST /mcp using the JSON-RPC 2.0 protocol.

Available Tools

Using MCP Tools Directly

You can call MCP tools directly through the SDK client:

LangChain Integration

Convert OpenMetadata’s MCP tools to LangChain format with a single method call. This lets you use your metadata as tools in any LangChain agent.

Tool Filtering

Control which tools are exposed to your LLM by including or excluding specific tools. This is useful for restricting agents to read-only operations or limiting scope.

Using AI Studio Agents as LangChain Tools

You can wrap AI Studio Agents as LangChain tools, letting you compose them with other tools in a LangChain pipeline:

Multi-Agent Orchestrator

Build a multi-agent system where specialist agents each get focused MCP tools:

OpenAI Integration

Convert MCP tools to OpenAI function calling format: