From 692b059b5200ec83e608a2e49a7d0f67383771d2 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 3 Feb 2026 23:51:13 -0300 Subject: [PATCH] atlasbot: detect baseline trend metrics --- atlasbot/engine/answerer.py | 4 ++++ atlasbot/llm/prompts.py | 1 + 2 files changed, 5 insertions(+) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index ed4c89b..9820dfe 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -285,6 +285,10 @@ class AnswerEngine: metric_terms = ("cpu", "ram", "memory", "net", "network", "io", "disk", "load", "usage", "pod", "pods", "namespace") 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" + baseline_terms = ("baseline", "delta", "trend", "increase", "decrease", "drop", "spike", "regression", "change") + if any(term in lowered_question for term in baseline_terms) and any(term in lowered_question for term in metric_terms): + classify["question_type"] = "metric" + classify["needs_snapshot"] = True if not classify.get("follow_up") and state and state.claims: follow_terms = ("there", "that", "those", "these", "it", "them", "that one", "this", "former", "latter") diff --git a/atlasbot/llm/prompts.py b/atlasbot/llm/prompts.py index fcb3caf..fb52118 100644 --- a/atlasbot/llm/prompts.py +++ b/atlasbot/llm/prompts.py @@ -26,6 +26,7 @@ ROUTE_SYSTEM = ( + "Assume questions are about the Titan Lab Atlas Kubernetes cluster unless the user explicitly asks about something else. " + "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. " + + "If the question asks about baselines, deltas, trends, increases/decreases, drops, spikes, or time-based comparisons, mark it as metric or diagnostic and require snapshot evidence. " + "Return JSON only." )