Create Persona
Create a persona that defines the behavior, personality, and system instructions for AI Studio Agents. A persona acts as the foundation for one or more agents, providing a reusable identity and base prompt.
Body Parameters
Unique name for the persona. Used as the identifier when assigning to agents. Must be alphanumeric with no spaces.
A short description of the persona’s role and capabilities. Displayed in the AI Studio UI.
The system prompt that defines the persona’s behavior, tone, and instructions. This is prepended to every agent conversation that uses this persona.
Human-readable display name for the persona. If omitted, defaults to name.
Default LLM provider for agents using this persona. Supported values: openai, anthropic, azure_openai.
from ai_sdk import AISdk, AISdkConfig
from ai_sdk.models import CreatePersonaRequest
config = AISdkConfig.from_env()
client = AISdk.from_config(config)
persona = client.create_persona(CreatePersonaRequest(
name="DataAnalyst",
description="Expert data analyst focused on data quality and governance",
display_name="Data Analyst",
prompt="""You are an expert data analyst with deep knowledge of data quality,
data governance, and metadata management. When analyzing tables:
1. Examine column names, types, and descriptions
2. Identify potential data quality issues
3. Recommend specific test types with thresholds
4. Consider relationships with other tables via lineage
Always provide actionable recommendations with concrete examples."""
))
print(f"Created persona: {persona.name} (ID: {persona.id})")
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"name": "DataAnalyst",
"display_name": "Data Analyst",
"description": "Expert data analyst focused on data quality and governance",
"prompt": "You are an expert data analyst with deep knowledge of data quality, data governance, and metadata management. When analyzing tables:\n\n1. Examine column names, types, and descriptions\n2. Identify potential data quality issues\n3. Recommend specific test types with thresholds\n4. Consider relationships with other tables via lineage\n\nAlways provide actionable recommendations with concrete examples.",
"provider": "openai",
"created_at": "2025-06-15T10:30:00Z",
"updated_at": "2025-06-15T10:30:00Z"
}
Returns
Returns the created PersonaInfo object with all specified properties and system-generated fields.
Response
Unique identifier for the persona (UUID format).
Persona name used as the identifier when assigning to agents.
Human-readable display name.
Description of the persona.
The system prompt that defines the persona’s behavior.
Default LLM provider for this persona.
ISO 8601 timestamp of when the persona was created.
ISO 8601 timestamp of when the persona was last updated.
List Personas
Retrieve all personas available in your OpenMetadata instance.
from ai_sdk import AISdk, AISdkConfig
config = AISdkConfig.from_env()
client = AISdk.from_config(config)
personas = client.list_personas()
for persona in personas:
print(f"{persona.name}: {persona.description}")
{
"data": [
{
"id": "c3d4e5f6-a7b8-9012-cdef-345678901234",
"name": "DataAnalyst",
"display_name": "Data Analyst",
"description": "Expert data analyst focused on data quality and governance",
"provider": "openai"
},
{
"id": "d4e5f6a7-b8c9-0123-defa-456789012345",
"name": "SqlExpert",
"display_name": "SQL Expert",
"description": "Specializes in SQL query generation and optimization",
"provider": "openai"
}
]
}
Error Handling
| Code | Error Type | Description |
|---|
400 | BAD_REQUEST | Invalid request body, missing required fields, or invalid provider |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to create personas |
409 | ENTITY_ALREADY_EXISTS | A persona with the same name already exists |