Create Agent
Programmatically create an AI Studio Agent. Each agent combines a persona, a set of abilities, and full access to OpenMetadata into a ready-to-use assistant you can invoke from any SDK.
Body Parameters
Unique name for the agent. Used as the identifier in API calls (e.g., DataQualityPlannerAgent). Must be alphanumeric with no spaces.
A short description of what the agent does. This is displayed in the AI Studio UI and returned in list responses.
Name of the persona to assign to this agent. The persona defines the agent’s behavior and personality. Must reference an existing persona.
Human-readable display name for the agent. If omitted, defaults to name.
Whether the agent can be invoked via the API. Set to true to allow SDK and CLI access.
List of ability names to enable for the agent. Abilities determine what tools and actions the agent can use.
search_metadata — Search across OpenMetadata
get_entity_details — Retrieve detailed entity information
get_entity_lineage — Explore lineage graphs
create_glossary — Create glossary entries
create_glossary_term — Create glossary terms
create_lineage — Create lineage edges
patch_entity — Update entity metadata
Additional system prompt appended to the persona’s base prompt. Use this to provide agent-specific instructions without creating a new persona.
LLM provider to use for the agent. Supported values: openai, anthropic, azure_openai.
Name of the OpenMetadata bot whose credentials the agent uses. If omitted, uses the default bot.
from ai_sdk import AISdk, AISdkConfig
from ai_sdk.models import CreateAgentRequest
config = AISdkConfig.from_env()
client = AISdk.from_config(config)
agent = client.create_agent(CreateAgentRequest(
name = "DataQualityPlannerAgent" ,
description = "Analyzes tables and recommends data quality tests" ,
persona = "DataAnalyst" ,
display_name = "Data Quality Planner" ,
api_enabled = True ,
abilities = [
"search_metadata" ,
"get_entity_details" ,
"get_entity_lineage"
],
prompt = "Focus on data quality best practices and recommend specific test types."
))
print ( f "Created agent: { agent.name } (ID: { agent.id } )" )
{
"id" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"name" : "DataQualityPlannerAgent" ,
"display_name" : "Data Quality Planner" ,
"description" : "Analyzes tables and recommends data quality tests" ,
"persona" : "DataAnalyst" ,
"api_enabled" : true ,
"abilities" : [
"search_metadata" ,
"get_entity_details" ,
"get_entity_lineage"
],
"prompt" : "Focus on data quality best practices and recommend specific test types." ,
"provider" : "openai" ,
"created_at" : "2025-06-15T10:30:00Z" ,
"updated_at" : "2025-06-15T10:30:00Z"
}
Returns
Returns the created AgentInfo object with all specified properties and system-generated fields.
Response
Unique identifier for the agent (UUID format).
Agent name used in API calls.
Human-readable display name.
Description of the agent.
Name of the assigned persona.
Whether the agent is accessible via the API.
List of enabled ability names.
Additional system prompt for the agent.
LLM provider used by the agent.
ISO 8601 timestamp of when the agent was created.
ISO 8601 timestamp of when the agent was last updated.
List Agents
Retrieve all API-enabled AI Studio Agents available in your OpenMetadata instance.
from ai_sdk import AISdk, AISdkConfig
config = AISdkConfig.from_env()
client = AISdk.from_config(config)
agents = client.list_agents()
for agent in agents:
print ( f " { agent.name } : { agent.description } (API: { agent.api_enabled } )" )
{
"data" : [
{
"id" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
"name" : "DataQualityPlannerAgent" ,
"display_name" : "Data Quality Planner" ,
"description" : "Analyzes tables and recommends data quality tests" ,
"persona" : "DataAnalyst" ,
"api_enabled" : true ,
"abilities" : [ "search_metadata" , "get_entity_details" , "get_entity_lineage" ],
"provider" : "openai"
},
{
"id" : "b2c3d4e5-f6a7-8901-bcde-f23456789012" ,
"name" : "SqlQueryAgent" ,
"display_name" : "SQL Query Agent" ,
"description" : "Generates and explains SQL queries based on your metadata" ,
"persona" : "SqlExpert" ,
"api_enabled" : true ,
"abilities" : [ "search_metadata" , "get_entity_details" ],
"provider" : "openai"
}
]
}
Error Handling
Code Error Type Description 400BAD_REQUESTInvalid request body, missing required fields, or invalid ability names 401UNAUTHORIZEDInvalid or missing authentication token 403FORBIDDENUser lacks permission to create agents 404PERSONA_NOT_FOUNDThe referenced persona does not exist 409ENTITY_ALREADY_EXISTSAn agent with the same name already exists