Review queue: capture unseen questions from Discord /ask and the Agent API

オープン
#79 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
sql, typescript
領域
api, backend

調査の方向性

Start with captureUnansweredQuestion in lib/kb/review-capture.ts, then the two uncovered paths: app/api/slash/ask/route.ts and generateAnswerCore in lib/agent/core.ts. The CHECK constraint on kb_review_items.source needs a migration, and the ReviewSource type and the label map in app/(dashboard)/kb/review-tab.tsx must match. Done when an uncovered /ask or generate_answer call creates or bumps a review item shown with its source, and non-Pro workspaces capture nothing. Land after #431, which hooks the same paths.

索引モデルが issue の本文から書いたものです。

説明

backend enhancement

Copied from DeadantCo/answerLoops#69 · originally opened by sethr07 on 2026-11-20

Copied from https://github.com/answerLoops/answerLoops/issues/366 — originally opened by @NathanTarbert on 2026-10-12

Summary

The review queue from #362 captures unseen questions from two places: ticket channels (via runAIAgent) and the website widget. Two other answer paths can also reply without any KB coverage but never feed the queue, so those gaps stay invisible.

Land together with, or after, #431: both hook the Discord /ask path and the Agent API generation path.

Paths not covered today

  1. Discord /ask (app/api/slash/ask/route.ts): searches the KB (top 3) and answers, with no assessment step and no capture.
  2. Agent API and MCP generate_answer (generateAnswerCore in lib/agent/core.ts): grounds on the top KB matches and grades its own answer, but does not call runAIAgent and does not capture.

Why it matters

Agent and slash-command traffic is real customer demand. If those questions have no matching article they should surface in the same most-asked-first list as everything else, otherwise the queue under-counts exactly the gaps that automated agents hit most.

Considerations

  • Source values. kb_review_items.source is currently constrained to 'ticket' or 'widget' by a CHECK constraint. New sources (for example 'slash' and 'agent_api') need a migration to widen it, plus matching changes to the ReviewSource type, the UI label map in app/(dashboard)/kb/review-tab.tsx, and the docs.
  • Capture rules. Reuse captureUnansweredQuestion (lib/kb/review-capture.ts): best-effort, Pro-gated, deduped, capped. Capture only when retrieval found nothing.
  • Privacy. Store the question and the answer only, never the caller's identity or API key. The Agent API is called by automated clients, so decide whether low-signal or machine-generated queries should be throttled or sampled before they reach a human reviewer.
  • Volume. These paths can be called at much higher rates than a human channel. Confirm the 500-pending cap and the similarity dedupe are enough, or add a per-source cap.
  • Latency. Capture must not delay the response; run it after the answer is sent as the other paths do.

Acceptance criteria

  • An uncovered /ask question and an uncovered generate_answer call each create or bump a review item
  • Items show their source in the Review tab
  • No caller identity or credential is stored
  • Non-Pro workspaces capture nothing
  • Docs and tests updated

Start here: new to the project? Read CONTRIBUTING.md first. It covers the ground rules, running answerLoops locally, and how to open a pull request.

主要言語
TypeScript
スター
0
フォーク
0
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

DeadantCo/answerLoopsdev のほかの issue

DeadantCo/answerLoopsdev の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。