Integration Guide · Phase 6

Pick a Router

Choose how HUMA selects behavioral strategies for your agent.

What is a Router?

Before the agent generates a response, HUMA's router decides HOW the agent should behave. Should it be curious? Playful? Reserved? The router scores different behavioral strategies and the agent acts accordingly.

Event Received
"It's your turn"
Router
Scores strategies
Action Agent
Generates response

Different routers use different methods to score strategies - from fast random selection to LLM-based judgment.

Available Router Types

llm-judgeDefault
Best for: General purpose

Uses an LLM to score 13 behavioral strategies based on personality, context, and the current event. The highest-scored strategies shape the agent's response.

CURIOUS
ASSERTIVE
SUPPORTIVE
PLAYFUL
CAUTIOUS
CHALLENGING
EMPATHETIC
STRATEGIC
DIRECT
REFLECTIVE
ENTHUSIASTIC
RESERVED
QUIET
Context-aware
Personality-driven
~100-200ms latency
random
Best for: Testing, low latency

Randomly selects strategies without LLM call. Fast and unpredictable - good for testing or when you want variety without the latency cost.

Near-instant
No LLM call
Unpredictable behavior
conversational
Best for: Natural dialogue

Designed for conversational flows. Includes "timeliness" scoring - how urgent is it for the agent to respond? Produces more natural back-and-forth dialogue.

Timeliness-aware
Natural pacing
turn-taking
Best for: Multi-agent voice

Optimized for multi-agent voice scenarios where multiple agents might speak. Uses turn-taking strategies to prevent overlapping speech and create natural conversation flow.

Multi-agent friendly
Voice-optimized
voice-game
Best for: Voice gaming scenarios

LLM-based router specialized for voice gaming. Scores 4 game-specific strategies with no timeliness calculation:

GENERAL_TALK
Share stories, start topics
REACT
Respond to game events
TALK_TO_OTHERS
Social, conversational
FOCUS_ON_GAME
Stay quiet, concentrate
Game-aware
Voice-optimized

Choosing a Router

Use CaseRouterWhy
Turn-based game (Go Fish)llm-judgePersonality-driven decisions, strategic thinking
Chat applicationconversationalNatural dialogue flow, timeliness awareness
Voice co-op gamingvoice-gameGame-specific strategies, voice-optimized
Multi-agent voice roomturn-takingPrevents overlapping, natural turn flow
Testing / DevelopmentrandomFast iteration, no LLM cost
Latency-sensitive apprandomSkip router LLM call entirely

Setting the Router

Specify routerType in your agent metadata:

TypeScript
type RouterType = 'random' | 'llm-judge' | 'conversational' | 'turn-taking' | 'voice-game';

const metadata = {
  className: 'Finn',
  personality: FINN_PERSONALITY,
  instructions: FINN_INSTRUCTIONS,
  tools: GO_FISH_TOOLS,
  routerType: 'llm-judge',  // <-- Set router here (default if omitted)
};

For Go Fish, we use llm-judge because:

  • Our agents have distinct personalities (Finn vs Victoria) that should influence behavior
  • Strategic decisions matter - Victoria should be more STRATEGIC, Finn more PLAYFUL
  • Turn-based timing removes latency concerns (no real-time voice pressure)
Go Fish Agent Config
// src/agents.js
export const AGENT_CONFIGS = {
  finn: {
    personality: FINN_PERSONALITY,
    instructions: FINN_INSTRUCTIONS,
    tools: GO_FISH_TOOLS,
    routerType: 'llm-judge',
  },
  victoria: {
    personality: VICTORIA_PERSONALITY,
    instructions: VICTORIA_INSTRUCTIONS,
    tools: GO_FISH_TOOLS,
    routerType: 'llm-judge',
  },
};

How Strategies Affect Behavior

The router's strategy scores directly shape how the agent responds. Here's how different scores might affect our Go Fish agents:

FFinn (Friendly)

High PLAYFUL + ENTHUSIASTIC scores lead to:

  • "Ooh, I'll ask Victoria for some 7s!"
  • "Yes! Got 'em! Thanks Victoria!"
  • "Aw man, go fish again..."

VVictoria (Strategic)

High STRATEGIC + RESERVED scores lead to:

  • "Based on the previous asks, I'll try..."
  • "Interesting. As expected."
  • "Well played."

Personality + Router = Consistent Behavior

The router uses the personality you defined to score strategies. A well-crafted personality will naturally produce consistent, in-character behavior without extra prompting.

When to Change Routers

Same Agent, Different Contexts

You can use the same personality but different routers. For example, Finn might use llm-judge in a turn-based card game but voice-game in a real-time co-op shooter.

Performance Optimization

If latency matters more than nuanced behavior, switch to random. You can always upgrade to llm-judge later.

Multi-Agent Scenarios

When multiple agents might respond simultaneously (voice rooms), consider turn-taking or voice-game to manage coordination.

Common Pitfalls

Using random for production

random is great for testing but produces inconsistent personality. Use llm-judge or conversational for production.

Wrong router for voice

Using llm-judge in real-time voice can feel sluggish. Consider voice-game or turn-taking for better voice UX.

Over-engineering router choice

Start with llm-judge. Only switch if you have specific issues (latency, multi-agent conflicts, voice timing). Most apps work fine with the default.

Summary

Quick Reference

  • llm-judge — Default, personality-driven
  • random — Fast, for testing
  • conversational — Natural dialogue
  • turn-taking — Multi-agent voice
  • voice-game — Voice gaming

For Go Fish

We use llm-judge because:

  • • Strong personality expression (Finn vs Victoria)
  • • Strategic decisions matter
  • • Turn-based = no latency pressure

You're Done!

Congratulations! You've completed all 6 phases of the HUMA integration guide. You now know how to:

Phase 1

Design engaging personalities

Phase 2

Write clear instructions

Phase 3

Structure agent state

Phase 4

Send events and handle tool results

Phase 5

Define and execute tools

Phase 6

Choose the right router

Check out the API Reference for detailed endpoint documentation, or explore the full Go Fish example code on GitHub.