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

prsense

v1.0.1

Published

AI-powered PR duplicate detection system using embeddings, bloom filters, and multi-signal scoring

Readme

PRSense

Production-Ready AI-Powered Pull Request Duplicate Detection

Mission: Build trustworthy tools that give repositories memory — reducing duplicate work while preserving contributor credit.

Automatically detect duplicate PRs and save hours of review time. Deploy in 5 minutes.

npm version License: MIT Node.js Tests TypeScript PRs Welcome Deploy to Vercel


[!TIP] New Here? Start with START_HERE.md for a beginner-friendly overview, then check the guides below.

Quick Links:


Key Features

Core Capabilities

  • 95% Accuracy — Real OpenAI embeddings (or free local alternatives)
  • 2ms Latency — Bloom filter + ANN for sub-linear scaling
  • Production Storage — SQLite (dev) or PostgreSQL + pgvector (prod)
  • GitHub Bot — Auto-comments on duplicate PRs
  • Deploy in 5min — Vercel, Docker, or manual server
  • Cost-Effective — $0-50/month depending on scale
  • Attribution Tracking — Preserves original authorship credit

Advanced Features

  • Persistent Storage — Exports for SQLite/Postgres
  • Score Breakdown — Explainable "Why" for every match
  • Batch API — Check 100s of PRs in CI/CD pipelines
  • Embedding Cache — Reduces API costs by 90%
  • Configurable Weights — Tune scoring (Text vs Diff vs Files)
  • Dry-Run Mode — specific testing without indexing
  • ONNX Local Embeddings — 100% offline, privacy-first
  • Cross-Repo Detection — Find duplicates across your entire org

📖 See Features Documentation for details.


Architecture

┌─────────────┐
│  New PR     │
└──────┬──────┘
       │
       ▼
┌─────────────────┐
│ Bloom Filter    │ ──── Early rejection
│ (Fast Path)     │
└──────┬──────────┘
       │ might contain
       ▼
┌─────────────────┐
│ Embedding       │ ──── Text + Diff embeddings
│ Pipeline        │
└──────┬──────────┘
       │
       ▼
┌─────────────────┐
│ ANN Search      │ ──── Candidate retrieval (k=20)
│ (Retriever)     │
└──────┬──────────┘
       │
       ▼
┌─────────────────┐
│ Multi-Signal    │ ──── Text + Diff + File Overlap
│ Ranker          │      (Configurable weights)
└──────┬──────────┘
       │
       ▼
┌─────────────────┐
│ Decision        │ ──── HIGH (≥0.9), MEDIUM (≥0.82), LOW
│ Engine          │
└──────┬──────────┘

Project Structure

prsenses-labs/
├── package.json                # Monorepo Root
├── PRSenses/                   # Core Library & API
│   ├── src/                    # Detection Logic
│   └── action/                 # GitHub Action
├── prsense-vscode/             # VS Code Extension
└── prsense-analytics/          # Analytics Dashboard

Quick Start

Installation

git clone https://github.com/prsense-labs/prsense
cd prsense
npm install     # Installs dependencies
npm run build   # Builds all packages

[!TIP] Zero setup mode: After building, the CLI works immediately using local ONNX embeddings. No API key required.

6 Ways to Use

1. GitHub Action (CI/CD)

- uses: prsense-labs/prsense@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}
    embedding-provider: 'onnx'

2. VS Code Extension (Local Dev)

3. CLI Tool (Manual Check)

npm run cli check my-pr.json

4. GitHub Bot (Webhook)

5. Library (NodeJS Integration)

import { PRSenseDetector } from 'prsense'
const result = await detector.check(prData)

6. Microservice (Docker/API)


Usage Example

Simple API (Recommended)

import { PRSenseDetector, createPostgresStorage } from './prsense.js'
import { createOpenAIEmbedder } from './embedders/openai.js'

// 1. Initialize
const storage = await createPostgresStorage().init()
const detector = new PRSenseDetector({
  embedder: createOpenAIEmbedder(),
  storage,
  enableCache: true
})

// 2. Check for duplicates
const result = await detector.checkDetailed({
  prId: 123,
  title: 'Fix login bug',
  description: 'Handle empty passwords',
  files: ['auth/login.ts']
})

// 3. Handle Result
if (result.type === 'DUPLICATE') {
  console.log(`Duplicate of PR #${result.originalPr}`)
  console.log(`Confidence: ${result.confidence}`)
  console.log(`Breakdown:`, result.breakdown)
  // Breakdown: { textSimilarity: 0.95, diffSimilarity: 0.88, ... }
}

Documentation Index


Design Principles

  1. Scalability — O(1) lookups with Bloom filters
  2. Accuracy — Multi-signal scoring > Single vector search
  3. Privacy — Local embeddings (ONNX) support
  4. Modularity — Swap storage, embedders, or rankers easily

What We Don't Do

PRSense tools are designed to assist humans, not replace them.

We do not:

  • Block or auto-close pull requests
  • Judge code quality
  • Replace maintainer decisions or code review

Contributing

Contributions welcome! Please read CONTRIBUTING.md before submitting a PR.


License

MIT License


PRSense — Because duplicate PRs waste everyone's time. Let's fix that.