npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fleet-vector-api

v0.1.0

Published

**Real semantic search** across the SuperInstance ecosystem using Cloudflare Workers AI embeddings + Vectorize.

Readme

fleet-vector-api

Real semantic search across the SuperInstance ecosystem using Cloudflare Workers AI embeddings + Vectorize.

This isn't fake 32-dim hand-computed vectors. This is @cf/baai/bge-small-en-v1.5 — a real 384-dimensional embedding model running on Cloudflare's edge network, producing embeddings that actually understand what your crates do.

Pipeline

Crate README + Cargo.toml metadata
        ↓
Workers AI (bge-small-en-v1.5, 384-dim)
        ↓
Vectorize index (cosine similarity)
        ↓
Semantic search API at the edge

Why This Matters

The ecosystem has 548 crates. Finding related work across domains is hard:

  • "What crates use conservation laws?" → finds conservation-law, entropy-lint, agent-homeostasis, hodge-belief-rs
  • "sheaf theory" → finds persistent-sheaf, sheaf-cohomology, sheaf-agents-c, sheaf-coherence
  • "agent timing" → finds agent-cadence, agent-rubato, agent-groove, agent-swing

Keyword search misses cross-domain connections. Semantic embeddings catch them.

API

Ingest

curl -X POST http://localhost:8787/ingest \
  -H "Content-Type: application/json" \
  -d '{
    "crates": [{
      "name": "conservation-law",
      "description": "Core invariant for constraint-aware AI systems",
      "readme": "# Conservation Law\n\nImplements γ + η = C...",
      "version": "0.2.1",
      "keywords": ["conservation", "invariant", "ternary"]
    }]
  }'

Search

curl -X POST http://localhost:8787/search \
  -H "Content-Type: application/json" \
  -d '{" query": "agent coordination with conservation laws", "topK": 5 }'

Find Similar

curl -X POST http://localhost:8787/similar \
  -H "Content-Type: application/json" \
  -d '{"crate_name": "conservation-law", "topK": 10}'

Debug Embed

curl -X POST http://localhost:8787/embed \
  -H "Content-Type: application/json" \
  -d '{"text": "ternary mathematics for agent systems"}'
# Returns: 384-dim vector, magnitude, preview

Endpoints

| Method | Path | Description | |--------|------|-------------| | POST | /ingest | Ingest crate(s): README → Workers AI → Vectorize | | POST | /search | Semantic search across all crates | | POST | /similar | Find crates similar to a given crate | | GET | /crates/:name | Get crate metadata + README preview | | GET | /stats | Index statistics | | POST | /embed | Debug: embed arbitrary text | | GET | /health | Health check |

Batch Ingestion

# Ingest all crates from local filesystem
npm run ingest -- --api http://localhost:8787 --repos /home/phoenix/repos

# Dry run first
npm run ingest -- --dry-run

# Limit to first 10 for testing
npm run ingest -- --limit=10

Architecture Decisions

Why bge-small-en-v1.5 (384-dim) not bge-m3 (1024-dim)?

  • Latency: 384-dim embeddings are ~3x faster to generate at the edge
  • Cost: Fewer dimensions = cheaper Vectorize storage
  • Accuracy: For crate descriptions (technical English), 384-dim is sufficient
  • Upgrade path: Swap to @cf/baai/bge-m3 in wrangler.toml when needed

Why CLS pooling?

Cloudflare recommends pooling: 'cls' for bge models — uses the [CLS] token representation which captures full-sequence semantics better than mean pooling.

Why normalize to unit vectors?

Cosine similarity is the standard for semantic search. Unit vectors make dot product = cosine similarity, which is what Vectorize uses internally.

Storage

| Store | Purpose | Retention | |-------|---------|-----------| | Vectorize | 384-dim embeddings + metadata | Permanent | | KV | Full crate metadata JSON | 30 days (refresh on ingest) | | R2 | Raw README.md files | Permanent |

Local Development

npm install
npm run dev     # Starts wrangler dev on :8787
npm test        # Run unit tests

Deployment

# Create Vectorize index first
wrangler vectorize create fleet-crates --dimensions=384 --metric=cosine

# Deploy
npm run deploy

License

MIT OR Apache-2.0