One of the techniques I’ve been using more and more is running SQLite or DuckDB inside my browser, thanks to their WebAssembly builds. That means you can query and manipulate a dataset with no backend at all.

This lets you build an interface for the exact question you’re trying to answer.

Put a Parquet or SQLite file next to your HTML, host it on S3 or GitHub Pages, and use DuckDB-WASM to query it. You can filter, sort, and aggregate tens of millions of rows in the browser.

Even better, you can map a dataset by meaning. Compute the embeddings once, ahead of time, and store them as a column in the same Parquet file. The browser never runs a model. DuckDB’s built-in array_cosine_similarity finds similar rows with plain SQL.

I’ve always wondered what the San Mateo County Board of Supervisors actually spends its time on. It turns out every agenda item comes with a staff report, and they’re all public. That’s 15 meetings and several hundred decisions in the last six months, more than I can read.

import * as duckdb from "https://cdn.jsdelivr.net/npm/@duckdb/duckdb-wasm/+esm";

// Load DuckDB in the browser
const bundle = await duckdb.selectBundle(duckdb.getJsDelivrBundles());
const worker = await duckdb.createWorker(bundle.mainWorker);
const db = new duckdb.AsyncDuckDB(new duckdb.ConsoleLogger(), worker);
await db.instantiate(bundle.mainModule);

// Point at a Parquet file sitting next to this page
const conn = await db.connect();
await conn.query(`
  CREATE VIEW items AS
  SELECT * FROM 'https://example.com/agenda_items.parquet'
`);

// Find the 10 decisions most similar to the permit task force contract
const result = await conn.query(`
  WITH target AS (
    SELECT matter_id, embedding FROM items
    WHERE title LIKE '%Permit Entitlement Blue Ribbon Task Force%'
  )
  SELECT i.meeting_date, i.department, i.title,
         array_cosine_similarity(
           i.embedding::FLOAT[384], target.embedding::FLOAT[384]
         ) AS similarity
  FROM items i, target
  WHERE i.matter_id <> target.matter_id
  ORDER BY similarity DESC
  LIMIT 10
`);

console.table(result.toArray());

Embed each staff report once on your laptop. Then plot the results as an interactive 3D map with three.js. Click any point to read the staff report behind it.

Next time you have a spreadsheet you want to share, try turning it into a site instead. I think you’ll be surprised how far a single HTML file can go.

Data-based sites
Older post

Ping-Pong Vibe Coding

One of the techniques I’ve been using more and more is running SQLite or DuckDB inside my browser, thanks to their WebAssembly builds. That means you can que...