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
Metadata
Release files for data-ai-sdk 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| data_ai_sdk-0.3.0.tar.gz | 95.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| data_ai_sdk-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 194.6 kB
Release files / data_ai_sdk-0.3.0.tar.gz
| Download URL | data_ai_sdk-0.3.0.tar.gz |
|---|---|
| Size | 95.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
708628cc7b0f1a9e0bdc1781e952c6f7a064d1fae963ee1d44e96a86abf40919
|
|
BLAKE2b-256 checksum How to use checksums |
784b0f4cadd79d63b1accc59cb70a00747609b207b0fff4e9fc2fba0589338a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Release files / data_ai_sdk-0.3.0-py3-none-any.whl
| Download URL | data_ai_sdk-0.3.0-py3-none-any.whl |
|---|---|
| Size | 98.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
108a0eeb34e9fe74dc31659f53ec65ee352d5682d837f449b133800bb5c891e8
|
|
BLAKE2b-256 checksum How to use checksums |
f6752fe4ffcbe17e0f87de8e27743af0f417acf25cf395901e73ca198b5d05e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Security for data-ai-sdk 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.