Generated banner for Upstash Search JS
Generated logo for Upstash Search JS

Upstash Search JS

UpstashOfficialCreated by Upstash

  • Skill
  • Tool integration
  • Software development
  • MIT
  • No issues found

From the author

Work with the @upstash/search TypeScript/JavaScript SDK, a serverless full-text and semantic search database with built-in reranking. Use when adding search to an app or site, creating a search index, upserting documents with searchable content and filterable metadata, running keyword, semantic, or hybrid search queries, reranking results, filtering with SQL-like or structured filter syntax, paginating with range, fetching or deleting documents, resetting an index, or checking index info. Also use when the user asks for site search, product, document, or knowledge-base search, or a managed search service that needs no cluster to run.
— the description by Upstash

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The upstash-search-js skill provides comprehensive guidance for utilizing the @upstash/search TypeScript/JavaScript SDK. It enables developers to implement serverless full-text, semantic, and hybrid search functionality within their applications. The skill covers the entire lifecycle of search operations, including index management, document upsertion with metadata, advanced filtering, and result reranking, all without the need for managing clusters.

What it does

  • Facilitates the creation and management of serverless search indexes.
  • Supports upserting documents with both searchable content and filterable metadata.
  • Enables execution of keyword, semantic, and hybrid search queries.
  • Provides tools for result reranking and structured filtering.
  • Includes methods for document retrieval, deletion, and index maintenance.
  • Offers guidance on pagination and range-based queries.

When to use it

  • When adding full-text or semantic search to a web application or site.
  • When building a product, document, or knowledge-base search feature.
  • When you require a managed, serverless search service that avoids cluster management.
  • When implementing complex filtering or reranking requirements for search results.

Advantages

  • Serverless architecture eliminates the need for manual cluster management.
  • Supports both keyword and semantic search in a single interface.
  • Built-in reranking capabilities improve search result relevance.
  • Flexible metadata filtering allows for precise query control.
  • Native TypeScript support ensures type safety during development.

Usage examples

“How do I initialize the Upstash Search client and add a document?”
The agent provides the code to import the Search class, initialize it with environment variables, and use the index.upsert method to add a document.
“Show me how to perform a search query with filtering.”
The agent demonstrates the index.search method, showing how to pass a query string alongside structured filter parameters.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/upstash/upstash-search-js/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip upstash-search-js.zip -d .agents/skills

Documentation by Upstash

Upstash Search Documentation

Bundled docs and source

Before writing or debugging SDK code, check node_modules/@upstash/search/docs/ for bundled docs and node_modules/@upstash/search/src/ for readable TypeScript source. Read and search the relevant files when present; otherwise use the references in this skill.

Quick Start

Install the TS SDK:

npm install @upstash/search

Create a client and perform a simple upsert + search:

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

const client = new Search({ url: process.env.UPSTASH_SEARCH_REST_URL, token: process.env.UPSTASH_SEARCH_REST_TOKEN });
const index = client.index("my-index");

await index.upsert({ id: "1", content: { text: "hello world" } });
const results = await index.search({ query: "hello" });

Basic steps:

  • Create an index

  • Insert or update documents

  • Run searches or filtered queries

Other Skill Files

sdk-overview

Provides detailed documentation for all TypeScript SDK commands. Includes:

  • delete: Deleting documents

  • fetch: Retrieving a document

  • info: Index info

  • range: Range queries

  • reset: Clearing an index

  • search: Search queries

  • upsert: Adding/updating documents

  • getting-started: Setup steps for the SDK

quick-start

Provides a fast, end-to-end workflow for creating a Search database, adding documents, and querying them. Covers essential concepts including:

  • Creating a database and storing credentials

  • Adding documents with content and metadata

  • Understanding content vs metadata (searchability and filterability)

  • Performing searches with optional reranking

  • Filtering syntax with SQL-like or structured filters

  • Common pitfalls and best practices

Files

quick-start.md

This Skill gives agents a fast, end‑to‑end workflow for creating a Search database, adding documents, and querying them. It also summarizes key concepts like content vs metadata, filters, and reranking so agents can use Search correctly.


Create a Database

  1. Open the Vector tab → Create → Search Database.

  2. Provide a name (e.g., product-search) and region.

  3. Select a plan.

Agents should store:

  • UPSTASH_SEARCH_REST_URL

  • UPSTASH_SEARCH_REST_TOKEN

These values are required when constructing a Search client.


Add Documents

Documents consist of:

  • id: unique identifier

  • content (required): indexed and searchable

  • metadata (optional): not searchable, but retrievable and filterable

TypeScript / Python Example
import { Search } from "@upstash/search";
const client = new Search({ 
  url: process.env.UPSTASH_SEARCH_REST_URL,
  token: process.env.UPSTASH_SEARCH_REST_TOKEN 
});
const index = client.index("movies");
await index.upsert([
  {
    id: "star-wars",
    content: { title: "Star Wars", genre: "sci-fi", category: "classic" },
    metadata: { director: "George Lucas" }
  }
]);
from upstash_search import Search
client = Search(url=URL, token=TOKEN)
index = client.index("movies")
index.upsert(documents=[{
  "id": "movie-0",
  "content": {
    "title": "Star Wars",
    "overview": "Sci-fi space opera",
    "genre": "sci-fi",
    "category": "classic",
  },
  "metadata": {"poster": "https://poster.link/starwars.jpg"}
}])

Content vs Metadata (Essential Concepts)

  • Content

    • Required

    • Indexed and searchable

    • Can be used in filters

    • Ideal for textual and semantic data

  • Metadata

    • Optional

    • Not indexed → cannot be searched

    • Still filterable using @metadata.key

    • Used for contextual / reference fields

Example:

{
  "content": { "title": "Star Wars", "genre": "sci-fi" },
  "metadata": { "director": "George Lucas", "sku": "SW-001" }
}

Searching supports semantic + keyword hybrid search, optional reranking, and filters.

TypeScript / Python Example
const res = await index.search({ query: "space opera", limit: 2, reranking: true });
scores = index.search(query="space opera", limit=2, reranking=True)

Filtering

Filters restrict results using SQL‑like syntax or structured filters (TypeScript only). Both content fields and metadata fields can be used.

Metadata fields require @metadata. prefix.

Example (String Filters)
await index.search({
  query: "sony headphones",
  filter: "warehouse_location = 'A3-15' AND @metadata.supplier_id = 'SUP-123'"
});
Example (Type‑safe Filters, TS SDK)
await index.search({
  query: "sony headphones",
  filter: {
    AND: [
      { category: { equals: "Electronics" } },
      { "@metadata.count": { greaterThanOrEquals: 3 } }
    ]
  }
});

Common operators:

  • equals, not equals

  • <, <=, >, >=

  • glob / not glob

  • in / not in

  • contains / not contains (arrays)

  • has field / has not field


Reranking

Reranking reorders results using a high‑accuracy model.

  • Disabled by default (false)

  • When true, improves relevance but costs $1 per 1K reranked items

Example:

await index.search({ query: "space opera", reranking: true });
index.search(query="space opera", reranking=True)

Use when:

  • Precision is critical

  • Results require more semantic depth

  • Queries are ambiguous or conceptual


Common Pitfalls

  • Missing content field → upsert fails.

  • Metadata fields are not searchable.

  • Metadata must be prefixed as @metadata.key in filters.

  • Filters may return fewer than topK results if too selective.

  • Indexes are created automatically on first upsert.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

No issues found by our static scan· No issues found

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
Upstash
Publisher
Upstash (Official)
Source
upstash/skills · skills/upstash-search-js · commit 9f9e3e5
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Upstash or Upstash.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download upstash-search-js.zip