#5877·deer-flow

[feat] Add an optional Decision Gate to speed up routine agent decisions

Author: Andrea-BrunoCreated Sep 25, 2026Updated Sep 27, 2026
Labelsneeds-triage

Every user message that reaches DeerFlow currently goes to the large language model to work out the basics of the turn, such as what the user intends, whether a tool is needed, and what to do next. For a simple message this still costs one to three seconds and real money, even when the answer needs no deep reasoning at all.

The idea is to put a small, fast decision model at the front door of the agent. This small model does not write text. In one quick pass it returns typed answers with confidence scores, for example whether the turn needs a tool, whether it can be answered from what is already known, and what the primary intent is. A thin routing layer then sends each message to the cheapest correct path, and whenever the small model is unsure it falls back to the full model exactly as today. The agent is never worse, only faster when the decision is obvious.

The change is safe to adopt. It is off by default, so a user who does nothing sees the exact current behavior. When it is turned on it runs in shadow mode first, which means it only classifies the turn and logs its recommendation through the existing logger without changing routing, without skipping the model call, and without altering anything the user sees. It also fails open, so on any error, timeout, non-2xx response, or malformed reply it simply returns no opinion and the agent continues as if the gate were not there. It adds no heavy dependency, because it talks to the decision backend over a plain HTTP POST using httpx, which the backend already depends on. The decision model itself is installed separately and is not bundled.

I would like to contribute this as an optional feature. I have a working branch that adds a small self-contained gate module and a shadow-mode hook at the front of the lead-agent middleware chain, and I am opening a pull request with it. The concept and the reference code are by Andrea Bruno and are released under Creative Commons Attribution 4.0. If the project adopts the idea or the code, we kindly ask to keep a short credit to Andrea Bruno and a link to the harness-superfast white paper at https://github.com/Andrea-Bruno/harness-superfast. The decision models themselves, such as Von, OpenJev, and Laya, are third-party open models; only the integration architecture and the routing method are ours.

To try it, set SUPERFAST_ENABLED to true and point SUPERFAST_ENDPOINT at a Jev-compatible server, which defaults to http://localhost:8000/v1/systemone. The agent then logs a route and a latency for each user turn while behaving exactly as before.