Skip to main content
POST
https://sandbox.open-metadata.org/api
/
api
/
v1
/
agents
/
personas
POST
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"
}

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

name
string
required
Unique name for the persona. Used as the identifier when assigning to agents. Must be alphanumeric with no spaces.
description
string
required
A short description of the persona’s role and capabilities. Displayed in the AI Studio UI.
prompt
string
required
The system prompt that defines the persona’s behavior, tone, and instructions. This is prepended to every agent conversation that uses this persona.
display_name
string
Human-readable display name for the persona. If omitted, defaults to name.
provider
string
default:"openai"
Default LLM provider for agents using this persona. Supported values: openai, anthropic, azure_openai.
POST
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

id
string
Unique identifier for the persona (UUID format).
name
string
Persona name used as the identifier when assigning to agents.
display_name
string
Human-readable display name.
description
string
Description of the persona.
prompt
string
The system prompt that defines the persona’s behavior.
provider
string
Default LLM provider for this persona.
created_at
string
ISO 8601 timestamp of when the persona was created.
updated_at
string
ISO 8601 timestamp of when the persona was last updated.

List Personas

Retrieve all personas available in your OpenMetadata instance.
GET
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

CodeError TypeDescription
400BAD_REQUESTInvalid request body, missing required fields, or invalid provider
401UNAUTHORIZEDInvalid or missing authentication token
403FORBIDDENUser lacks permission to create personas
409ENTITY_ALREADY_EXISTSA persona with the same name already exists