Creating Your First Persona
A comprehensive guide to designing, configuring, and deploying AI personas with structured prompts, tools, and knowledge bases.
What You'll Learn
- Basic persona setup and configuration
- Choosing and configuring LLM providers
- Writing effective system prompts
- Using structured prompts (Role/Task/Context)
- Enabling tools (Web Search, Calculator, PDF)
- Uploading documents to knowledge base
- Tuning model parameters
- Testing and iterating your persona
Basic Persona Setup
Every persona starts with basic identity information. This helps users and team members understand what the persona is for.
Required Fields
{
"name": "Customer Support Agent",
"description": "Handles customer inquiries professionally and efficiently",
"type": "CUSTOMER_SERVICE",
"systemPrompt": "You are a helpful customer support agent..."
}Persona Types
Multi-purpose assistant
Support and help desk
Sales and marketing
Technical expertise
Creative content
Teaching and tutoring
Choosing LLM Provider
AIPersona supports multiple LLM providers. Choose based on your needs for capabilities, cost, and speed.
Supported Providers
| Provider | Models | Best For |
|---|---|---|
OPENAI | GPT-4o, GPT-4, GPT-3.5 Turbo | General purpose, best overall |
ANTHROPIC | Claude 3 Opus/Sonnet/Haiku | Long context, safety-focused |
GOOGLE | Gemini Pro, Gemini Ultra | Multimodal, Google integration |
AZURE_OPENAI | Azure-hosted GPT models | Enterprise compliance |
COHERE | Command, Command-R+ | RAG, enterprise search |
OLLAMA | Llama 2, Mistral, local models | Privacy, self-hosted |
Configuration via API
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/persona.create" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{
"json": {
"name": "Claude-powered Assistant",
"llmProvider": "ANTHROPIC",
"model": "claude-3-sonnet-20240229",
"systemPrompt": "You are a helpful assistant...",
"temperature": 0.7,
"maxTokens": 2000
}
}'Writing System Prompts
The system prompt defines your persona's behavior, personality, and guidelines. A well-crafted prompt is essential for consistent, high-quality responses.
Effective System Prompt Structure
You are [role/identity] for [company/context]. Your primary goal is [main objective].
## Your Role
- [Core responsibility 1]
- [Core responsibility 2]
- [Core responsibility 3]
## Personality
- [Personality trait 1]
- [Personality trait 2]
- Communication style: [formal/casual/professional]
## Guidelines
- Always [important behavior]
- When uncertain, [fallback behavior]
- If asked about [topic], respond with [specific approach]
## Constraints
- Never [prohibited action]
- Do not [limitation]
- Always verify [important check]Customer Support Persona
You are a friendly and knowledgeable customer support representative for AIPersona. Your goal is to help users resolve their issues quickly while maintaining a positive experience.
## Your Role
- Provide accurate information about our products
- Guide users through troubleshooting steps
- Escalate complex issues when needed
- Document interactions clearly
## Personality
- Patient and empathetic
- Professional yet approachable
- Clear and concise in explanations
- Proactive in offering help
## Guidelines
- Always greet users warmly
- Ask clarifying questions before providing solutions
- Provide step-by-step instructions when helpful
- Follow up to ensure issues are resolved
## Constraints
- Never share sensitive customer data
- Do not make promises about features or timelines
- Escalate billing disputes to the billing teamStructured Prompts
AIPersona supports structured prompts that break down the system prompt into clear sections. This makes prompts easier to write, maintain, and iterate.
Structured Prompt Sections
Who the persona is and their identity
What the persona should accomplish
Background information and environment
How to think through problems
Formatting and response style
When to end or escalate
Example: Research Assistant
{
"systemPromptStructured": {
"role": "You are a research assistant with expertise in data analysis and academic research. You have deep knowledge of research methodologies and citation practices.",
"task": "Help users find, analyze, and synthesize information from various sources. Assist with literature reviews, data interpretation, and research methodology questions.",
"context": "Users are researchers, students, and academics who need accurate, well-sourced information. They value thoroughness and proper attribution.",
"reasoning": "Always verify information from multiple sources. Think critically about data quality and methodology. Consider potential biases and limitations in research.",
"output": "Provide structured, well-organized responses with proper citations when referencing sources. Use bullet points for lists and clear headings for longer responses.",
"stopping": "Conclude when the research question is fully addressed. If a question requires specialized expertise you don't have, recommend consulting domain experts."
}
}Tools Configuration
Give your persona additional capabilities by enabling built-in tools. Tools allow the persona to search the web, perform calculations, process documents, and more.
Available Tools
Search the web for current information, news, facts, and any topic. Useful for personas that need up-to-date information.
Perform mathematical calculations, conversions, and data analysis. Essential for financial, scientific, or analytical personas.
Fetch and extract readable text from websites. Useful for research personas or those that need to analyze web content.
Extract, search, summarize, and analyze PDF documents. Great for document-heavy workflows.
Enabling Tools via API
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/persona.create" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{
"json": {
"name": "Research Assistant",
"systemPrompt": "You are a research assistant...",
"enabledTools": ["web_search", "calculator", "pdf_processor"],
"useAgent": true
}
}'useAgent: true to enable Agent Mode, which allows the persona to autonomously decide when to use tools based on the conversation context.Knowledge Base Setup
Upload documents to give your persona specialized knowledge. Documents are processed, chunked, and stored in a vector database for RAG (Retrieval Augmented Generation).
Supported Document Types
Uploading Documents via API
const fs = require('fs');
// Read file and convert to base64
const fileBuffer = fs.readFileSync('product-manual.pdf');
const base64Content = fileBuffer.toString('base64');
// Upload to persona's knowledge base
const response = await fetch('https://aipersona.dsethiopia.org/api/trpc/persona.uploadDocuments', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-Key': process.env.AIPERSONA_API_KEY,
'X-Organization-ID': process.env.AIPERSONA_ORG_ID,
},
body: JSON.stringify({
json: {
personaId: 'clx1abc123xyz789',
files: [{
filename: 'product-manual.pdf',
mimetype: 'application/pdf',
encoding: 'base64',
data: base64Content
}]
}
})
});Vector Database Configuration
Choose an embedding model and vector database for your persona's knowledge base:
{
"embeddingModel": "text-embedding-3-small",
"vectorDbProvider": "weaviate"
}Embedding Models: text-embedding-3-small (fast), text-embedding-3-large (accurate), text-embedding-ada-002
Vector DBs: weaviate (default), pinecone, chroma, qdrant, milvus
Model Parameters
Fine-tune your persona's responses by adjusting model parameters.
Key Parameters
| Parameter | Range | Default | Description |
|---|---|---|---|
| temperature | 0.0 - 2.0 | 0.7 | Controls randomness. Lower = more focused, higher = more creative |
| maxTokens | 1 - 4096+ | 2000 | Maximum response length in tokens |
Temperature Guidelines
Factual tasks, code generation, data analysis
General conversation, support, balanced responses
Creative writing, brainstorming, ideation
Testing Your Persona
Before deploying, thoroughly test your persona with various scenarios.
Testing Checklist
Basic Tests
- • Greeting and introduction
- • Common questions for the use case
- • Multi-turn conversations
- • Edge cases and unusual inputs
Advanced Tests
- • Tool usage (if enabled)
- • Knowledge base retrieval
- • Handling out-of-scope requests
- • Frustrated user scenarios
Testing via Chat
# 1. Create a chat session
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/chat.createSession" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{"json": {"personaId": "clx1abc123xyz789", "title": "Test Session"}}'
# 2. Send test messages
curl -X POST "https://aipersona.dsethiopia.org/api/trpc/chat.sendMessage" \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-H "X-Organization-ID: your-org-id" \
-d '{"json": {"chatSessionId": "session_xyz", "content": "Hello! Can you help me?", "role": "USER"}}'