Skip to main content

Alation Agent SDK

Project description

Alation AI Agent SDK

The Alation AI Agent SDK is a Python library that enables AI agents to access and leverage metadata from the Alation Data Catalog.

Overview

This SDK provides a simple, programmatic way for AI applications to:

  • Retrieve contextual information from the Alation catalog using natural language questions
  • Search for and retrieve data products by product ID or natural language queries
  • Customize response formats using signature specifications

Installation

pip install alation-ai-agent-sdk

Prerequisites

To use the SDK, you'll need:

  • Python 3.10 or higher
  • Access to an Alation Data Catalog instance
  • A valid refresh token or client_id and secret. For more details, refer to the Authentication Guide.
  • If you cannot obtain service account credentials (admin only), see the User Account Authentication Guide for instructions.

Quick Start

from alation_ai_agent_sdk import AlationAIAgentSDK, ServiceAccountAuthParams

# Initialize the SDK using service account authentication (recommended)

sdk = AlationAIAgentSDK(
    base_url="https://your-alation-instance.com",
    auth_method="service_account",
    auth_params=ServiceAccountAuthParams(
        client_id="your-client-id",
        client_secret="your-client-secret"
    )
)

# Ask a question about your data
response = sdk.get_context(
    "What tables contain sales information?"
)
print(response)

# Use a signature to customize the response format
signature = {
    "table": {
        "fields_required": ["name", "title", "description"]
    }
}

response = sdk.get_context(
    "What are the customer tables?",
    signature
)
print(response)

# Retrieve a data product by ID
data_product_by_id = sdk.get_data_products(product_id="finance:loan_performance_analytics")
print(data_product_by_id)

# Search for data products using a natural language query
data_products_by_query = sdk.get_data_products(query="customer analytics dashboards")
print(data_products_by_query)

Core Features

Response Customization with Signatures

You can customize the data returned by the Alation context tool using signatures:

# Only include specific fields for tables
table_signature = {
    "table": {
        "fields_required": ["name", "description", "url"]
    }
}

response = sdk.get_context(
    "What are our fact tables?",
    table_signature
)

For detailed documentation on signature format and capabilities, see Using Signatures .

Getting Available Tools

# Get all available tools
tools = sdk.get_tools()

Using the UpdateCatalogAssetMetadata Tool

The UpdateCatalogAssetMetadata tool allows you to update metadata for one or more Alation catalog assets using custom field values.

Example

from alation_ai_agent_sdk import AlationAIAgentSDK, ServiceAccountAuthParams

sdk = AlationAIAgentSDK(
    base_url="https://your-alation-instance.com",
    auth_method="service_account",
    auth_params=ServiceAccountAuthParams(
        client_id="your-client-id",
        client_secret="your-client-secret"
    )
)

custom_field_values = [
    {
        "oid": "123",
        "otype": "table",
        "field_id": 8,
        "value": "Updated value"
    },
    # ... more objects ...
]

result = sdk.update_catalog_asset_metadata(custom_field_values)
print(result)

Check Job Status Tool

The check_job_status tool allows you to check the status of a bulk metadata job in Alation by job ID.

Example Usage

from alation_ai_agent_sdk import AlationAIAgentSDK

sdk = AlationAIAgentSDK(
    base_url="https://your-alation-instance.com",
    auth_method="service_account",
    auth_params=("your-client-id", "your-client-secret")
)

job_status = sdk.check_job_status(123)
print(job_status)
  • Parameters:
    • job_id (int): The integer job identifier returned by a previous bulk operation.
  • Returns:
    • The job status and details as a JSON object.

Project details


Download files

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

Source Distribution

alation_ai_agent_sdk-0.10.2.tar.gz (58.5 kB view details)

Uploaded Source

Built Distribution

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

alation_ai_agent_sdk-0.10.2-py3-none-any.whl (49.3 kB view details)

Uploaded Python 3

File details

Details for the file alation_ai_agent_sdk-0.10.2.tar.gz.

File metadata

  • Download URL: alation_ai_agent_sdk-0.10.2.tar.gz
  • Upload date:
  • Size: 58.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for alation_ai_agent_sdk-0.10.2.tar.gz
Algorithm Hash digest
SHA256 59dbffbd2d8cf1856654bf50488be910b7a8f042491def9f066c7b4df5585b4f
MD5 e58b4f0742b273b9b379e1201212ad1b
BLAKE2b-256 3b44c5330b66ecca966c8bf4a2aadf24b78649d408c6c78851b06e794bb2c02b

See more details on using hashes here.

File details

Details for the file alation_ai_agent_sdk-0.10.2-py3-none-any.whl.

File metadata

File hashes

Hashes for alation_ai_agent_sdk-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 11499876663b85eb2e2031f3a8462af3e58cac11e0bcd3ca1531172bd0983d0d
MD5 deb18efd30d1f7921d6853774a551197
BLAKE2b-256 41ab59191c67dde9c83893d4de56f994b8648ab9feb4c5cdc677b216d89541f4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page