PAI Agent System

Authoritative reference for agent routing in PAI. Three distinct systems exist—never confuse them.


🚨 THREE AGENT SYSTEMS — CRITICAL DISTINCTION

PAI has three agent systems that serve different purposes. Confusing them causes routing failures.

SystemWhat It IsWhen to UseHas Unique Voice?
Task Tool Subagent TypesPre-built agents in Claude Code (Architect, Designer, Engineer, Explore, etc.)Internal workflow use ONLYNo
Named AgentsPersistent identities with backstories and ElevenLabs voices (Serena, Marcus, Rook, etc.)Recurring work, voice output, relationshipsYes
Custom AgentsDynamic agents composed via ComposeAgent from traitsWhen user says “custom agents”Yes (trait-mapped)

🚫 FORBIDDEN PATTERNS

When user says “custom agents”:

// ❌ WRONG - These are Task tool subagent_types, NOT custom agents
Task({ subagent_type: "Architect", prompt: "..." })
Task({ subagent_type: "Designer", prompt: "..." })
Task({ subagent_type: "Engineer", prompt: "..." })
 
// ✅ RIGHT - Invoke the Agents skill for custom agents
Skill("Agents")  // → CreateCustomAgent workflow
// OR follow the workflow directly:
// 1. Run ComposeAgent with different trait combinations
// 2. Launch agents with the generated prompts
// 3. Each gets unique personality + voice

Routing Rules

The Word “Custom” Is the Trigger

User SaysActionImplementation
custom agents”, “spin up custom agents”Invoke Agents skillSkill("Agents") → CreateCustomAgent workflow
”agents”, “launch agents”, “parallel agents”Custom agents via Agents skillSkill("Agents") → ComposeAgent → Task({ subagent_type: "general-purpose" })
”research X”, “investigate Y”Research skillSkill("Research") → appropriate researcher agents
”use Remy”, “get Ava to”Named agentUse appropriate researcher subagent_type
(Code implementation)EngineerTask({ subagent_type: "Engineer" })
(Architecture/design)ArchitectTask({ subagent_type: "Architect" })

Custom Agent Creation Flow

When user requests custom agents:

  1. Invoke Agents skill via Skill("Agents") or follow CreateCustomAgent workflow
  2. Run ComposeAgent for EACH agent with DIFFERENT trait combinations
  3. Extract prompt and voice_id from ComposeAgent output
  4. Launch agents with Task tool using the composed prompts
  5. Voice results using each agent’s unique voice_id
# Example: 3 custom research agents
bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts --traits "research,enthusiastic,exploratory"
bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts --traits "research,skeptical,systematic"
bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts --traits "research,analytical,synthesizing"

Task Tool Subagent Types (Internal Use Only)

These are pre-built agents in the Claude Code Task tool. They are for internal workflow use, not for user-requested “custom agents.”

Subagent TypePurposeWhen Used
ArchitectSystem designDevelopment skill workflows
DesignerUX/UI designDevelopment skill workflows
EngineerCode implementationDevelopment skill workflows
general-purposeCustom agents via ComposeAgentParallel work with task-specific prompts
ExploreCodebase explorationFinding files, understanding structure
PlanImplementation planningPlan mode
QATesterQuality assuranceBrowser testing workflows
PentesterSecurity testingWebAssessment workflows
ClaudeResearcherClaude-based researchResearch skill workflows
GeminiResearcherGemini-based researchResearch skill workflows
GrokResearcherGrok-based researchResearch skill workflows

These do NOT have unique voices or ComposeAgent composition.


Named Agents (Persistent Identities)

Named agents have rich backstories, personality traits, and mapped ElevenLabs voices. They provide relationship continuity across sessions.

AgentRoleVoiceUse For
Serena BlackwoodArchitectPremium UK FemaleLong-term architecture decisions
Marcus WebbEngineerPremium MaleStrategic technical leadership
Rook BlackburnPentesterEnhanced UK MaleSecurity testing with personality
Ava SterlingClaude ResearcherPremium US FemaleStrategic research
Alex RiveraGemini ResearcherMulti-perspectiveComprehensive analysis

Full backstories and voice settings: Individual agents/*.md files (persona frontmatter + body)


Custom Agents (Dynamic Composition)

Custom agents are composed on-the-fly from traits using ComposeAgent. Each unique trait combination maps to a different ElevenLabs voice.

Trait Categories

Expertise (domain knowledge): security, legal, finance, medical, technical, research, creative, business, data, communications

Personality (behavior style): skeptical, enthusiastic, cautious, bold, analytical, creative, empathetic, contrarian, pragmatic, meticulous

Approach (work style): thorough, rapid, systematic, exploratory, comparative, synthesizing, adversarial, consultative

Voice Mapping Examples

Trait ComboVoiceWhy
contrarian + skepticalClyde (gravelly)Challenging intensity
enthusiastic + creativeJeremy (energetic)High-energy creativity
security + adversarialCallum (edgy)Hacker character
analytical + meticulousCharlotte (sophisticated)Precision analysis

Full trait definitions and voice mappings: skills/Agents/Data/Traits.yaml


Model Selection

Always specify the appropriate model for agent work:

Task TypeModelSpeed
Simple checks, grunt workhaiku10-20x faster
Standard analysis, implementationsonnetBalanced
Deep reasoning, architectureopusMaximum intelligence
// Parallel custom agents benefit from haiku/sonnet for speed
Task({ prompt: agentPrompt, subagent_type: "general-purpose", model: "sonnet" })

Spotcheck Pattern

Always launch a spotcheck agent after parallel work:

Task({
  prompt: "Verify consistency across all agent outputs: [results]",
  subagent_type: "general-purpose",
  model: "haiku"
})

Agent Identity (WIMSE)

Every PAI agent has a stable, globally unique WIMSE/SPIFFE URI. This is the canonical identity for each agent — used in delegation chains, audit trails, and future zeroid integration (Tier 1 of highflame-ai/zeroid).

URI format: spiffe://pai.local/agent/{slug} — personal infrastructure scope, not public-facing.

External CLI Agents

AgentIDWIMSE URI
PAI Nova Claude (me)AGT-001spiffe://pai.local/agent/pai-nova-claude
PAI Nova GeminiAGT-002spiffe://pai.local/agent/pai-nova-gemini
PAI Nova OpenCodeAGT-003spiffe://pai.local/agent/pai-nova-opencode

Task Tool Subagents

AgentPersonaWIMSE URI
ArchitectSerena Blackwoodspiffe://pai.local/agent/serena-blackwood
EngineerMarcus Webbspiffe://pai.local/agent/marcus-webb
PentesterRook Blackburnspiffe://pai.local/agent/rook-blackburn
ClaudeResearcherAva Sterlingspiffe://pai.local/agent/ava-sterling
GeminiResearcherAlex Riveraspiffe://pai.local/agent/alex-rivera
GrokResearcherJohannesspiffe://pai.local/agent/johannes
CodexResearcherRemyspiffe://pai.local/agent/remy
PerplexityResearcherAva Chenspiffe://pai.local/agent/ava-chen
AlgorithmVera Sterlingspiffe://pai.local/agent/vera-sterling
ArtistPriya Desaispiffe://pai.local/agent/priya-desai
DesignerAditi Sharmaspiffe://pai.local/agent/aditi-sharma
QATesterQuinn Torresspiffe://pai.local/agent/quinn-torres
InternDev Patelspiffe://pai.local/agent/dev-patel
LocalAnalystAdam Qwenspiffe://pai.local/agent/adam-qwen
LocalReasonerCallum Seekspiffe://pai.local/agent/callum-seek
LocalRunnerEric Llamaspiffe://pai.local/agent/eric-llama
LocalSummarizerAntoni Gemmaspiffe://pai.local/agent/antoni-gemma
CodeReviewerspiffe://pai.local/agent/code-reviewer
ProductManagerspiffe://pai.local/agent/product-manager
BackendDevspiffe://pai.local/agent/backend-dev
TeamLeadspiffe://pai.local/agent/team-lead
Testerspiffe://pai.local/agent/tester

Delegation Model

When an agent delegates to a sub-agent, the delegation chain should be preserved in task metadata:

{
  "delegator_uri": "spiffe://pai.local/agent/pai-nova-claude",
  "actor_uri": "spiffe://pai.local/agent/marcus-webb",
  "delegation_depth": 1,
  "scope": "code:write"
}

Tier 2 readiness: When zeroid (docker compose up -d, port 8899) is running, register agents from this table and use client.tokens.delegate() for cross-agent Switchboard routing.


External CLI Agents

External CLI agents are separate AI runtimes invocable from PAI via Bash. They are NOT Claude Code subagents — they cannot be used with the Task tool. They have their own models, skill sets, and provider configurations.

AgentIDAliasRuntimeProviderWIMSE URIInvoke
PAI Nova OpenCodeAGT-003opaiOpenCode v1.4.4Zen (free)spiffe://pai.local/agent/pai-nova-opencodebun run .opencode/PAI/Tools/pai.ts
PAI Nova GeminiAGT-002pngGemini CLI v0.38.0Google Geminispiffe://pai.local/agent/pai-nova-geminigemini

Invoking PAI Nova OpenCode (AGT-003)

One-shot prompt (non-interactive):

/home/duane/.bun/bin/bun run /PAI/Source/Projects/pai-opencode/.opencode/PAI/Tools/pai.ts prompt "your task here"

Interactive session:

opai           # via shell alias (requires sourced ~/.bashrc)

From Claude Code as a Bash delegate:

# Delegate a coding task to OpenCode's zen free models
cd /PAI/Source/Projects/pai-opencode && \
  /home/duane/.bun/bin/bun run .opencode/PAI/Tools/pai.ts prompt "implement X in project Y"

Switchboard routing (async, file-based): Drop a task into PAI outbox with "target_agent": "opencode" — the SwitchboardBridge will route it to the OpenCode inbox.

When to Use OpenCode vs Claude Code

Use OpenCode (AGT-003)Use Claude Code (AGT-001)
Zero-cost coding tasks (zen free)Tasks requiring Claude’s reasoning depth
Provider-agnostic workflowsHook system, memory, PAI infrastructure
OpenCode’s 17 built-in agentsClaude Code Task tool subagents
Budget-critical periodsStandard/full-capability sessions

References

  • Agents Skill: skills/Agents/SKILL.md — Custom agent creation, workflows
  • ComposeAgent: skills/Agents/Tools/ComposeAgent.ts — Dynamic composition tool
  • Traits: skills/Agents/Data/Traits.yaml — Trait definitions and voice mappings
  • Agent Personalities: Individual agents/*.md files — Named agent backstories and voice settings

Last updated: 2026-01-14