KB review queue: turn unseen questions into reviewed KB articles
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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
onFinishwhen 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
occurrencesinstead 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_articlesrow 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 inlib/db/queries/kb-review.ts; capture helper inlib/kb/review-capture.ts. - Routes:
GET /api/kb/reviewandPATCH /api/kb/review/[id]. hardPurgeOrgdeletes an org's items.MAX_ARTICLES_PER_ORGnow lives inlib/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 / MCPgenerate_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
- Enthält ein Dockerfile oder eine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus answerLoops/answerLoops
-
Widget: match the chat bubble color to the rest of the widgetEvtl. vergeben @uchiha-suraj hat das vor 5 Tagen übernommen. Offenenhancement help wanted
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 84/100
answerLoops/answerLoops#345 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Widget: make the chat window fit on small phonesEvtl. vergeben @anushreemehta6 hat das vor 5 Tagen übernommen. Offenenhancement good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
answerLoops/answerLoops#344 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
answerLoops/answerLoops#17 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
enhancement help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
answerLoops/answerLoops#380 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in answerLoops/answerLoops
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
needs triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
homarr-labs/homarr#7191 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
AvaProtocol/ava-sdk-js#276 ·
Maintainer antworten meist innerhalb von 1 Tag
-
useFragment does not require `variables` when the fragment's variables type has required fieldsOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apollographql/apollo-client#13493 ·
Maintainer antworten meist innerhalb von 1 Tag