A meme search engine powered by semantic search technology. This application allows you to search for memes using natural language, finding both direct text matches and semantically similar content.
memesearcher.mov
- Semantic Search: Find memes based on their semantic meaning, not just keywords
- Direct Matching: Standard text-based search is also supported
- Fast Performance: Results are cached for quick repeat searches
- Rate Limiting: Protects the API from abuse
- Next.js 15: For the frontend and API routes
- Vercel Blob: For meme image storage
- Upstash Vector: For vector embeddings storage
- Upstash Redis: For caching and rate limiting
- OpenAI Embeddings: For generating semantic embeddings
This project is based on Vercel Labs' Semantic Image Search, but with several key differences:
- Uses Upstash Vector instead of PostgreSQL/pgvector for storing embeddings
- Uses Upstash Redis for caching search results and implementing rate limiting
- Optimized for meme content rather than general images
You'll need accounts with:
Create a .env.local file with the following variables:
# OpenAI
OPENAI_API_KEY=
# Vercel Blob Storage
BLOB_READ_WRITE_TOKEN=
# Upstash Vector
UPSTASH_VECTOR_URL=
UPSTASH_VECTOR_TOKEN=
# Upstash Redis
UPSTASH_REDIS_REST_URL=
UPSTASH_REDIS_REST_TOKEN=
# Redis Cache TTL in seconds (24 hours)
REDIS_CACHE_TTL=86400
# Rate Limiting
RATE_LIMIT_REQUESTS=50
RATE_LIMIT_WINDOW=60
npm install
npm run devDeploy to Vercel with:
vercelBe sure to set up all the environment variables in your Vercel project settings.
- User enters a search query
- System checks Redis cache for existing results
- If no cache hit, the system:
- Generates embeddings from the query
- Searches for direct matches in titles and descriptions
- Performs vector similarity search for semantic matches
- Combines and deduplicates results
- Caches the results in Redis
- Results are displayed to the user