Create Persona
A persona defines the behavioral instructions and personality of an AI Studio Agent. Each persona contains
a system prompt that shapes how the agent responds to user queries. Multiple agents can share the same
persona, making it easy to standardize behavior across different agent configurations.
Body Parameters
Unique identifier for the persona. Used when assigning the persona to an agent. Must be alphanumeric with no spaces.
Short description of the persona’s role and behavior. Shown in the AI Studio UI.
System prompt that defines the persona’s behavior, tone, and instructions. This prompt is prepended to every conversation the agent has.
Human-readable display name for the persona. Defaults to name if not provided.
Default LLM provider for agents using this persona. One of: openai, anthropic, azure_openai. Can be overridden at the agent level.
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="A meticulous data analyst focused on data quality",
prompt=(
"You are an expert data analyst working with Collate. "
"You specialize in analyzing table schemas, identifying data quality issues, "
"and recommending appropriate tests. Always reference specific columns and "
"provide actionable recommendations. Use the available MCP tools to look up "
"metadata before making suggestions."
),
display_name="Data Analyst",
))
print(f"Created persona: {persona.name}")
{
"name": "DataAnalyst",
"displayName": "Data Analyst",
"description": "A meticulous data analyst focused on data quality",
"prompt": "You are an expert data analyst working with Collate. You specialize in analyzing table schemas, identifying data quality issues, and recommending appropriate tests. Always reference specific columns and provide actionable recommendations. Use the available MCP tools to look up metadata before making suggestions.",
"provider": "openai",
"createdAt": "2025-07-15T10:00:00Z",
"updatedAt": "2025-07-15T10:00:00Z"
}
Response
Unique identifier for the persona.
Human-readable display name.
Description of the persona’s role and behavior.
The full system prompt that defines the persona’s behavior.
Default LLM provider for agents using this persona.
ISO 8601 timestamp of when the persona was created.
ISO 8601 timestamp of the last update.
List Personas
Retrieve all personas available in your Collate instance.
GET /api/v1/agents/personas/
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}")
print(f" Prompt: {persona.prompt[:80]}...")
[
{
"name": "DataAnalyst",
"displayName": "Data Analyst",
"description": "A meticulous data analyst focused on data quality",
"prompt": "You are an expert data analyst working with Collate...",
"provider": "openai"
},
{
"name": "SqlExpert",
"displayName": "SQL Expert",
"description": "Generates optimized SQL queries from natural language",
"prompt": "You are an expert SQL developer. Given a natural language question...",
"provider": "openai"
}
]
Error Handling
| Code | Error Type | Description |
|---|
400 | BAD_REQUEST | Invalid request body or missing required fields |
401 | UNAUTHORIZED | Invalid or missing JWT token |
403 | FORBIDDEN | User lacks permission to create personas |
409 | CONFLICT | Persona with the same name already exists |
500 | INTERNAL_SERVER_ERROR | Internal error during persona creation |