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

@upstash/search

v0.1.9

Published

An HTTP/REST based AI Search client built on top of Upstash REST API.

Readme

Upstash AI Search npm (scoped) npm bundle size npm weekly download

[!NOTE]
This project is in GA Stage.

The Upstash Professional Support fully covers this project. It receives regular updates, and bug fixes. The Upstash team is committed to maintaining and improving its functionality.

It is a connectionless (HTTP based) AI Search client and designed for:

  • Serverless functions (AWS Lambda ...)
  • Cloudflare Workers
  • Next.js, Jamstack ...
  • Client side web/mobile applications
  • WebAssembly
  • and other environments where HTTP is preferred over TCP.

[!WARNING]
This page is about Upstash Search, a standalone, fully managed AI search product with built-in semantic search, full-text search, and reranking.

It is not the same as Upstash Redis Search — a search extension built on Tantivy, available only on Upstash Redis and separate from the Redis Search API. For that, see the Upstash Redis Search docs.

Docs

The npm package includes TypeScript source in node_modules/@upstash/search/src/ and documentation in node_modules/@upstash/search/docs/. Start with src/platforms/nodejs.ts to explore the source.

Quick Start

Install

Node.js

npm install @upstash/search

Create Database

Create a new database on Upstash

Basic Usage:

import { Search } from "@upstash/search";

type Content = {
  title: string;
  genre: "sci-fi" | "fantasy" | "horror" | "action";
  category: "classic" | "modern";
};

type Metadata = {
  director: string;
};

// Initialize Search client
const client = new Search({
  url: "<UPSTASH_SEARCH_REST_URL>",
  token: "<UPSTASH_SEARCH_REST_TOKEN>",
});

// Create or access a index
const index = client.index<Content, Metadata>("movies");

// Upsert data into the index
await index.upsert([
  {
    id: "star-wars",
    content: { title: "Star Wars", genre: "sci-fi", category: "classic" },
    metadata: { director: "George Lucas" },
  },
  {
    id: "inception",
    content: { title: "Inception", genre: "action", category: "modern" },
    metadata: { director: "Christopher Nolan" },
  },
]);

// Fetch documents by IDs
const documents = await index.fetch({
  ids: ["star-wars", "inception"],
});
console.log(documents);

// AI search with reranking:
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
  reranking: true,
});
console.log(searchResults);

// AI search without reranking:
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
});
console.log(searchResults);

// AI search with only semantic search
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
  semanticWeight: 1,
});

// AI search with only full-text search
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
  semanticWeight: 0,
});

// AI search with full-text search and sematic search
// combined with equal weights
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
  semanticWeight: 0.5,
});

// AI search without input enrichment
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
  inputEnrichment: false,
});

// AI search without reranking:
const searchResults = await index.search({
  query: "space opera",
  limit: 2,
});
console.log(searchResults);

// AI search with filter:
const searchResults = await index.search({
  query: "space",
  limit: 2,
  filter: "category = 'classic'",
});

// Delete a document by ID
await index.delete({
  ids: ["star-wars"],
});

// Search within a document range
const { nextCursor, documents: rangeDocuments } = await index.range({
  cursor: 0,
  limit: 1,
  prefix: "in",
});
console.log(rangeDocuments);

// Reset the index (delete all documents)
await index.reset();

// Get index and namespace info
const info = await search.info();
console.log(info);