Skip to main content

What It Does

1

Extract

Feed it 5+ text samples → get a structured persona (7 voice dimensions)
2

Compile

Turn a persona into a compact prompt block for any LLM
3

Filter

Post-generation voice filter catches AI-sounding output (60+ patterns)
4

Track

Voice DNA tracks distinctive phrases confirmed by reuse

The 7 Voice Dimensions

DimensionExample
Tonesharp, witty, blunt
Humordry sarcasm, never forced
Vocabularytechnical, casual
Formalityinformal, no hedging
Perspectivepragmatic minimalist
Emotional rangecontrolled intensity
Sentence lengthshort, punchy

Extraction Quality

Persona extraction includes composite quality scoring:
  • Minimum 3 samples required, 5+ recommended
  • Diversity scoring via Type-Token Ratio — detects if samples are too similar
  • Confidence score (0.0–1.0) based on sample count (30%), diversity (40%), and content richness (30%)
  • Warnings for low-quality extractions
use laminae::persona::{PersonaExtractor, VoiceFilter, VoiceFilterConfig, compile_persona};

let extractor = PersonaExtractor::new("qwen2.5:7b");
let persona = extractor.extract(&samples).await?;

// Check extraction quality
if let Some(quality) = &persona.meta.quality {
    println!("Confidence: {:.0}%", quality.confidence * 100.0);
    println!("Diversity: {:.0}%", quality.diversity_score * 100.0);
    for warning in &quality.warnings {
        eprintln!("Warning: {warning}");
    }
}

let prompt_block = compile_persona(&persona);

Voice Filter

The voice filter catches AI-sounding output with 6 detection layers:
LayerWhat It Catches
AI vocabulary60+ phrases like “it’s important to note”, “furthermore”, “delve”
Meta-commentary”The post highlights…” openers
Multi-paragraphOptional rejection of multi-paragraph responses
Trailing questionsGeneric AI questions at the end
Em-dashesReplace with periods
Length violationsSentence and character limits
let filter = VoiceFilter::new(VoiceFilterConfig::default());
let result = filter.check("It's important to note that...");
// result.passed = false
// result.violations = ["AI vocabulary detected: ..."]
// result.retry_hints = ["DO NOT use formal/academic language..."]

Voice DNA

Tracks distinctive phrases that define a person’s writing. When generated text receives positive feedback, distinctive phrases are recorded and reinforced.
use laminae::persona::VoiceDna;

let mut dna = VoiceDna::empty();
dna.record_success("Nobody reads your README. Ship it or delete it.");
// "Nobody reads" is now tracked as a distinctive phrase
The voice filter is WASM-compatible and available via Python bindings. The extractor requires Ollama (native only).