Pinecone is a vector database service that handles the storage and search of complex data. With Pinecone, you can use machine-learning models for content recommendation systems, personalized search, image recognition, and more. The Vercel Pinecone integration allows you to deploy your models to Vercel and use them in your applications.
A vector database is a database that stores and searches for vectors. In this context, a vector represents a data point mathematically, often termed as an embedding.
An embedding is data that's converted to an array of numbers (a vector). The combination of the numbers that make up the vector form a multi-dimensional map used in comparison to other vectors to determine similarity.
Take the below example of two vectors, one for an image of a cat and one for an image of a dog. In the cat's vector, the first element is
0.1, and in the dog's vector
0.2. This similarity and difference in values illustrate how vector comparison works. The closer the values are to each other, the more similar the vectors are.
// Example of a vector for an image of a cat
[0.1, 0.2, 0.3, 0.4, 0.5];
// Example of a vector for an image of a dog
[(0.2, 0.3, 0.4, 0.5, 0.6)];
You can use the Vercel and Pinecone integration to power a variety of AI applications, including:
- Personalized search: Use Pinecone's vector database to provide personalized search results. By analyzing user behavior and preferences as vectors, search engines can suggest results that are likely to interest the user
- Image and video retrieval: Use Pinecone's vector database in image and video retrieval systems. They can quickly find images or videos similar to a given input by comparing embeddings that represent visual content
- Recommendation systems: Use Pinecone's vector database in e-commerce apps and streaming services to help power recommendation systems. By analyzing user behavior, preferences, and item characteristics as vectors, these systems can suggest products, movies, or articles that are likely to interest the user
The Vercel Pinecone integration can be accessed through the AI tab on your Vercel dashboard.
To follow this guide, you'll need the following:
- Navigate to the AI tab in your Vercel dashboard
- Select Pinecone from the list of providers, and press Add
- Review the provider information, and press Add Provider
- You can now select which projects the provider will have access to. You can choose from All Projects or Specific Projects
- If you select Specific Projects, you'll be prompted to select the projects you want to connect to the provider. The list will display projects associated with your scoped team
- Multiple projects can be selected during this step
- Select the Connect to Project button
- You'll be redirected to the provider's website to complete the connection process
- Once the connection is complete, you'll be redirected back to the Vercel dashboard, and the provider integration dashboard page. From here you can manage your provider settings, view usage, and more
- Pull the environment variables into your project using Vercel CLI
vercel env pull .env.development.local
- Install the providers package
pnpm i @pinecone-database/pinecone
- Connect your project using the code below:
- Add the provider to your page using the code below:
You can deploy a template to Vercel that includes a pre-trained model and a sample application that uses the model: