MCPInstall

upstash-vector-db-skills

Upstash Vector DB setup, semantic search, namespaces, and embedding models (MixBread preferred). Use when building vector search features on Vercel.

Installs
366
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/gocallum/nextjs16-agent-skills --skill upstash-vector-db-skills
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads upstash-vector-db-skills automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Links

Quick Setup

1. Create Vector Index (Upstash Console)

  • Go to Upstash Console
  • Create Vector Index: name, region (closest to app), type (Dense for semantic search)
  • Select embedding model: MixBread AI recommended (or use Upstash built-in models)
  • Copy UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN to .env

2. Install SDK

pnpm add @upstash/vector

3. Environment

UPSTASH_VECTOR_REST_URL=your_url
UPSTASH_VECTOR_REST_TOKEN=your_token

Code Examples

Initialize Client (Node.js / TypeScript)

import { Index } from "@upstash/vector";

const index = new Index({
  url: process.env.UPSTASH_VECTOR_REST_URL,
  token: process.env.UPSTASH_VECTOR_REST_TOKEN,
});

Upsert Documents (Auto-Embed)

When using an embedding model in the index, text is embedded automatically:

// Single document
await index.upsert({
  id: "doc-1",
  data: "Upstash provides serverless vector database solutions.",
  metadata: { source: "docs", category: "intro" },
});

// Batch
await index.upsert([
  { id: "doc-2", data: "Vector search powers semantic similarity.", metadata: { source: "docs" } },
  { id: "doc-3", data: "MixBread AI provides high-quality embeddings.", metadata: { source: "blog" } },
]);

Query / Semantic Search

// Semantic search with auto-embedding
const results = await index.query({
  data: "What is semantic search?",
  topK: 5,
  includeMetadata: true,
});

results.forEach((result) => {
  console.log(`ID: ${result.id}, Score: ${result.score}, Metadata:`, result.metadata);
});

Using Namespaces (Data Isolation)

Namespaces partition a single index into isolated subsets. Useful for multi-tenant or multi-domain apps.

// Upsert in namespace "blog"
await index.namespace("blog").upsert({
  id: "post-1",
  data: "Next.js tutorial for Vercel deployment",
  metadata: { author: "user-123" },
});

// Query only "blog" namespace
const blogResults = await index.namespace("blog").query({
  data: "Vercel deployment",
  topK: 3,
  includeMetadata: true,
});

// List all namespaces
const namespaces = await index.listNamespaces();
console.log(namespaces);

// Delete namespace
await index.deleteNamespace("blog");

Full Semantic Search Example (Vercel Function)

// api/search.ts (Vercel Edge Function or Serverless Function)
import { Index } from "@upstash/vector";

export const config = {
  runtime: "nodejs", // or "edge"
};

const index = new Index({
  url: process.env.UPSTASH_VECTOR_REST_URL,
  token: process.env.UPSTASH_VECTOR_REST_TOKEN,
});

export default async function handler(req, res) {
  if (req.method !== "POST") {
    return res.status(405).json({ error: "Method not allowed" });
  }

  const { query, namespace = "", topK = 5 } = req.body;

  try {
    const searchIndex = namespace ? index.namespace(namespace) : index;
    const results = await searchIndex.query({
      data: query,
      topK,
      includeMetadata: true,
    });

    return res.status(200).json({ results });
  } catch (error) {
    console.error("Search error:", error);
    return res.status(500).json({ error: "Search failed" });
  }
}

Index Operations

// Reset (clear all vectors in index or namespace)
await index.reset();

// Or reset a specific namespace
await index.namespace("old-data").reset();

// Delete a single vector
await index.delete("doc-1");

// Delete multiple vectors
await index.delete(["doc-1", "doc-2", "doc-3"]);

Embedding Models

Available in Upstash

  • BAAI/bge-large-en-v1.5 (1024 dim, best performance, ~64.23 MTEB score)
  • BAAI/bge-base-en-v1.5 (768 dim, good balance)
  • BAAI/bge-small-en-v1.5 (384 dim, lightweight)
  • BAAI/bge-m3 (1024 dim, sparse + dense hybrid)

Recommended: MixBread AI

If using MixBread as your embedding provider:

  1. Create a MixBread API key at https://www.mixbread.ai/
  2. When creating your Upstash index, select MixBread as the embedding model.
  3. MixBread handles tokenization and semantic quality automatically.
  4. No extra setup needed in your code; use index.upsert() / index.query() with text directly.

Best Practices

For Vercel Deployment

  • Store credentials in Vercel Environment Variables (project settings or .env.local).
  • Use Edge Functions or Serverless Functions for low-latency access.
  • Implement request rate limiting to stay within Upstash quotas.

Namespace Strategy

  • Use namespaces to isolate data by tenant, domain, or use case.
  • Example: namespace("user-123") for per-user search.
  • Clean up old namespaces to avoid storage bloat.

Query Performance

  • Keep topK reasonable (5–10 typically sufficient).
  • Use metadata filtering to pre-filter results if possible.
  • Upstash is eventually consistent; expect slight delays after upserts.

Error Handling

try {
  const results = await index.query({
    data: userQuery,
    topK: 5,
    includeMetadata: true,
  });
} catch (error) {
  if (error.status === 401) {
    console.error("Invalid credentials");
  } else if (error.status === 429) {
    console.error("Rate limited");
  } else {
    console.error("Query error:", error);
  }
}

Common Patterns

RAG (Retrieval Augmented Generation)

  1. Upsert documents / knowledge base into Upstash.
  2. On user query, retrieve top-k similar docs via semantic search.
  3. Pass retrieved docs + user query to LLM for better context.
const docs = await index.query({ data: userQuestion, topK: 3 });
const context = docs.map((d) => d.metadata?.text).join("\n");
// Pass context to LLM

Multi-Tenant Search

Use namespaces to isolate each tenant's vectors:

const userNamespace = `tenant-${userId}`;
await index.namespace(userNamespace).upsert({ id, data, metadata });
// Queries only see that tenant's data

Batch Indexing

For bulk imports, upsert in batches:

const batchSize = 100;
for (let i = 0; i < documents.length; i += batchSize) {
  const batch = documents.slice(i, i + batchSize);
  await index.upsert(batch);
  console.log(`Indexed batch ${i / batchSize + 1}`);
}

Troubleshooting

  • No results returned: Ensure documents are indexed and embedding model is active.
  • Slow queries: Check quota limits; consider upgrading plan or reducing dataset size.
  • Stale data: Upstash is eventually consistent; wait 1–2 seconds before querying new inserts.
  • Namespace not working: Ensure namespace exists (created on first upsert) or use the default "".

FAQ

What does the upstash-vector-db-skills skill do?

Upstash Vector DB setup, semantic search, namespaces, and embedding models (MixBread preferred). Use when building vector search features on Vercel.

How do I install upstash-vector-db-skills?

Run npx skills add https://github.com/gocallum/nextjs16-agent-skills --skill upstash-vector-db-skills in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/upstash-vector-db-skills/ (personal) or .claude/skills/upstash-vector-db-skills/ (project).

Which AI agents can use upstash-vector-db-skills?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is upstash-vector-db-skills safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains upstash-vector-db-skills?

It is published by gocallum in gocallum/nextjs16-agent-skills. It has 366 recorded installs.

More from gocallum/nextjs16-agent-skills

View all →

prisma-orm-v7-skills

gocallum/nextjs16-agent-skills

Key facts and breaking changes for upgrading to Prisma ORM 7. Consider version 7 changes before generation or troubleshooting

Data & Databases1K installs

authjs-skills

gocallum/nextjs16-agent-skills

Auth.js v5 setup for Next.js authentication including Google OAuth, credentials provider, environment configuration, and core API integration

Backend & APIs792 installs

nextjs16-skills

gocallum/nextjs16-agent-skills

Key facts and links for Next.js 16. Use for planning, writing, and troubleshooting Next.js 16 changes.

Frontend & Design712 installs

ai-sdk-6-skills

gocallum/nextjs16-agent-skills

AI SDK 6 Beta overview, agents, tool approval, Groq (Llama), and Vercel AI Gateway. Key breaking changes from v5 and new patterns.

AI & Agents481 installs

clerk-nextjs-skills

gocallum/nextjs16-agent-skills

Open the skill to read its SKILL.md instructions.

Frontend & Design436 installs

resend-integration-skills

gocallum/nextjs16-agent-skills

Open the skill to read its SKILL.md instructions.

AI & Agents411 installs

Popular ai & agents skills

View category →

google-agents-cli-publish

google/agents-cli

This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).

AI & Agents513.9K installs

google-agents-cli-eval

google/agents-cli

This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).

AI & Agents513.5K installs

skill-creator

anthropics/skills

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

OfficialAI & Agents416.4K installs

codex-pet

prime-skills/runcomfy-agent-skills

Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.

AI & Agents402.1K installs

full-output-enforcement

leonxlnx/taste-skill

Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.

AI & Agents401K installs

executing-plans

obra/superpowers

Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available

AI & Agents245.7K installs