← All work

DocNexus.ai · case study

Front-door query router

Deciding, before any LLM runs, whether a question needs a lookup or an agent.

ShippedJul 2026AI / ML, Full stack

97.5%
held-out accuracy
100%
agent-path recall
95.8%
search-path recall

Every question to the analytics assistant goes either to a fast search surface or to an agentic analysis graph. Getting it wrong is either slow and expensive or confidently shallow, so the router is deterministic and built to fail toward the safe side.

Methods and relative results only. Client figures, internal names and scale are not published.

Three layers, cheapest first

Rules check the expensive intent first, so a question that needs the agent is never short-circuited by a search keyword. A k-nearest-neighbour vote (k = 15) over a labelled bank of ~2.8k examples, embedded with bge-small, settles most of the rest. Anything still uncertain goes to the agent, the safer path.

A contract assigns each of 25 capabilities exactly one owner, so the two surfaces never both claim a question.

Decisions

  • Held-out accuracy is 97.5%, with 100% recall on questions that need the agent and 95.8% on search questions. Every miss errs toward the agent, never away from it.
  • A traced failure is published alongside the score: a question naming a disease missing from the lexicon was routed to the agent. The fix is lexicon coverage, not a threshold change.