From dea70df20978c717b7fde554a200b98b8d35f427 Mon Sep 17 00:00:00 2001 From: Brad Stein Date: Tue, 27 Jan 2026 15:07:28 -0300 Subject: [PATCH] atlasbot: strengthen cluster disambiguation --- services/comms/atlasbot-deployment.yaml | 2 +- services/comms/scripts/atlasbot/bot.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/services/comms/atlasbot-deployment.yaml b/services/comms/atlasbot-deployment.yaml index f4e7f7d..de50c37 100644 --- a/services/comms/atlasbot-deployment.yaml +++ b/services/comms/atlasbot-deployment.yaml @@ -16,7 +16,7 @@ spec: labels: app: atlasbot annotations: - checksum/atlasbot-configmap: manual-atlasbot-44 + checksum/atlasbot-configmap: manual-atlasbot-45 vault.hashicorp.com/agent-inject: "true" vault.hashicorp.com/role: "comms" vault.hashicorp.com/agent-inject-secret-turn-secret: "kv/data/atlas/comms/turn-shared-secret" diff --git a/services/comms/scripts/atlasbot/bot.py b/services/comms/scripts/atlasbot/bot.py index 4316fe0..62304fa 100644 --- a/services/comms/scripts/atlasbot/bot.py +++ b/services/comms/scripts/atlasbot/bot.py @@ -1870,7 +1870,7 @@ class _AtlasbotHandler(BaseHTTPRequestHandler): fallback = "I don't have enough data to answer that." llm_prompt = cleaned if cluster_query: - llm_prompt = f"Atlas cluster question: {cleaned}" + llm_prompt = f"Atlas cluster question (use the cluster snapshot context): {cleaned}" answer = ollama_reply( ("http", "internal"), llm_prompt, @@ -2108,6 +2108,7 @@ def _ollama_call(hist_key, prompt: str, *, context: str, use_history: bool = Tru "Be helpful, direct, and concise. " "Use the provided context and facts as your source of truth. " "If the context includes a cluster snapshot, treat the question as about the Atlas/Othrys cluster even if the prompt is ambiguous. " + "When a cluster snapshot is provided, never answer about unrelated meanings of 'Atlas' (maps, mythology, Apache Atlas, etc). " "Treat 'hottest' as highest utilization (CPU/RAM/NET/IO) rather than temperature. " "If you infer or synthesize, say 'Based on the snapshot' and keep it brief. " "Prefer exact repo paths and Kubernetes resource names when relevant. " @@ -2318,7 +2319,7 @@ def sync_loop(token: str, room_id: str): llm_prompt = cleaned_body if cluster_query: - llm_prompt = f"Atlas cluster question: {cleaned_body}" + llm_prompt = f\"Atlas cluster question (use the cluster snapshot context): {cleaned_body}\" reply = ollama_reply_with_thinking( token, rid,