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.
Different routers use different methods to score strategies - from fast random selection to LLM-based judgment.
Available Router Types
llm-judgeDefaultUses an LLM to score 13 behavioral strategies based on personality, context, and the current event. The highest-scored strategies shape the agent's response.
randomRandomly selects strategies without LLM call. Fast and unpredictable - good for testing or when you want variety without the latency cost.
conversationalDesigned for conversational flows. Includes "timeliness" scoring - how urgent is it for the agent to respond? Produces more natural back-and-forth dialogue.
turn-takingOptimized for multi-agent voice scenarios where multiple agents might speak. Uses turn-taking strategies to prevent overlapping speech and create natural conversation flow.
voice-gameLLM-based router specialized for voice gaming. Scores 4 game-specific strategies with no timeliness calculation:
Choosing a Router
| Use Case | Router | Why |
|---|---|---|
| Turn-based game (Go Fish) | llm-judge | Personality-driven decisions, strategic thinking |
| Chat application | conversational | Natural dialogue flow, timeliness awareness |
| Voice co-op gaming | voice-game | Game-specific strategies, voice-optimized |
| Multi-agent voice room | turn-taking | Prevents overlapping, natural turn flow |
| Testing / Development | random | Fast iteration, no LLM cost |
| Latency-sensitive app | random | Skip router LLM call entirely |
Setting the Router
Specify routerType in your agent metadata:
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)
// 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-drivenrandom— Fast, for testingconversational— Natural dialogueturn-taking— Multi-agent voicevoice-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:
Design engaging personalities
Write clear instructions
Structure agent state
Send events and handle tool results
Define and execute tools
Choose the right router
Check out the API Reference for detailed endpoint documentation, or explore the full Go Fish example code on GitHub.