I Built an AI-Powered Router That Understands What Your Users Mean (Not What They Type)
What if your search bar could understand "how do I reach support?" and route to /contact - without a single keyword rule? I built AI Router - an open-source lib that runs a HuggingFace embedding mo...

Source: DEV Community
What if your search bar could understand "how do I reach support?" and route to /contact - without a single keyword rule? I built AI Router - an open-source lib that runs a HuggingFace embedding model inside a Web Worker in the browser. No API keys, no backend, no latency. Just semantic understanding. Live demo: ai-router-search.vercel.app GitHub: IvanMalkS/ai-router The Problem Classic search in SPAs is keyword-based. User types "pricing", you match it to /pricing. Easy. But what happens when they type: "how much does it cost?" "can I get a free trial?" "tariffs and plans" None of these have the word "pricing" in them. Keyword search returns nothing. User bounces. The Solution: Embeddings in the Browser AI Router turns every query into a vector embedding - basically a numerical represantation of its meaning. Then it compares that meaning against your routes using cosine similarity. The cool part - the model runs entirely client-side in a Web Worker. Main thread stays free, zero server