DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to auto-act on confident answers and queue the rest with Laya

Gate automated actions on answer_confidence so uncertain items go to a human reviewer.

Short answer: Run npm install @receptron/laya and load the model with Laya.load(); then call systemOne with your state and a choice question whose criteria are your allowed actions; Compare result.answers.<question>.answer_confidence against your threshold, using the same threshold for every question type. All steps.

Who it is forA developer building an automated workflow that should only act when the model is sure, such as an agent that files or closes records.

The problemA single label from a classifier hides how uncertain it was, so low-confidence decisions get acted on as if they were certain.

The outcomeItems above a chosen confidence threshold are applied automatically, and everything below it is written to a review queue with the full probability breakdown.

What you need first

  • Node.js 20 or newer
  • About 2 GB of RAM for the loaded model, plus a few hundred MB per batch of questions
  • About 1.7 GB of free disk space for the ONNX weights cached under ~/.cache/receptron-laya
  • Network access to Hugging Face for the first download

Steps

  1. Run npm install @receptron/laya and load the model with Laya.load().
  2. Call systemOne with your state and a choice question whose criteria are your allowed actions.
  3. Compare result.answers.<question>.answer_confidence against your threshold, using the same threshold for every question type.
  4. Apply the action when the value is at or above the threshold, and push the item and its probabilities object to a review queue otherwise.
  5. Log result.usage.input_tokens per call to track cost.

Prompt for your agent

In the receptron/laya repo, add a function that calls Laya systemOne on <record-file> with a choice question over the actions in <action-list>, and applies the top action only when answer_confidence is at least 0.9, otherwise returning it for review. Expected output: an object with the action, its answer_confidence and a review flag. Verify that a record with a near-even probability split is marked for review.

Caveat. The README warns that confidence on choice and score answers is a different quantity, so gate on answer_confidence only and do not reuse the confidence field.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for receptron/laya and "Auto-act on confident answers and queue the rest"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer