✨TypeScript-first persona generation
Generate Realistic Personas
with Statistical Distributions
Create diverse, statistically accurate personas using mathematical distributions, AI-powered insights, and real-world correlations. Perfect for testing, simulations, and user research.
Get Started
npm install @jamesaphoenix/persona-sdk
🎲
Statistical Distributions
Use Normal, Uniform, Exponential, and other distributions to generate realistic attributes.
🤖
AI-Powered
Create personas from natural language prompts using OpenAI or LangChain integration.
👥
Group Management
Manage collections of personas with statistical analysis and structured output generation.
Quick Example
quick-start.ts
1import { 2 PersonaBuilder, 3 PersonaGroup, 4 NormalDistribution,5 CategoricalDistribution 6} from '@jamesaphoenix/persona-sdk';7
8// Create a single persona9const persona = PersonaBuilder.create()10 .setName('Alex Chen')11 .setAge(28)12 .setOccupation('Product Manager')13 .build();14
15// Create a group with distributions16const group = new PersonaGroup('Tech Workers');17group.generateFromDistributions(100, {18 age: new NormalDistribution(32, 8),19 occupation: new CategoricalDistribution([20 { value: 'Engineer', probability: 0.6 },21 { value: 'Designer', probability: 0.4 }22 ])23});24
25// Get statistics26const stats = group.getStatistics('age');27console.log(`Average age: ${stats.mean.toFixed(1)}`);