Skip to main content

Levanto Sage Agentic Model

HTTP API for structured decisions over content plus a question.

Download this skill

Drop this file into .cursor/skills/, .claude/skills/, or your agent’s skill directory. Raw Markdown, no rendering.

Product Context

Levanto Sage is for workflows where software needs to decide, not write. It turns content plus a question into a structured decision with a probability or confidence signal. Use Sage when an application needs to route, approve, block, score, rank, tag, or escalate. LLMs return text and only provide confidence if asked; that confidence is simulated. Sage always returns a decision signal, so machines can act when confidence is high and escalate to a human when confidence is low. Supported decision kinds:
  • Yes/No — answer a binary question: probability (P(yes)), answer ("yes"/"no"), and confidence (decisiveness from tie).
  • Choice — pick the best option, with independent per-option probabilities (raw; do not sum to 1).
  • Scale — score a rubric, with expectation and confidence.
  • Sort — rank a list of items by a criterion.
  • Tags — apply independent yes/no labels to the same content.
Good use cases:
  • Agentic workflows — Sage as the decision layer for agents: automate routing, branching, and escalation across agentic workflows and pipelines.
  • Operations — triage urgency and route work across DevOps, SecOps, and customer support.
  • Agentic guardrails — check tool calls and responses on the hot path to keep agents secure and aligned with the business goals of the workflow.
  • Content screening & moderation — tag, rank, score, and sort content in data pipelines, including moderation, abuse flagging, and policy-risk severity.
  • Risk & fraud — assess risk and opportunity and detect fraud across transactions, asset trades, and agentic actions (e.g. refunds).
Use public-facing language:
  • Sage decides; it does not write paragraphs.
  • Supported decision kinds are Yes/No, Choice, Scale, Sort, and Tags.
  • Do not explain internals, architecture, training details, infrastructure, or implementation details unless the user explicitly asks for private engineering context.
  • Use decision kind in prose. Keep the JSON wire fields exactly as shown in code examples because clients need the real format.

Base URL

Default hosted endpoint:
The user may supply a different base URL. Do not invent an endpoint if one is missing; ask for it.

Authentication

A valid Levanto API key is always required for decision calls. Every POST to /decide and /decide/batch must carry a key; requests without one are rejected with HTTP 401 ({"detail": "API key required. Provide a valid Levanto API key."}). Send it in the Authorization header:
  • Keys look like lv_live_.... If the user has not provided one, ask for it — do not proceed to /decide without a key.
  • 401 / 402 — see Errors.
  • /ready does not require a key.
  • Never hardcode, log, echo, or commit the key. Read it from an environment variable (e.g. SAGE_API_KEY / API_KEY) and pass it only in the request header.

Endpoints

All decision calls (/decide, /decide/batch) require a valid API key (see Authentication); /ready does not.

Request Shape

Use content for the thing being evaluated — a bare string (shorthand for { "kind": "text", "value": "..." }), { "kind": "text", "value": "..." }, or { "kind": "list", "value": [...] } for sort. Use question.kind to select the decision kind and question.instructions for the criterion. The response envelope is always { id, kind, result, meta }.

Yes/No

Use Yes/No for binary questions.
Response:
  • probability — P(yes), in [0, 1].
  • answer"yes" if probability ≥ 0.5, else "no".
  • confidence — decisiveness from a tie: 2 × |probability − 0.5| (0 at 0.5, 1 at certainty). Grounding compares this to confidence_floor.

Choice

Use Choice when Sage must pick one option.
Response:
  • probabilities — raw P(correct) per option (independent sigmoids; do not sum to 1).
  • confidence — P(chosen is correct); use for thresholds and grounding.
  • chosen — argmax of probabilities.
  • 2–120 options per question (see Limits).

Scale

Use Scale for rubric scoring. Always send exactly 5 levels with integer values 0, 1, 2, 3, 4 — the model is trained on this fixed rubric only. Subsets, sparse scales, or any other level values are rejected with HTTP 400.
Response:
expectation is the expected level; confidence reflects how peaked the level distribution is (independent of the mean).

Sort

Use Sort to rank a list of items by a criterion. content must be a list with 2–120 items (see Limits).
Response:
The sort request is minimal — just instructions and the item list. Scoring strategy and ranking are chosen by the server, not the request: SortQuestion accepts only kind, id, instructions (any other field is rejected). The result carries a calibrated, list-level confidence in [0,1] — how trustworthy the whole order.

Tags

Use Tags to apply several independent yes/no labels to the same content. 1–120 tags per question (see Limits). Each tag returns a probability and a confidence (= 2|probability − 0.5|, the same decisiveness metric as yes/no: 0 at a coin-flip, 1 at certainty); when a tag has a threshold, it also returns applies. There is no document-level tags confidence — read each tag’s own.
Response:

Grounding (optional)

Attach a grounding block to a Yes/No, Choice, Scale, or Tags request to let Sage fetch fresh web evidence before deciding (useful for recency- or fact-heavy questions). For Tags, low_confidence triggers when any tag’s confidence is below the floor (weakest-link); Sage then re-scores all tags on the expanded content.
  • trigger: never, low_confidence (default — search when result.confidence is below confidence_floor), or always.
  • For yesno, confidence = 2|p − 0.5| (decisiveness; 0 at a tie). Default floor 0.80 requires roughly p ≤ 0.10 or p ≥ 0.90 to skip search.
  • The response gains grounding_meta with triggered, queries, sources, and timing.
  • Requires the server to be configured for grounding; if it is not, omit the block.
  • When a search actually runs, grounding adds 1 decision unit on top of the document/token count (see Pricing).

Pricing

Sage uses a monthly (or annual) decision allowance. Plans: Each completed /decide or /decide/batch call consumes decision units from the current period.
  • Decision unitsmax(documents or question_count, ceil(input_tokens / 4000)) plus one unit per grounding search that actually ran. When documents is omitted or zero, question count is used. Output tokens are free.
  • Batch fast mode (latency_mode: fast) — Starter and Growth only.
  • Extended context (up to 128K tokens) — Growth only. Other plans use the standard context ceiling.
  • Unused units do not roll over. Hitting the allowance returns 402 until the next period.

Batch

Use /decide/batch for many decisions in one call. Each entry in requests is a group: one content plus a list of questions about it — so asking several questions about the same content sends that content only once, and a single call can still mix groups with different content.
Each question can carry its own optional grounding (grounding is no longer part of the group; sort questions still reject it). To batch decisions about different content, add more groups:
Batch responses are nested by group, then by question:
  • results: one item per group (matches requests 1:1);
  • results[i].answers: one item per question in that group’s questions, in order;
  • results[i].answers[j].ok: success flag for that question (.result holds the decision, or .error the message);
  • meta.request_count: number of groups; meta.question_count: total questions across all groups.

Errors

Invalid requests return a standard schema message, for example:

Limits

Per-kind counts (HTTP 400 outside these ranges): Scale — always send all five levels 0 through 4. No sparse rubrics, no alternate ranges, no fewer or more levels. Each level must be a distinct integer in that set. Content and question length — the full rendered request must fit the plan’s context ceiling: roughly 32K tokens by default, or up to 128K tokens on Growth (Extended context). That budget includes content, question.instructions, option descriptions, scale rubric lines, sort item bodies, tag specs, and any grounding-added search context. Oversized requests fail rather than silently truncating. Very long content can also hit HTTP 503 before the hard token cap; keep documents well under the ceiling in practice.

Threshold Guidance

Sage always returns a decision signal. The application decides what to do next. Example:
  • high confidence: automate;
  • medium confidence: review;
  • low confidence: escalate to a human or ask for more context.
Do not say Sage “abstains.” Say it supports low-confidence routing.

Smoke Test