Serverless Vector Database
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. If you are starting a new project, you can use our template.
Run vercel env pull .env.development.local to make the latest environment variables available to your project locally.
Run the following command to install the Upstash Vector SDK:
npm install @upstash/vectorYou can find more details and documentation on the Upstash Vector SDK for TypeScript.
To start using the SDK in your project, import the client and use it in your API endpoint:
import { Index } from "@upstash/vector";import { NextResponse } from "next/server";
const index = new Index({ url: process.env.UPSTASH_VECTOR_REST_URL, token: process.env.UPSTASH_VECTOR_REST_TOKEN,})
export const GET = async () => { const result = await index.fetch([”vector-id”], { includeData: true }) return new NextResponse( JSON.stringify({ result: result[0] }), { status: 200 } )}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.