Skip to main content

AI SDK for Python

Python SDK for invoking Metadata Dynamic Agents from your AI applications.

Installation

pip install data-ai-sdk

With LangChain integration:

pip install data-ai-sdk[langchain]

Quick Start

from ai_sdk import AISdk

client = AISdk(
    host="https://your-metadata-instance.com",
    token="your-bot-jwt-token"
)

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

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

Streaming

for event in client.agent("DataQualityPlannerAgent").stream("Analyze the customers table"):
    if event.event_type == "message":
        print(event.content, end="", flush=True)

Async Support

import asyncio
from ai_sdk import AISdk

async def main():
    client = AISdk(
        host="https://your-metadata-instance.com",
        token="your-bot-jwt-token",
        enable_async=True,
    )
    response = await client.agent("DataQualityPlannerAgent").acall(
        "Analyze the customers table"
    )
    print(response.response)

asyncio.run(main())

Context Memories

The client.memories namespace manages reusable Context Center knowledge — preferences, use cases, runbooks, and FAQs that any AI agent can read.

from ai_sdk import (
    AISdk,
    CreateContextMemoryRequest,
    EntityReference,
    MemoryType,
    MemoryVisibility,
)

# Create
created = client.memories.create(CreateContextMemoryRequest(
    name="orders-grain",
    title="Orders grain",
    question="What is the grain of the orders table?",
    answer="One row per order_id.",
    memory_type=MemoryType.NOTE,             # Preference | UseCase | Note | Runbook | Faq
    visibility=MemoryVisibility.SHARED,      # Private | Entity | Shared
    primary_entity=EntityReference(id="<table-uuid>", type="table"),
    tags=["Domain.Analytics"],
))

# Get / list (filter by entity FQN, optional limit)
client.memories.get(created.id)
client.memories.list(primary_entity_fqn="prod.warehouse.orders", limit=50)

# Hybrid NLQ search — combines vector + keyword ranking over the contextMemory index.
# Optional filters scope the search by indexed fields.
results = client.memories.search(
    "how do we measure order volume",
    filters={"visibility": ["Entity", "Shared"]},
    size=10,
    from_=0,
)
for hit in results.hits:
    print(f"[{hit.score:.2f}] {hit.memory.title}: {hit.memory.answer}")

# Soft delete by default; pass hard_delete=True to remove permanently
client.memories.delete(created.id)
client.memories.delete(created.id, hard_delete=True)

Async

Every method has an aXxx counterpart when the client is constructed with enable_async=True:

client = AISdk(host=..., token=..., enable_async=True)

await client.memories.acreate(req)
await client.memories.alist(primary_entity_fqn="prod.warehouse.orders")
await client.memories.aget(memory_id)
await client.memories.asearch("explain customer churn")
await client.memories.adelete(memory_id)

What's stored

Field Notes
name Stable system name (required)
question / answer Canonical Q/A pair (required) — what an agent retrieves
title, description, summary Human-facing text, optional
memory_type Preference, UseCase, Note, Runbook, or Faq
memory_scope EntityScoped (default) or UserGlobal
visibility Private, Entity, or Shared (controls who can read it)
primary_entity Attaches the memory to a specific asset for entity-scoped recall
tags List of tag FQN strings (e.g. "PII.Sensitive")

MCP Tools

Access Model Context Protocol tools from your Metadata instance:

tools = client.mcp.list_tools()

result = client.mcp.call_tool(
    tool=MCPTool.SEARCH_ENTITIES,
    arguments={"query": "customers", "limit": 5},
)

Documentation

License

Collate Community License 1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

data_ai_sdk-0.3.0.tar.gz (95.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

data_ai_sdk-0.3.0-py3-none-any.whl (98.7 kB view details)

Uploaded Python 3

File details

Details for the file data_ai_sdk-0.3.0.tar.gz.

File metadata

  • Download URL: data_ai_sdk-0.3.0.tar.gz
  • Upload date:
  • Size: 95.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for data_ai_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 708628cc7b0f1a9e0bdc1781e952c6f7a064d1fae963ee1d44e96a86abf40919
MD5 fb00c934a70efb983410745b4016042d
BLAKE2b-256 784b0f4cadd79d63b1accc59cb70a00747609b207b0fff4e9fc2fba0589338a8

See more details on using hashes here.

File details

Details for the file data_ai_sdk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: data_ai_sdk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 98.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for data_ai_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 108a0eeb34e9fe74dc31659f53ec65ee352d5682d837f449b133800bb5c891e8
MD5 87e7ef490e1598a40239e03ebb25fd9e
BLAKE2b-256 f6752fe4ffcbe17e0f87de8e27743af0f417acf25cf395901e73ca198b5d05e6

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.2

2 files

0.0.2

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page