DEV Community

Cover image for Bug Deduplication with AI (Node.js + OpenRouter)
Faris Kurnia
Faris Kurnia

Posted on

Bug Deduplication with AI (Node.js + OpenRouter)

QA teams often face the same problem: duplicate bug reports. Different test cases fail, but the root cause is actually the same. To cut through the noise, I built a Proof of Concept (PoC) using Node.js + OpenRouter AI to automatically cluster similar failures and suggest root causes

Why?

๐Ÿšซ Less time wasted triaging duplicate bugs
๐Ÿ” Faster root cause analysis
๐Ÿค– AI-driven clustering & summarization

Tech Stack

  • Node.js
  • ml-kmeans for clustering
  • OpenRouter API (chat model for semantic grouping)

Setup
Install dependencies:
npm install node-fetch ml-kmeans dotenv

Add your API key to .env:
OPENROUTER_API_KEY=your_api_key_here
CHAT_MODEL=google/gemma-3n-e2b-it:free

Example snippet:

Example result:

Takeaways

โœ… AI reduces noise from duplicate bugs
โœ… Saves QA team time during triage
โœ… Extensible to native CI/CD logs

This is just a PoC, but it shows how AI can make QA workflows smarter. What do you think of this POC? If you have any suggestions, leave a comment

Or if you want to read the full version, you can click here

Top comments (0)