Serverless AI search at scale
Upstash is a serverless database platform that offers different products, including Redis, QStash and Vector database.
Upstash Redis: Upstash provides a serverless database service that is compatible with the Redis API.
Upstash QStash: QStash is a serverless messaging and scheduling solution provided by Upstash. It is designed to easily integrate into existing workflows and help developers build reliable systems without managing infrastructure.
Upstash Vector: Upstash Vector is a serverless vector database designed for working with vector embeddings. It's essential for managing numeric representations of objects (like images, sounds, text) in a multi-dimensional space.
Start by connecting to your existing project and then run vercel link in the CLI to link to the project locally.
Run vercel env pull to make the latest environment variables available to your project locally.
Run the following command to install the Upstash Search SDK:
npm install @upstash/searchYou can find more details and documentation on the Upstash Search SDK for TypeScript.
To start using the SDK in your project, import the client and use it in your API endpoint:
import { Search } from '@upstash/search';import { NextResponse } from 'next/server';
// Initialize Searchconst client = Search.fromEnv();const index = client.index("movies")
export const POST = async () => { // Make search request const result = await index.search({ query: "hello world!" }); // Return the result in the response return new NextResponse(JSON.stringify({ result }), { status: 200 });};Start by connecting to your existing project and then run vercel link in the CLI to link to the project locally.
Run vercel env pull to make the latest environment variables available to your project locally.
Run the following command to install the Upstash Search SDK:
npm install @upstash/searchYou can find more details and documentation on the Upstash Search SDK for TypeScript.
To start using the SDK in your project, import the client and use it in your API endpoint:
import { defineEventHandler } from "h3";import { Search } from '@upstash/search';
// Initialize Searchconst client = Search.fromEnv();const index = client.index("movies")
export default defineEventHandler(async () => { // Fetch data from Redis const result = await index.search({ query: "hello world!" }); // Return the result in the response return { result };});Start by connecting to your existing project and then run vercel link in the CLI to link to the project locally.
Run vercel env pull to make the latest environment variables available to your project locally.
Run the following command to install the Upstash Search SDK:
npm install @upstash/searchYou can find more details and documentation on the Upstash Search SDK for TypeScript.
To start using the SDK in your project, import the client and use it in your API endpoint:
import { UPSTASH_SEARCH_REST_URL, UPSTASH_SEARCH_REST_TOKEN } from "$env/static/private";import { json } from '@sveltejs/kit';import { Search } from '@upstash/search';
// Initialize Searchconst client = new Search({ url: UPSTASH_SEARCH_REST_URL, token: UPSTASH_SEARCH_REST_TOKEN});const index = client.index("movies")
export async function POST() { // Fetch data from Redis const result = await index.search({ query: "hello world!" }); // Return the result in the response return json({ result });};It will set the required environment variables which will be used by your project.
*** Redis is a trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by Upstash is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and Upstash.