{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "receptron-laya--escalate-low-confidence-decisions-to-humans",
 "repo": "receptron/laya",
 "repo_url": "https://github.com/receptron/laya",
 "repo_slug": "receptron-laya",
 "title": "Auto-act on confident answers and queue the rest",
 "page_title": "How to auto-act on confident answers and queue the rest with Laya",
 "summary": "Gate automated actions on answer_confidence so uncertain items go to a human reviewer.",
 "who": "A developer building an automated workflow that should only act when the model is sure, such as an agent that files or closes records.",
 "problem": "A single label from a classifier hides how uncertain it was, so low-confidence decisions get acted on as if they were certain.",
 "outcome": "Items above a chosen confidence threshold are applied automatically, and everything below it is written to a review queue with the full probability breakdown.",
 "steps": [
  "Run `npm install @receptron/laya` and load the model with `Laya.load()`.",
  "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.",
  "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.",
  "Log `result.usage.input_tokens` per call to track cost."
 ],
 "agent_prompt": "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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "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.",
 "category": "Work and operations",
 "tags": [
  "Work and operations"
 ],
 "lang": "typescript",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/receptron-laya/escalate-low-confidence-decisions-to-humans/",
 "md": "https://dedupedai.com/use-cases/receptron-laya/escalate-low-confidence-decisions-to-humans/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/receptron-laya--escalate-low-confidence-decisions-to-humans.json",
 "api_version": "v1"
}
