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

@mexl/backstage-plugin-opensearch-ai-backend

v1.0.0

Published

OpenSearch AI-enhanced Backend Plugin for Backstage

Readme

OpenSearch AI-enhanced Backend Plugin (Skeleton)

This is a backend-only Backstage plugin that aims to provide OpenSearch-based search with optional AI-assisted enhancements (query rewriting, result re-ranking, and semantic vector search).

Status: MVP with OpenSearch search, admin indexing routes, AI-assisted rewrite and heuristic re-ranking.

Key Pieces

  • createRouter(options): exposes /health and /query routes.
  • OpenSearchClient: stub for BM25/hybrid search and indexing.
  • QueryRewriteService: stub for AI-assisted query rewriting.
  • ReRankerService: stub for AI-based re-ranking.
  • FeatureToggle: controls feature flags (rewrite, rerank, semantic).
  • Observability: hooks for metrics, tracing, and logs.

Features

Core Search Features

  • OpenSearch-based search with BM25 scoring, filters, and highlights
  • Admin endpoints: index template management, bulk indexing, and reindexing (Catalog/TechDocs/APIs)

AI Enhancement Features

Configure these features using the features config block:

opensearch-ai:
  features:
    rewrite: true    # AI query rewriting
    rerank: true     # AI result re-ranking  
    semantic: true   # Vector semantic search

Query Rewriting (rewrite: true)

  • Purpose: Transforms user queries using AI to improve search results
  • How it works: Uses OpenAI GPT-4o-mini to normalize queries, expand synonyms, and clarify intent
  • Impact: Better matching for natural language queries, handles typos and ambiguous terms
  • Cost: ~$0.0001 per query (cached for 5 minutes to reduce costs)
  • Example: "api docs" → "API documentation endpoints"

Result Re-ranking (rerank: true)

  • Purpose: Re-orders search results using AI to improve relevance
  • How it works: Uses heuristic scoring based on content freshness, type boosts, and relevance
  • Impact: More relevant results appear first, especially for broad queries
  • Cost: Minimal (computation-based, no API calls)
  • Compatibility: Works with or without rewrite feature

Semantic Search (semantic: true)

  • Purpose: Enables meaning-based search using vector embeddings
  • How it works: Uses OpenAI text-embedding-3-small to create vector representations
  • Impact: Finds conceptually related content even without exact keyword matches
  • Cost: ~$0.00002 per query (cached for 1 hour)
  • Example: "authentication" finds results about "login", "OAuth", "security"

Feature Compatibility

  • All features work independently - you can enable any combination
  • Rewrite + Semantic: Best for natural language queries with concept matching
  • Rerank + Semantic: Good balance of relevance and semantic understanding
  • All three enabled: Maximum search quality but highest API costs

Config

See docs/AI.md and docs/USAGE.md for configuration and wiring examples.

Build

From this directory:

npm install
npm run build

License

UNLICENSED (internal scaffolding)