Portal Community

Routing Levels

Routing happens at two levels:

  1. Area selection: Which area does this user's request go to? (User-driven or URL-based)
  2. Agent selection within area: Which agent within the area handles this message? (Intent-driven via AgentRouter)

Area Selection Methods

MethodHow It WorksBest For
User chooses area in chat-appArea selector dropdown in chat-app UI; user explicitly picks HR/Finance/ITPower users with multi-area access
Default area per user groupUser's primary group maps to a default area; first area shown on loginMost employees who only need one area
URL-based areaEmbedded chat-app URL includes areaId: /chat?areaId=area_hrEmbedded chatbots in specific pages (HR portal, Finance portal)
Single-area deploymentOnly one area configured; no selection neededSimple deployments

Agent Selection Within Area

When an area has multiple agents, the AgentRouter selects which agent handles each message based on configured routing strategy:

// Area-level routing configuration
{
  "areaId":          "area_hr",
  "routingStrategy": "Embedding",  // Embedding | LLM | Default | RoundRobin
  "defaultAgentId":  "agent_hr_general",
  "agents": [
    {
      "agentId":     "agent_hr_general",
      "description": "General HR questions, policies, and information"
    },
    {
      "agentId":     "agent_leave_manager",
      "description": "Leave requests, leave balance, leave approval and cancellation"
    },
    {
      "agentId":     "agent_onboarding",
      "description": "New employee onboarding, document collection, system access setup"
    }
  ]
}

// AgentRouter embeds user message and compares cosine similarity
// to each agent's description embedding → picks highest similarity agent

Handoff Within an Area

// When an agent determines another area agent is more appropriate:
// (e.g. HR General assistant receives a leave request)
Handler for "handoff_to_agent":
{
  "targetAgentId":  "agent_leave_manager",
  "reason":         "User requested leave — routing to Leave Manager",
  "contextSummary": "User Mary K (EMP-1042) wants to take 5 days in June 2025."
}

// The session switches to the leave_manager agent
// The context summary is injected into the new agent's working memory
// User sees a seamless handoff notification in the chat-app