Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

KB review queue: turn unseen questions into reviewed KB articles

Geschlossen
#363 0 Kommentare 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@NathanTarbert arbeitet bereits daran.

Seit 12.10.2026.

  • #362 von @NathanTarbert — offen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

enhancement

Summary

Turn questions the assistant had no knowledge-base coverage for into reviewed KB articles. Unseen questions are captured into a per-workspace queue, a teammate edits the answer and approves it (or rejects it), and only then does it become something the assistant can serve. Implemented in #362.

Background

A Reddit commenter asked whether answerLoops is "self learning" and suggested that answers to previously unseen questions should be captured, flagged for review, fine-tuned by a person, and then committed as best practice. Before this work the KB only grew when someone resolved a ticket and clicked Promote to KB. Answers the assistant gave from general knowledge (widget) or could not give (tickets) simply disappeared, so the same gap kept coming back.

Behavior

Capture (best-effort, never delays or breaks a live answer):

  • Ticket channels: at the end of runAIAgent, after the reply path, when no KB article or prior team answer matched. Bug and feature-request tickets are skipped because they are not KB-deflectable. The assistant's draft is kept only when the grader judged it a full answer; otherwise the item is flagged "No usable answer" and the reviewer writes one.
  • Website widget: in the stream onFinish when retrieval found no article. The visitor's identity is never stored.

Dedupe and caps

  • A question with embedding similarity of 0.85 or more against a pending or rejected item raises that item's occurrences instead of adding a row. A retried draft run for the same ticket does not raise it.
  • A rejected gap stays rejected while its count keeps rising, so repeated demand stays visible.
  • At most 500 pending items per workspace, so the public widget cannot grow the queue without bound.

Review (new Review tab on the KB page, pending-count badge on the tab)

  • Items are listed most-asked first, in To review / Approved / Rejected views.
  • The reviewer edits the question and the answer, then approves (creates a published kb_articles row and links it back) or rejects. Rejected items can be moved back to review.
  • Approval embeds question\n\nanswer (same convention as promote-to-KB), is rate limited, respects the shared 2000-article cap, and claims the item in a single transaction so two reviewers cannot create two articles.

Access and plan

  • Pro and above (kb_review_queue); unlocked on self-hosted. Without it the routes return 402 and the tab shows the upgrade prompt.
  • Any member can read the queue; only owners and admins can approve, reject, or reopen.
  • Nothing in the queue is searchable or served until approved.

Why review-first

Auto-publishing would let the bot teach itself its own mistakes, and widget visitors are anonymous customers of the deploying business. The human step is also where names and account details get stripped from an answer before it becomes public knowledge. This matches the existing rule that promoting an answer to the KB is the generalising step.

Implementation notes

  • New table kb_review_items (drizzle/0051_kb_review_items.sql, lib/db/schema.ts); queries in lib/db/queries/kb-review.ts; capture helper in lib/kb/review-capture.ts.
  • Routes: GET /api/kb/review and PATCH /api/kb/review/[id].
  • hardPurgeOrg deletes an org's items. MAX_ARTICLES_PER_ORG now lives in lib/kb/limits.ts, shared with file upload.
  • Migration is numbered 0051 to leave room for migrations on other open branches; the runner applies files in name order.

Acceptance criteria

  • An unseen question from a ticket channel appears in the queue after the reply is sent
  • An unseen widget question appears in the queue with no visitor details
  • Repeating a question raises its count instead of adding a row
  • Approving publishes the edited text and it becomes searchable
  • Rejecting removes it from the queue, and it can be reopened
  • Non-Pro cloud workspaces capture nothing and see the upgrade prompt
  • Deleting an org purges its items
  • Docs, pricing comparison row, unit, component and e2e tests included

Follow-ups

  • Reviewer "Add context" input before approving
  • Link from the Knowledge Gaps page into the KB review flow
  • Capture from the remaining answer paths (Discord /ask, Agent API / MCP generate_answer)

Docs: content/docs/product/knowledge-base.mdx ("Review queue").

Vorherrschende Sprache
TypeScript
Sterne
16
Forks
2
Ø Merge
7 Std. 4 Min.
Gemergte PRs (30 T.)
157

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus answerLoops/answerLoops

Alle Issues in answerLoops/answerLoops

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.