Class: Chorus::Router

Inherits:
Object
  • Object
show all
Defined in:
lib/chorus/router.rb

Overview

Decides which agent should handle a given user message.

v0.1.0 uses simple keyword matching (no LLM call). The public interface is a single method, route, so this class can be swapped for an LLM-based router later without touching Orchestrator.

Constant Summary collapse

CODER_KEYWORDS =

Words that, when present in a message, indicate a coding task.

%w[code bug function error debug script class method variable
exception refactor].freeze
DEFAULT_AGENT =
:research

Instance Method Summary collapse

Instance Method Details

#route(message) ⇒ Symbol

Returns the agent name that should handle this message (:coder or :research).

Parameters:

  • message (String)

    the raw user message

Returns:

  • (Symbol)

    the agent name that should handle this message (:coder or :research)



18
19
20
# File 'lib/chorus/router.rb', line 18

def route(message)
  coding_task?(message) ? :coder : DEFAULT_AGENT
end