From f6bb0b90ddace6356317ef7746625928d9d7c4c7 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Sun, 1 Feb 2026 04:37:15 -0300 Subject: [PATCH] atlasbot: emphasize metric facts in evidence fixes --- atlasbot/engine/answerer.py | 5 +++++ atlasbot/llm/prompts.py | 1 + 2 files changed, 6 insertions(+) diff --git a/atlasbot/engine/answerer.py b/atlasbot/engine/answerer.py index 710581e..da50678 100644 --- a/atlasbot/engine/answerer.py +++ b/atlasbot/engine/answerer.py @@ -160,6 +160,7 @@ class AnswerEngine: runbook_paths = self._kb.runbook_paths(limit=10) history_ctx = _format_history(history) lexicon_ctx = _lexicon_context(summary) + key_facts: list[str] = [] started = time.monotonic() reply = "" @@ -327,6 +328,10 @@ class AnswerEngine: extra_bits.append("AllowedRunbooks: " + ", ".join(runbook_paths)) if resolved_runbook: extra_bits.append("ResolvedRunbook: " + resolved_runbook) + if key_facts: + metric_facts = [line for line in key_facts if re.search(r"\\d", line)] + if metric_facts: + extra_bits.append("MustUseFacts: " + "; ".join(metric_facts[:4])) if allowed_nodes: extra_bits.append("AllowedNodes: " + ", ".join(allowed_nodes)) if allowed_namespaces: diff --git a/atlasbot/llm/prompts.py b/atlasbot/llm/prompts.py index bbb5dd6..0869dab 100644 --- a/atlasbot/llm/prompts.py +++ b/atlasbot/llm/prompts.py @@ -100,6 +100,7 @@ EVIDENCE_FIX_PROMPT = ( "If the draft says data is missing but the context includes relevant values, " "rewrite the answer to include those values. " "If data is truly missing, keep the draft concise and honest. " + "If MustUseFacts are provided, you must incorporate them into the answer. " "If AllowedRunbooks are provided, use an exact path from that list when answering " "documentation or checklist questions and do not invent new paths. " "If ResolvedRunbook is provided, you must include that exact path and must not say it is missing."