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.
| Aspect | Content | Semantic |
|---|---|---|
| Decision | LLM "which category?" | Embedding similarity |
| Cost | One chat call | One embed call (cheap) |
| Consistency | Depends on LLM | Deterministic |
Entry
routerSemanticcosine
Coder
Chat
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.