Skip to main content
Component: RoutingAgent - Multi-agent orchestration Module: gaia_agent_routing.agent Import: from gaia_agent_routing.agent import RoutingAgent

Overview

RoutingAgent intelligently routes user requests for code generation to CodeAgent with automatic parameter disambiguation. It uses LLM-based analysis for language/framework detection and falls back to interactive clarification when the request is ambiguous.
Today RoutingAgent only routes to CodeAgent — other agent types raise ValueError("Unknown agent type"). Additionally, the Code Agent path currently only supports TypeScript (Next.js): non-TypeScript requests are coerced to TypeScript when the language can’t be inferred, and requests that explicitly pick an unsupported language raise SystemExit(1) with a clear message. Jira/Docker/etc. routing is on the roadmap but not wired up.
Key Features:
  • LLM-powered request analysis (CodeAgent-only today)
  • TypeScript/Next.js enforcement with automatic fallback
  • Interactive parameter disambiguation
  • Recursive clarification with conversation history
  • API and CLI mode support
  • Fallback keyword detection
  • Agent configuration and instantiation

API Specification


Usage Examples

Example 1: CLI Mode with Disambiguation

Example 2: API Mode (Auto-Execute)

Example 3: Explicit Parameters


Testing Requirements


Dependencies

RoutingAgent ships as the standalone gaia-agent-routing wheel and depends only on the LLM client. CodeAgent ships as the standalone gaia-agent-code wheel (#1397, #1102); RoutingAgent resolves it lazily at runtime through the agent registry (AgentRegistry().create_agent("code", ...)) and raises an actionable error if the wheel is not installed — it does not hard-depend on the package.
RoutingAgent Technical Specification