Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A free, open-source template for building natural language image search on the AI Cloud.
Vectr is an open-source Next.js template for building natural language image search on the AI Cloud: it automatically generates a description for every uploaded image using Grok 2 Vision and indexes both description and metadata in Upstash Vector Search so users can find images by describing what they remember.
Vectr is a free, MIT-licensed starter template created by Vercel that demonstrates a full AI-powered image search pipeline. It takes an image upload as input and produces a searchable index of AI-generated descriptions plus storage metadata, surfaced through a semantic search interface. The template runs on Next.js 15 with the App Router and React 19, and its deployment path is built around Vercel's AI Cloud services: Vercel Blob Storage for images, Upstash Vector Search for indexing, Vercel Workflow for orchestration, and the Vercel AI SDK to call Grok 2 Vision.
This template targets developers who want a working reference for combining AI vision with vector search on Vercel. It suits Next.js developers learning how to structure multi-step serverless workflows with retries, teams prototyping a photo or asset search product that needs natural language queries, and open-source contributors looking for a small, readable codebase (roughly five route/step files under app/api/upload/ and a few components).
When a user uploads a file, the Next.js app sends FormData to POST /api/upload, which starts a Vercel Workflow. Step 1 uploads the image to Vercel Blob Storage and returns a URL plus metadata; Step 2 sends the blob URL to Grok 2 Vision through the Vercel AI SDK to generate a description; Step 3 indexes both the description and the blob metadata in Upstash Vector Search. The UI then runs server actions against Upstash to perform semantic queries and render matching images with their metadata.
Yes — the template itself is MIT-licensed and open source. The dependent services (Upstash Vector Search and Vercel Blob Storage) each offer a generous free tier, and the template is designed to stay within those tiers for small demo workloads. When you deploy through the Vercel marketplace, those services are provisioned automatically.
Vectr uses Grok 2 Vision from xAI, called through the Vercel AI SDK. You must provide an XAI_API_KEY in your environment variables either locally or on Vercel.
No. All indexed data is stored as vectors plus metadata in Upstash Vector Search, and the image files themselves live in Vercel Blob Storage. There is no SQL or NoSQL database in the stack.
You need Node.js 18 or newer, pnpm, and four environment variables: UPSTASH_SEARCH_URL and UPSTASH_SEARCH_TOKEN from Upstash, VERCEL_OIDC_TOKEN plus BLOB_STORE_ID for Vercel Blob (auto-injected on Vercel via vercel env pull), and XAI_API_KEY for Grok Vision. The README provides a sample .env.local template.
Each workflow step handles rate limiting with retryable errors and delayed retries: the upload step retries up to 3 times with 1-minute delays, while the description and indexing steps retry up to 5 times with 1- to 5-minute delays depending on the step. Quota-exceeded uploads and invalid files are treated as fatal errors that stop the workflow.
