Skip to content

Optional decision model integration for gates, tool ranking, guards and approvals #77

Open

Description

@gopaljigaur

Several places in an agent run ask a small question that does not need a full chat completion: should this input start a run at all, which tools are relevant to this request, is this answer acceptable, should this tool call be allowed. Today each of these is either a full LLM call or not available.

pydecide answers typed questions (Choice, Score, Noul) with small decision models in milliseconds, and passes a question it is not confident about to a stronger backend through a confidence gate.

Proposal An optional integration, installed with cyclops[decide], in its own module. The core never imports it.

  • Run gate. A helper that decides, before start(), whether an input needs a run, from the input plus caller-supplied context. It only reports a decision with its probability; skipping is the caller's choice, so a wrong answer can only cost a run, never drop one, when used with a high threshold.
  • Tool ranking for deferred tool loading (Deferred tool loading through a search tool #74). Rank tools against the request with a Score question and send the top matches, falling back to the search tool when confidence is low.
  • Decision guard (Tool-call middleware and an end-of-run guard #27). A guard that checks the final answer against a question such as "does the answer address the request?" and sends the model back below a threshold.
  • Approval callback (Declarative tool permissions with an approval callback #64). An approval callback for the "ask" outcome that decides clear cases and passes uncertain ones on to the application's own callback.

Each piece takes a decide.Client from the caller, so backends, models and thresholds stay the application's choice. Tests use a fake client; docs show each piece with the confidence trade-off stated plainly (where a wrong decision costs a call and where it would change behaviour).

Activity

  1. added
    enhancement
    on Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions