GuidesReview workflow

Review workflow

The human-in-the-loop for learning_review mode: synthesized answers are queued, and a moderator decides what enters the knowledge base.

Audience: moderators and operators curating the KB. What you will accomplish: list pending entries and approve or reject them.

How two-phase ingest works

In learning_review mode, when a request fills a knowledge gap (no documents matched) and the answer is ≥50 characters, the synthesized answer is queued in Redis instead of being embedded. It only becomes retrievable once a moderator approves it — at which point it is embedded into the synthesized_answers collection. Rejecting discards it.

This keeps unverified model output out of the vector store until a human signs off. See Chat modes for the mode itself.

  1. Step 1: List pending entries

    Call GET /api/v1/review/pending to see queued synthesized answers (question, answer, score, timestamp), paginated by limit/cursor.

  2. Step 2: Approve to embed

    POST /api/v1/review/{entry_id}/approve embeds the answer into synthesized_answers, making it retrievable in learning modes.

  3. Step 3: Reject to discard

    POST /api/v1/review/{entry_id}/reject discards the entry without embedding it.

List pending

curl
curl "http://127.0.0.1:8000/api/v1/review/pending?limit=50&cursor=0"

If it fails: A 401 means the server runs with REQUIRE_AUTH_FOR_INGEST=true — add -H "X-API-Key: ...".

A response looks like:

{
  "total": 2,
  "pending": [
    {
      "entry_id": "synthesized:1a2b3c4d5e6f",
      "question": "Do you ship to Portugal?",
      "answer": "Yes, standard delivery to Portugal takes 3–5 business days...",
      "best_score": 0.12,
      "created_at": "2026-06-01T10:00:00Z"
    }
  ],
  "next_cursor": null
}

Approve / reject

curl
# Approve → embeds into the synthesized_answers collection
curl -X POST http://127.0.0.1:8000/api/v1/review/synthesized:1a2b3c4d5e6f/approve

# Reject → discards without embedding
curl -X POST http://127.0.0.1:8000/api/v1/review/synthesized:1a2b3c4d5e6f/reject

If it fails: Add -H "X-API-Key: ..." when the server requires auth for ingest/review.

The web reviewer panel

The reference web client exposes this flow without curl: the header Review toggle (or the #/review hash route) opens an operator panel over the queue. It lists pending entries with Approve and Reject buttons, removes resolved entries optimistically, and uses next_cursor for a Load more affordance. Its API key field stores the operator key in the browser and sends it as X-API-Key. See Web client.

Verify your result

  • Verify: You can list the pending queue and read each entry's question/answer/score.
  • Verify: Approving makes the synthesized answer retrievable in learning modes.
  • Verify: Rejecting removes the entry without embedding it.
  • Verify: When the server requires auth, you send a valid X-API-Key.

Common failure modes