Module: Collavre::AgentTypeClassifier

Defined in:
app/services/collavre/agent_type_classifier.rb

Overview

Classifies an AI user/agent into a coarse role type by scanning its system prompt. Shared by the orchestration and system-events context builders so the prompt-to-type mapping lives in exactly one place.

Class Method Summary collapse

Class Method Details

.classify(user) ⇒ Object

Returns the agent type string ("developer", "pm", "qa", "researcher", "marketer", "planner") or "agent" as the default when nothing matches.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/services/collavre/agent_type_classifier.rb', line 10

def classify(user)
  prompt = user.system_prompt.to_s.downcase
  case prompt
  when /developer|개발/ then "developer"
  when /pm|project.?manager|프로젝트/ then "pm"
  when /qa|test|quality|테스트|품질/ then "qa"
  when /research|조사|연구/ then "researcher"
  when /market|마케팅/ then "marketer"
  when /plan|기획/ then "planner"
  else "agent"
  end
end