frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

A 54KB client-side HNSW vector search engine in WASM

https://github.com/Altor-lab/altor-vec
7•anshulbasia27•1h ago

Comments

anshulbasia27•1h ago
Hi HN, I built altor-vec, a client-side HNSW vector search engine written in Rust that compiles to 54KB of WebAssembly. It lets you run semantic search entirely in the browser with sub-millisecond latency.

I started working on this because of the typical SaaS search dependency. Tools like Algolia are great, but at $0.50 per 1,000 searches, costs scale linearly with usage. More importantly, sending every user keystroke to a third-party API isn't ideal for privacy. I wanted a way to run high -quality semantic search directly on the user's device, where queries cost nothing and data never leaves the browser.

Under the hood, altor-vec implements HNSW (Hierarchical Navigable Small World)—the same algorithm used by Pinecone, Qdrant, and pgvector. HNSW builds a multi-layer graph where upper layers act as express lanes for coarse navigation, and the bottom layer contains all vectors for fine-grained search. This allows queries to greedily descend and find nearest neighbors in O(log n) time.

To make this viable for the browser, keeping the binary size small was critical. By writing it in Rust and carefully managing dependencies, the compiled WASM is just 54KB gzipped (117KB raw). For performance, all vectors are L2-normalized at insert time. This means dot product distance equals cosine similarity, saving computation during search. The index can be serialized to a binary format, allowing you to build it once at compile time and load it instantly on the client via a Uint8Array.

I benchmarked it with 10,000 vectors at 384 dimensions using the all-MiniLM-L6-v2 model. The serialized index is 17MB, which translates directly to the memory footprint when loaded into the browser. In Chrome, the p95 search latency is 0.60ms. In Node.js, it's 0.50ms, and native Rust hits 0.26ms. Because it's so fast, you can easily run it in a Web Worker to keep the main UI thread completely unblocked.

To make this practically useful, I also just published a Docusaurus plugin (docusaurus-theme-search-altor) that replaces Algolia DocSearch. It extracts your site content at build time and generates both an HNSW index and a BM25 index. In the browser, keyword search runs fully client-side with zero external calls. For semantic search, it pings a lightweight embedding API to convert the query into a vector, then searches the HNSW index locally via the WASM engine. If the embedding API is unreachable, it gracefully degrades to BM25 keyword results.

You can try the live demo here: https://altor-lab.github.io/altor-vec/

The source code is on GitHub: https://github.com/Altor-lab/altor-vec

I'm currently looking into ways to further compress the index size, perhaps through product quantization, as 17MB for 10K vectors is still a bit heavy for initial page loads on slower connections.

I'd love to hear your thoughts on the implementation, any ideas for reducing the memory footprint, or feedback on the Docusaurus plugin. Happy to answer any questions.

I built a reputation protocol for AI agents

https://github.com/viftode4/trustchain
1•viftode4•1m ago•0 comments

Show HN: Layerleak – Like Trufflehog, but for Docker Hub

https://github.com/Brumbelow/layerleak
2•brumbelow•2m ago•0 comments

Show HN: I Built Ngrok Alternative(beta)

https://nfltr.xyz/
1•abbiya•3m ago•0 comments

Chroma Context-1: Training a Self-Editing Search Agent

https://www.trychroma.com/research/context-1
2•philip1209•3m ago•0 comments

Ran 100 AI agents through the Community Notes algorithm: the model dominates

https://playground.opennotes.ai/#ran-100-ai-agents-through-the-community-notes-algorithm
1•anateus•5m ago•0 comments

6 Days In

https://www.patreon.com/cw/ClaudeDasein
1•Learn-to-Forget•9m ago•0 comments

Modulation of choice behavior by ultrasound on the human frontal eye fields

https://www.nature.com/articles/s41467-026-69854-7
2•PaulHoule•9m ago•0 comments

Operation Triangulation

https://en.wikipedia.org/wiki/Operation_Triangulation
1•acqbu•11m ago•0 comments

G Brags About Android Browser Benchmark on Unnamed Devices;Reporters Fall for It

https://daringfireball.net/linked/2026/03/26/google-brags-about-android-web-browser-benchmarks
2•frizlab•13m ago•1 comments

JetBlue explores potential merger partners

https://www.semafor.com/article/03/25/2026/jetblue-explores-potential-merger-partners
1•oopsiremembered•14m ago•0 comments

Show HN: Burn Room – End-to-End Encrypted Ephemeral SSH Chat

https://burnroom.chat
1•joematrix•16m ago•0 comments

Zero Day Clock: The gap between disclosure and exploitation is collapsing to 0

https://zerodayclock.com/
1•forks•16m ago•0 comments

My AI Agent Said 'Done.' It Skipped an Acceptance Criterion

https://ctxt.dev/posts/en/signum-trust-boundary/
1•speckx•20m ago•0 comments

Kldload 1.0 – ZFS on root for Linux

https://kldload.com/
3•lejalv•24m ago•0 comments

Agentic Context Engineering: Evolving Contexts for Self-Improving Language Model

https://arxiv.org/abs/2510.04618
2•Anon84•24m ago•1 comments

Simple Inversion to Defeat Systemd DOB Function

https://github.com/systemd/systemd/commit/718c63de4d3dc181fa088183af157faae72688ab
1•nullbyte808•25m ago•1 comments

Tailscale'd into Homelabbing

https://rugu.dev/en/blog/homelabbing_01/
1•kugurerdem•26m ago•0 comments

The Eye of Sauron? Réservoir Manicouagan

http://abioticdesignstudio.blogspot.com/2014/01/the-eye-of-sauron-reservoir-manicouagan.html
1•thunderbong•27m ago•0 comments

Show HN: Turbolite – a SQLite VFS serving sub-250ms cold JOIN queries from S3

https://github.com/russellromney/turbolite
4•russellthehippo•30m ago•1 comments

AI conference rejects papers over AI use

https://www.semafor.com/article/03/26/2026/ai-conference-rejects-papers-over-ai-use
1•everybodyknows•32m ago•0 comments

Hungary charges journalist following claims minister was in touch with Moscow

https://www.theguardian.com/world/2026/mar/26/hungary-charges-journalist-szabolcs-panyi-following...
4•mitchbob•33m ago•0 comments

GERP – A Headless ERP Built with Go, Spanner, Temporal, and GCP Vector

https://github.com/quantDIY/GERP
1•quantdiy•33m ago•1 comments

Show HN: ReactNative.run – Browser Metro bundler that runs React Native

https://www.reactnative.run/
1•sanketsahu•34m ago•0 comments

AI removed the boring work. It forgot that boring work was also rest

https://medium.com/the-mental-stack/ai-removed-the-boring-work-it-forgot-that-boring-work-was-als...
1•alainrk•35m ago•0 comments

StitchAgent

https://github.com/freyzo/stitchAgent
1•leo_agent•36m ago•0 comments

The first A-Corp law is here

https://www.ystrickler.com/the-first-a-corp-law-is-here/
1•speckx•37m ago•0 comments

Does the carbon cost of email even matter?

https://newslttrs.com/does-the-carbon-cost-of-email-even-matter-part-three/
1•spzb•39m ago•0 comments

Fast WHATWG spec compliant URL library written in Go

https://github.com/ada-url/goada
1•eatonphil•41m ago•0 comments

Cutting p99 latency in Go by 74% with adaptive hedged requests

https://github.com/bhope/hedge/blob/main/README.md
1•soniccontroller•41m ago•2 comments

Show HN: gifree – simple online GIF editor

https://gifree.cc
1•ahme•42m ago•0 comments