RAG & Agents Engineering

M30 lab, adaptive RAG and query routing

A score floor trades misroutes for searches.

Eighteen Larkspur Cloud support tickets, each routed to the billing, technical or general knowledge base whose best chunk scores highest under real TF-IDF. A ticket whose best score sits below the floor falls back to a search of all three. Raise the floor and watch which mistakes it catches.

Misrouted
Fall back to all three
Reach the right knowledge base
Knowledge-base searches per ticket

Misroutes and fallbacks as the floor rises

Tickets out of 18

Where each ticket goes

Best-chunk cosine per knowledge base

TicketBelongs inBillingTechnicalGeneralGoes to

A misrouted ticket is filtered to a knowledge base that does not hold its answer, so retrieval there cannot find the evidence. A fallback searches all three knowledge bases, which costs three searches instead of one. When every score ties at 0.000, the router takes the first in its list, billing, as a classifier forced to pick one label would.

The knowledge bases are the twelve handbook chunks from the M10 lab, five in billing, four in technical and three in general. TF-IDF uses scikit-learn’s defaults with English stop words.