Lat × Long

TerraBit: Global similarity search, entirely in your browser

The premise of TerraBit is simple: Click on any area around the globe and return similar locations. We’ve seen solutions to this problem before, NASA’s (currently broken) Similarity Search springs to mind. But TerraBit is different because the computation happens entirely in the browser using modern, cloud-native technologies.

The Clay v1.5 corpus is binarised, packaged as a partitioned GeoParquet and uploaded to a public object storage. The browser queries the data using DuckDB-WASM. The comparison of binary vectors then happens on the GPU.

Isaac Corley and Caleb Robinson have more detail:

The 50M embeddings are partitioned into geohash-aligned Parquet shards and published on Source Cooperative, which serves them cloud-natively out of S3 — public HTTP with byte-range support, no egress fees, no intermediate server. A single manifest file records the path, row count, and spatial extent of every shard.

When you draw an ROI, DuckDB-WASM queries the manifest with a bounding-box predicate — manifest-based shard pruning: the manifest acts as a coarse spatial index so the browser never opens metadata on shards outside the ROI. Once the intersecting shard list is resolved, DuckDB streams those shard files over HTTP (via httpfs range requests) and applies a second filter at the row level — a bbox predicate for rectangles, or ST_Intersects for freehand polygons — to extract only patches within the drawn region. Ranking over the candidate slice is exact brute-force Hamming: binary embeddings arrive as packed Uint8Array columns (128 bytes per 1024-dim vector) and are scored in a Web Worker via XOR+popcount, which maps directly to hardware-accelerated popcount instructions and completes in milliseconds for a typical AOI partition.

New results appear instantly, once the data is downloaded for the specified area of interest. Not long ago, this needed a round-trip to a back-end, now it runs entirely in your browser.