atlasbot: prioritize keyword chunks and expand evidence fixes

This commit is contained in:
Brad Stein 2026-02-01 01:28:34 -03:00
parent b3e53a7fd7
commit 89d6ba3a3d

View File

@ -714,18 +714,18 @@ def _select_chunks(
text = item.get("text", "").lower()
if any(kw in text for kw in lowered):
keyword_hits.append(item)
for item in ranked:
if len(selected) >= plan.chunk_top:
break
if item is head:
continue
selected.append(item)
for item in keyword_hits:
if len(selected) >= plan.chunk_top:
break
if item in selected:
continue
selected.append(item)
for item in ranked:
if len(selected) >= plan.chunk_top:
break
if item is head:
continue
selected.append(item)
return selected
@ -843,7 +843,10 @@ def _needs_evidence_fix(reply: str, classify: dict[str, Any]) -> bool:
"can't",
"need to",
"would need",
"does not provide",
"not provided",
"not in context",
"not referenced",
"missing",
"no specific",
)