New Project
A free, open-source template for building natural language image search on the AI Cloud.

Vectr is an AI-powered image search application template that automatically generates descriptions for uploaded images and indexes them for semantic search.
When you upload an image, Vectr automatically:
Loading diagram...
Each step in the image processing workflow is isolated and runs on a separate serverless function with automatic retries:
Step 1: Upload Image (upload-image.ts)
Step 2: Generate Description (generate-description.ts)
Step 3: Index Image (index-image.ts)
Vectr uses sophisticated error handling to ensure reliable processing:
The easiest way to deploy Vectr is using the Vercel Marketplace:
During deployment, you'll be prompted to set up:
Both services have generous free tiers and will be automatically configured. No database needed!
git clone https://github.com/your-username/vectr.gitcd vectr
pnpm install
Create a .env.local file with:
# Upstash SearchUPSTASH_SEARCH_URL="https://..."UPSTASH_SEARCH_TOKEN="..."# Vercel BlobBLOB_READ_WRITE_TOKEN="..."# AI Gateway Key (only needed locally)AI_GATEWAY_API_KEY="..."
pnpm dev
Open http://localhost:3000 to see your app.
pnpm dev - Start development server with Turbopackpnpm build - Build for productionpnpm check - Run linting checkspnpm format - Format code with Biomevectr/āāā app/ā āāā actions/ā ā āāā search.ts # Server action for searchā āāā api/ā ā āāā upload/ā ā āāā route.ts # Workflow route handlerā ā āāā upload-image.ts # Step 1: Upload to Blobā ā āāā generate-description.ts # Step 2: AI descriptionā ā āāā index-image.ts # Step 3: Index with metadataā āāā layout.tsxā āāā page.tsxāāā components/ā āāā header.tsxā āāā results.tsxā āāā upload-button.tsxā āāā uploaded-images-provider.tsxāāā lib/ā āāā utils.tsāāā package.json
| Variable | Description | Required |
|---|---|---|
UPSTASH_SEARCH_URL | Upstash Vector Search endpoint | Yes |
UPSTASH_SEARCH_TOKEN | Upstash authentication token | Yes |
BLOB_READ_WRITE_TOKEN | Vercel Blob Storage token | Yes |
XAI_API_KEY | xAI API key for Grok Vision | Yes |
Vectr includes comprehensive logging for monitoring and debugging:
[WORKFLOW] - Workflow-level events and timing[stepId] - Step-level events with unique identifiers[API] - HTTP request/response loggingAll logs include timestamps, attempt counts, and duration metrics.
Contributions are welcome! Please feel free to submit a Pull Request. Our Contributing Guide [blocked] has more information on how to get started.
MIT