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
Tip
This guide assumes you've already set up your organization and configured an LLM provider in Settings → LLM Configuration. If not, do that first.

Basic Persona Setup

Every persona starts with basic identity information. This helps users and team members understand what the persona is for.

Required Fields

JSON
{
  "name": "Customer Support Agent",
  "description": "Handles customer inquiries professionally and efficiently",
  "type": "CUSTOMER_SERVICE",
  "systemPrompt": "You are a helpful customer support agent..."
}

Persona Types

GENERAL

Multi-purpose assistant

CUSTOMER_SERVICE

Support and help desk

SALES

Sales and marketing

TECHNICAL

Technical expertise

CREATIVE

Creative content

EDUCATIONAL

Teaching and tutoring

Choosing LLM Provider

AIPersona supports multiple LLM providers. Choose based on your needs for capabilities, cost, and speed.

Supported Providers

ProviderModelsBest For
OPENAI
GPT-4o, GPT-4, GPT-3.5 TurboGeneral purpose, best overall
ANTHROPIC
Claude 3 Opus/Sonnet/HaikuLong context, safety-focused
GOOGLE
Gemini Pro, Gemini UltraMultimodal, Google integration
AZURE_OPENAI
Azure-hosted GPT modelsEnterprise compliance
COHERE
Command, Command-R+RAG, enterprise search
OLLAMA
Llama 2, Mistral, local modelsPrivacy, self-hosted

Configuration via API

Bash
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

Markdown
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
Markdown
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 team

Structured 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

Role

Who the persona is and their identity

Task

What the persona should accomplish

Context

Background information and environment

Reasoning

How to think through problems

Output

Formatting and response style

Stopping

When to end or escalate

Example: Research Assistant

JSON
{
  "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."
  }
}
Tip
In the dashboard, you can toggle "Structured Mode" when creating a persona to use the visual structured prompt builder instead of writing a single system prompt.

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

Web Search
web_search

Search the web for current information, news, facts, and any topic. Useful for personas that need up-to-date information.

Calculator
calculator

Perform mathematical calculations, conversions, and data analysis. Essential for financial, scientific, or analytical personas.

Domain Scraper
domain_scraper

Fetch and extract readable text from websites. Useful for research personas or those that need to analyze web content.

PDF Processor
pdf_processor

Extract, search, summarize, and analyze PDF documents. Great for document-heavy workflows.

Enabling Tools via API

Bash
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
    }
  }'
Note
Set 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

PDF
Product manuals, reports
DOCX
Word documents
TXT
Plain text files
MD
Markdown files
DOC
Legacy Word

Uploading Documents via API

JavaScript
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:

JSON
{
  "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

ParameterRangeDefaultDescription
temperature0.0 - 2.00.7Controls randomness. Lower = more focused, higher = more creative
maxTokens1 - 4096+2000Maximum response length in tokens

Temperature Guidelines

Low (0.1-0.3)

Factual tasks, code generation, data analysis

Medium (0.5-0.7)

General conversation, support, balanced responses

High (0.8-1.0)

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

Bash
# 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"}}'
Tip
Use the dashboard's Chat feature for interactive testing. You can quickly iterate on the system prompt and see results in real-time.