03/Flow Routing

Semantic Router

The embedding-based, cheap/fast sibling of the content router.


The semantic router embeds the last message and compares cosine similarity to the admin-defined category descriptions, then follows the nearest category. There is no LLM classifier call — it is faster, cheaper and deterministic.

AspectContentSemantic
DecisionLLM "which category?"Embedding similarity
CostOne chat callOne embed call (cheap)
ConsistencyDepends on LLMDeterministic
codegreeting
Entry
routerSemanticcosine
Coder
Chat
Same categories, via embeddings
Example: "Write a python function…" → code → coder model; "Hey, how are you?" → greeting → chat model. Weak matches below an optional threshold fall back to the default.