3 ms·
routr is a lightweight, offline search router inspired by DuckDuckGo's bangs. It's fully browser-based (no server requests needed other than the initial one) an
by trbndev 1y ago
routr is a lightweight, offline search router inspired by DuckDuckGo's bangs. It's fully browser-based (no server requests needed other than the initial one) and routes queries like `!gh tokio` to GitHub, `!yt` to YouTube, `!hn` to Hacker News, etc.
What sets it apart:
- Runs entirely locally (no network, no tracking)
- Lets you define your own bangs and destinations
- Optionally rewrites queries for better precision (with AI)
Example:
Typing `article about german war in the stone age !!g` becomes:
`site:en.wikipedia.org "german" AND "war" AND "stone age"`
More on query rewriting and performance:
https://tl128n.github.io/writings/2025-05-02_optimizing_search_performance/ https://tl128n.github.io/writings/2025-05-02_optimizing_sear...
- Leftium 1y agoThat link is broken. Correct link: https://t128n.github.io/writings/2025-05-02_optimizing_search_performance/ https://t128n.github.io/writings/2025-05-02_optimizing_searc...
- trbndev 1y agoAh damn what a bummer that I can‘t edit the original comment anymore. Thank you for pointing it out… didn‘t even see that extra `l` there in the url
- Leftium 1y ago> Typing `article about german war in the stone age !!g` becomes: `site:en.wikipedia.org "german" AND "war" AND "stone age"` I wonder how much of that could be done without AI, just (locally) using https://www.npmjs.com/package/compromise https://www.npmjs.com/package/compromise --- Also I couldn't find your source for bang data; Kagi maintains an updated list: https://github.com/kagisearch/bangs https://github.com/kagisearch/bangs I'm working on an enhanced version of bangs. Since there are so many "dead" bangs, I'm thinking of using a bang whitelist and suggestions from the full list if not found in the whitelist.
- trbndev 1y agoWhat an interesting library. Thanks for mentioning it here… will definitely look into it! —- The bangs are at https://github.com/t128n/routr/blob/main/src/sw/routes.ts https://github.com/t128n/routr/blob/main/src/sw/routes.ts Mostly ripped from duckduckgo.com/bang.js and then pretty-formatted with Prettier… with some sane-defaults added like a bang for ChatGPT or T3 Chat