Skip to main content
SAMPLE APP

Multimodal search

Multimodal search across text, images, and videos
Shop The Look is a multimodal search app for finding outfit inspiration. You can search with text, an image, or a video, and the app recommends matching outfits. It’s built with Pinecone Database, Google Cloud Vertex AI’s multimodal embedding model, and images and videos from Pexels.

Built with

  • Pinecone Database
  • Google Cloud Vertex AI multimodal embedding model
  • Next.js and Tailwind CSS
  • Vercel
  • Node.js

Run the sample app

To run Shop The Look in demo mode, use the create-pinecone-app CLI:
Terminal
Demo mode runs the frontend locally and connects it to a backend API that Pinecone hosts. The hosted backend already has a Pinecone index, Google Cloud Vertex AI, and more than 45,000 royalty-free images and videos set up, so you don’t need your own backend services or assets.

Full deployment

To customize Shop The Look with your own images and videos, deploy both the frontend and the backend. The backend uses Pinecone Database, Google Cloud Vertex AI, and Google Cloud Storage.The following steps are a summary. For complete instructions, see Full deployment in the Shop The Look README.
1

Get your Pinecone API key

You need an API key to make calls to your Pinecone project:
Then copy your generated key:
.env.development
You can also copy an existing key from the API keys page in the Pinecone console.
2

Get your Google Cloud credentials

The following steps are a summary. For complete instructions, see Google Cloud setup in the Shop The Look README.
  1. If you don’t have a Google Cloud account, create one.
  2. In the Google Cloud console, create a project.
  3. Enable the Vertex AI API and the Cloud Storage API.
  4. Create a service account with the Vertex AI User and Storage Object Viewer roles.
  5. Generate a JSON key for the service account and download it.
3

Create a Pinecone index

Create a serverless index that stores dense vectors, with the following settings:
  • Dimension: 1408
  • Metric: cosine
  • Region: A region of your choice
You can create the index in the Pinecone console or with the API. For more information, see Create an index.
4

Install dependencies

The app requires Node.js 14 or later. From the project root directory, install the dependencies:
Terminal
5

Set environment variables

In .env.development, set your Google Cloud and Pinecone values:
.env.development
6

Start the app

Start the development server:
Terminal

Project structure

Shop The Look architecture: a Next.js frontend calls a FastAPI backend, which generates embeddings with Vertex AI and searches PineconeShop The Look has three parts:
  • Frontend: A Next.js app with Tailwind CSS and custom React components. Its API routes call the backend to generate embeddings and run searches.
  • Backend: A FastAPI server in Python that processes images and videos, generates embeddings, and runs Pinecone operations.
  • Utility scripts: Scripts that read a folder of images and videos from Google Cloud Storage, generate embeddings with Vertex AI, and upsert them to a Pinecone index.

How it works

The following pseudocode shows how the main parts of Shop The Look work together.

Store embeddings in Pinecone

Pinecone stores the multimodal embeddings that Vertex AI generates for each image and video:
Python

Generate embeddings with Vertex AI

Vertex AI’s multimodal embedding model generates embeddings for text, images, and videos:
Python
When a user searches, the backend sends the query (text, an image, or a video) to the multimodal embedding model to convert it into an embedding:
Python
The backend then uses the embedding to run a similarity search in Pinecone:
Python
The frontend displays the results in page.tsx.

Troubleshooting

If you run into problems, see Troubleshooting in the Shop The Look README. If that doesn’t solve it, open an issue in the sample apps repository or ask in the Pinecone Discord community.