AI SDK Documentation

August 14, 2026 ยท View on GitHub

Python SDK for invoking Dynamic Agents from OpenMetadata / Collate.

What is this SDK?

The AI SDK lets you programmatically invoke Dynamic Agents - AI-powered assistants that can analyze your data catalog, generate SQL queries, plan data quality tests, explore lineage, and more. These agents run on your OpenMetadata or Collate instance and have full access to your metadata context.

Use cases:

  • Automate data quality test generation
  • Build chatbots that understand your data catalog
  • Integrate metadata intelligence into your data pipelines
  • Create LangChain tools backed by your metadata context

Prerequisites

Before using this SDK, you need:

  1. An OpenMetadata or Collate instance with Dynamic Agents enabled
  2. A Bot with a JWT token for API authentication

Getting Your Credentials

1. Find your host URL

Your AI_SDK_HOST is your OpenMetadata/Collate server URL:

  • Collate Cloud: https://your-org.getcollate.io
  • Self-hosted OpenMetadata: https://your-openmetadata-server.com

2. Create a Bot and get the JWT token

  1. Log into your OpenMetadata/Collate instance as an admin
  2. Go to Settings > Bots
  3. Click Add Bot (or use an existing bot)
  4. Give it a name (e.g., sdk-bot) and appropriate permissions
  5. Under Token, click Generate Token or copy the existing JWT token
  6. This JWT token is your AI_SDK_TOKEN

Security tip: Treat this token like a password. Don't commit it to version control.

Guides

GuideDescription
Quick StartGet started in 5 minutes
Standalone UsageComplete standalone documentation
Async UsageAsync patterns and best practices
Error HandlingException handling patterns
LangChain IntegrationUse Dynamic Agents with LangChain
MCP ToolsUse MCP tools with LangChain/OpenAI
ReleasingHow to publish a new SDK release

Installation

# Core SDK (standalone)
pip install data-ai-sdk

# With LangChain support
pip install data-ai-sdk[langchain]

# All optional dependencies
pip install data-ai-sdk[all]

Quick Example

First, set your environment variables:

# Your OpenMetadata/Collate server URL
export AI_SDK_HOST="https://your-org.getcollate.io"

# Your bot's JWT token (from Settings > Bots)
export AI_SDK_TOKEN="eyJhbGciOiJSUzI1NiIs..."

Then use the SDK:

from ai_sdk import AISdk, AISdkConfig, Conversation

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

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

# Multi-turn conversation (agent remembers context)
conv = Conversation(client.agent("DataQualityPlannerAgent"))
print(conv.send("Analyze the customers table"))
print(conv.send("Create tests for the issues you found"))

client.close()

Features

  • Standalone usage - No framework dependencies required
  • Multi-turn conversations - Automatic context tracking
  • Streaming responses - Real-time output
  • Async support - Full async/await API
  • Framework integrations - LangChain (more coming)
  • Type hints - Full type coverage
  • Error handling - Structured exception hierarchy
  • Management APIs - Create and manage agents, personas, bots, and skills

Requirements

  • Python 3.9+
  • httpx
  • pydantic