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

@kernlang/agon-dedup

v0.2.1

Published

Python sidecars for Agon AI — semantic embeddings (fastembed/MiniLM) and tree-sitter syntax validation. Bridged from KERN via stdin/stdout JSON. Ships .py files that the @kernlang/agon-core bridges spawn at runtime.

Downloads

1,664

Readme

@kernlang/agon-dedup

Brainstorm dedup sidecar — collapses near-duplicate engine drafts so you don't read the same idea three times.

Why Python

  • Semantic similarity needs sentence embeddings, not bag-of-words. TF-IDF was tried first and scored 0.06 between drafts that say the same thing in different words. Useless for this task.
  • fastembed (ONNX-based, ~30MB) gives proper paraphrase detection at ~500ms cold start without dragging in torch.
  • TS has no comparable library — transformers.js works but the WASM cold-start is multi-second and the model is 80MB+ on first download.

This is the boundary where Python is actually better, not just different.

Install

python3 -m pip install --user -r packages/dedup/requirements.txt
# or:
npm run install:python -w packages/dedup

Model is downloaded once on first run (~80MB) and cached under ~/.cache/fastembed/.

Use

# JSONL on stdin, JSON on stdout
echo '{"id":"claude","text":"Ship A"}
{"id":"codex","text":"Pick option A"}
{"id":"gemini","text":"Hold off entirely"}' | python3 packages/dedup/sidecar.py

Output:

{
  "groups": [
    {"members": ["claude", "codex"], "representative": "codex", "similarity": 0.7},
    {"members": ["gemini"], "representative": "gemini", "similarity": 1.0}
  ],
  "threshold": 0.55,
  "method": "minilm-cosine"
}

Test

npm run test:sidecar -w packages/dedup

The smoke test feeds three drafts (two paraphrases + one dissent) and asserts the paraphrases group while the dissent stays alone.

Tuning

THRESHOLD = 0.55 in sidecar.py. Calibration:

| Pair | MiniLM cosine | | ------------------------------------- | ------------- | | Identical text | 1.0 | | Same idea, different wording | 0.7 – 0.9 | | Related topic | 0.4 – 0.7 | | Unrelated | < 0.3 |

Lower = more aggressive merging (risk: collapsing real disagreement). Higher = more conservative (risk: missing obvious paraphrases).

Spawn model

Per-call subprocess. Agon spawns python3 sidecar.py only when it has drafts to dedupe, matching how engine adapters spawn their CLIs. Cold-start is the model load (~500ms). For 6 drafts the full call lands in well under 2s — negligible against an 8-12 minute brainstorm.

Status

  • [x] Sidecar built and smoke-tested
  • [x] Workspace registered
  • [x] Wired into runBrainstorm (packages/forge/src/kern/dedup-bridge.kern spawns the sidecar; result attached as BrainstormResult.groups)
  • [x] CLI agon brainstorm shows (N engines agree) tag in the bids table
  • [ ] Integration test against a real agon brainstorm call (manual for now — brainstorms run 8-12 min with 6 engines)
  • [ ] Optional: cache embeddings per session so identical drafts across re-runs reuse vectors

Failure modes (graceful)

The bridge in packages/forge returns null and the CLI falls back to the un-deduped bids table when:

  • python3 is missing (or AGON_PYTHON env var points at something broken)
  • packages/dedup/sidecar.py is missing (e.g., production install only shipped TS)
  • fastembed not installed (exit 2) — a one-line warning prints with the install command
  • Sidecar emits malformed JSON

In every case agon brainstorm still completes — dedup is purely additive.