Skip to content

feat(core,server): record whether each reply answered the question - #585

Merged
anurag629 merged 1 commit into
devfrom
feat/answered-signal
Nov 4, 2026
Merged

anurag629 merged 1 commit into
devfrom
feat/answered-signal

Conversation

@anurag629

Copy link
Copy Markdown
Member

Part of P3 (O1): an answer rate is one of the cloud beta's exit checks, and the dashboard lists questions the knowledge doesn't cover. This is F-11's unanswered detector in its minimal form: the free signals only, no judge.

  • checkAnswered({ reply, retrieval?, cited?, phrases? }) in @chatcops/core returns { answered, reason? }. A reply isn't answered when:
    • refusal: it says it doesn't know near its start. The phrases cover English, Spanish, French, German and Portuguese, and are only checked in the first 300 characters, so a hedge late in a real answer doesn't count.
    • no_retrieval: a retrieving knowledge source ran and found nothing, or its top score is under an optional minScore.
    • no_citation: retrieval found pages, but a reply longer than 20 words cited none of them.
  • The server saves the verdict on every finished reply with text, as metadata.answered and metadata.unansweredReason. Nothing goes on the wire, and the stream doesn't change.
  • core/analytics.mdx has a short "Whether a reply answered" section.

How I tested this

  • tests/analytics/unanswered.test.ts: 14 cases. Each language's refusal phrases, the start-only window, custom phrases, no chunks, minScore, uncited long replies, and short and cited replies that pass.
  • tests/handler-answered.test.ts: what's saved for a cited reply, an uncited long reply, empty retrieval, a refusal, and a plain reply.
  • pnpm -r build, typecheck, lint (38), docs:check, api (snapshot updated) and coverage for core and server pass.

@anurag629
anurag629 merged commit e0adbe7 into dev Nov 4, 2026
5 checks passed
@anurag629
anurag629 deleted the feat/answered-signal branch November 4, 2026 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant