Skip to main content
Introducing packages.sweber.dev
Cosine overview

CosineLive demo, free and Pro.

Everything below runs in your browser: the index of the Cosine and Surjection docs, keyword search, and, once you load it, the embedding model that searches by meaning. There is no search server.

Your queries are not sent anywhere. Loading the model downloads about 23 MB from Hugging Face once; your browser caches it.

Insights

Search insights (Pro)What your docs are missing.

@weber-development/cosine-insights records which searches find nothing and which results nobody opens, without cookies, ids or IP addresses, and turns them into a report. The example below was made from a month of made-up searches on a docs site.

npx cosine-insights report --log data/searches.ndjson --out insights.html

Next

Add it to your docsTwo commands and one tag.

Build the index with npx cosine build docs --out public/cosine, add <cosine-search index="/cosine/cosine-index.json"> to your layout, done. Cosine Pro builds the index in every Vite build and adds search insights.

Getting started