atlasbot: treat hottest queries as metrics

This commit is contained in:
Brad Stein 2026-02-01 14:27:50 -03:00
parent 6727c26ffe
commit 90423b6b10
2 changed files with 6 additions and 0 deletions

View File

@ -229,6 +229,11 @@ class AnswerEngine:
classify["needs_snapshot"] = True classify["needs_snapshot"] = True
if re.search(r"\b(how many|count|number of|list)\b", normalized.lower()): if re.search(r"\b(how many|count|number of|list)\b", normalized.lower()):
classify["question_type"] = "metric" classify["question_type"] = "metric"
hottest_terms = ("hottest", "highest", "lowest", "most")
metric_terms = ("cpu", "ram", "memory", "net", "network", "io", "disk", "load", "usage")
lowered_question = normalized.lower()
if any(term in lowered_question for term in hottest_terms) and any(term in lowered_question for term in metric_terms):
classify["question_type"] = "metric"
if classify.get("follow_up") and state and state.claims: if classify.get("follow_up") and state and state.claims:
if observer: if observer:

View File

@ -24,6 +24,7 @@ ROUTE_SYSTEM = (
+ " Route the question to the best sources and answer style. " + " Route the question to the best sources and answer style. "
+ "Assume questions are about the Titan Lab Atlas Kubernetes cluster unless the user explicitly asks about something else. " + "Assume questions are about the Titan Lab Atlas Kubernetes cluster unless the user explicitly asks about something else. "
+ "Prefer snapshot evidence when available. " + "Prefer snapshot evidence when available. "
+ "If the question asks for hottest/highest/lowest CPU/RAM/NET/IO/Disk nodes, mark it as a metric question and require snapshot evidence. "
+ "Return JSON only." + "Return JSON only."
) )