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