atlasbot: tighten fast facts

This commit is contained in:
Brad Stein 2026-01-28 01:58:07 -03:00
parent 2a2179a138
commit 62e0a565f5

View File

@ -3605,10 +3605,25 @@ def _open_ended_multi(
def _open_ended_total_steps(mode: str) -> int:
if mode == "fast":
return 2
return 3
return 7
def _fast_fact_lines(
fact_lines: list[str],
fact_meta: dict[str, dict[str, Any]],
fact_ids: list[str],
) -> list[str]:
if not fact_ids:
return fact_lines
selected = [
line
for line in fact_lines
if fact_meta.get(line, {}).get("id") in set(fact_ids)
]
return selected or fact_lines
def _open_ended_fast_single(
prompt: str,
*,
@ -3642,6 +3657,27 @@ def _open_ended_fast(
state: ThoughtState | None = None,
) -> str:
model = _model_for_mode("fast")
if state:
state.update("selecting", step=2, note="picking key facts")
subjective = _is_subjective_query(prompt)
focus_tags = _preferred_tags_for_prompt(prompt)
if not focus_tags and subjective:
focus_tags = set(_ALLOWED_INSIGHT_TAGS)
primary_ids = _open_ended_select_facts(
prompt,
fact_pack=fact_pack,
fact_meta=fact_meta,
history_lines=history_lines,
focus_tags=focus_tags,
avoid_fact_ids=[],
count=3,
subjective=subjective,
state=state,
step=2,
model=model,
)
selected_lines = _fast_fact_lines(fact_lines, fact_meta, primary_ids)
fact_pack = _fact_pack_text(selected_lines, fact_meta)
return _open_ended_fast_single(
prompt,
fact_pack=fact_pack,
@ -4092,6 +4128,7 @@ def _ollama_call(
"Do not suggest commands unless explicitly asked. "
"Respond in plain sentences; do not return JSON or code fences unless explicitly asked. "
"Translate metrics into natural language instead of echoing raw label/value pairs. "
"When providing counts or totals, use the exact numbers from the context; do not invent or truncate. "
"Avoid bare lists unless the user asked for a list; weave numbers into sentences. "
"Do not answer by only listing runbooks; if the question is about Atlas/Othrys, summarize the cluster first and mention docs only if useful. "
"If the question is not about Atlas/Othrys and no cluster context is provided, answer using general knowledge and say when you are unsure. "