FIRST Look at Pinecone Serverless!

James Briggs · Intermediate ·🔍 RAG & Vector Search ·2y ago

Key Takeaways

The video demonstrates the use of Pinecone Serverless, a serverless vector database, for RAG search and semantic search, showcasing its cost-effectiveness, scalability, and flexibility. It highlights the differences between Pinecone Serverless and the pod-based Pinecone, including pricing models and performance.

Full Transcript

today we're going to be taking a look at the new pine cone serverless now serus is a complete redesign of the pine invector database and it comes with much more flexibility scalability and a huge reduction in costs for the vast majority of use cases on Pine gone so just to point out the cost Savings of this I want to take a look at the pricing calculator so if I look at very typical use case right so I'm I'm on the pine cone website and I come down to they they explain everything here uh the pricing is like completely different so you're not paying for like a pod now obviously you're on serverless so there is no longer any such thing as pods but instead you're paying based on the amount that you're storing and the amount that you're querying so you have a separation between storage and queries which means means you can store a ton of stuff and you can pay very little because that's now on storage optimized Hardware rather than compute optimized Hardware so if we come down here we'll go to you know the rag use case it's probably the most most common zoom in a little bit and yeah if I go okay 02 embeddings like 5 million records is a lot for for most rag use cases honest ly I I think you're probably going to be using less but any anyway let's just leave 5 million for now queries per month so that's quite a lot 260,000 queries a month again it depends on your use case but I you know I think most of the things that I have built at least going to go nowhere near that and then rights per month so you know how many new vectors right so how many new vectors am I going to write to the database every month say 100,000 okay uh metadata size it's pretty big it depends on how you're how you're uh structuring everything and then name spaces again that's going to depend if you have a lot of different uh users for example it's a user facing app you will probably have quite a lot of name spaces but it depends right so with that it's $21 a month for this in the pod-based pine cone you'd be hitting like well you'd be hitting $70 a month now this is a large number for the majority of use cases you're probably going to be looking at like I don't know like 500,000 maybe maybe a million you know it it varies a lot right depending on your use case now in the past for 500,000 vectors on the pod-based pine cone you just have to pay for a pod like P1 or S1 and that's going to cost $70 just every month right that's how much you're paying now okay like $6 right that that's that's an insane uh cost saving if you know if you're doing less queries per month which is fairly likely for a lot of users I think it goes even lower now if we decrease the number of name Services let's say worst case scenario you just have one name space it goes up a little bit but you know it's still $10 compared to the $70 that we would have had before which is it's pretty good now that the cost savings let's take a look at how we'd actually use new Pine con serverless via the python client so I'm going to come over to the examples of pine cone and I'm just going to do we can do semantic search for now okay so semantic search uh I will open this in collab and I'll come to here now first thing I'm going to need to do is just install everything the insults are going to be slightly different by the time you see this hopefully so you should see see 3000 for the pine con client and 0.6 rather than uh this so this here for Pine con data sets so I'm installing those and then we're going to come down here and just download a data set now the reason that we're using this data set and Pyon data sets is because we already have the vectors uh created for it so we don't need to go and you know spend time creating the the embeddings so it's a lot quicker and then once that is downloaded I'm going to print out length so I've just taken a slice of the data set like 880,000 records there and yeah it's super quick okay and then we come down to here we're going to decide whether we want to use serverless or the Pod base um approach so for the you know we can do both okay so with the new python client it supports both if you want to use pods you set that defaults otherwise we go with true I'm also going to use true and then we have our API Keys environment variables so for servus we don't need the environment anymore so we can just remove that uh instead that you know there's the region uh which is basically the same thing but it just doesn't include the the cloud name uh which we have here instead so I'm going to go over to my uh P con project here I'm going to go to API keys and I'm going to take an API key okay so this doesn't need to be a serverless project right now with serverless there is not a free tier as we have with the the pod-based architecture in Pine Karen instead there is currently a like $100 that you can claim and just use servus with that and obviously if you're using that it's going to last you a pretty long time given the prices I just showed you but there is a pine cone servus coming like a free tier so that is coming it's just not quite there yet now we are going to come down to here I'm going to put in my API key here and then I'm going to come over to here so I'm not using the the Pod spec here I'm using Ser space so this is a new object we have that just defines your you basically the specification of your configuration of your index I am using serverless of course so I'm using this one and we specified cloud and the region right now the this is the only one that is currently supported as far as I'm aware so you want to use the same but of course more are coming also new you know we're going to have gcp and a sure pretty soon as well cool so run that let's create an index slightly different again here so rather than just listing the indexes we need to go through because when we list an index we get a lot more information than we used to with the old client so we just need to do this uh to return the the indexes or the index names if you do have indexes you can also use this I believe okay so after we've done that we if I run this let me run it I'm going to check if the index already exists if it doesn't I'm going to create one the uh spec here is the serverless spec that you saw before and then we come down to here and we would just going to have a look okay is the index being created uh once it has been we're going to describe it I I literally just created mine um so this now shows us being having some vectors in there uh you should see Zero if this is your first time running through the notebook then what I'm going to do is run this so I'm going to just upsert all of my vectors that will take a moment to run now while that is running let's have a look at let's have a look at how much money we'd be saving on this compared to the Pod based approach so we have is it like 80,000 vectors I think so we can do 880,000 vectors uh let's say I'm going to get be this so you can say I'm going to get 100,000 queries a month which I don't think I will and let's say I'm going to write another 20 V 20,000 vectors A month I'm going to have one name space on this so it's worst case scenario and my Vector dimensionality is actually I think it's 384 yeah 384 so that's going to cost me a grand total of $369 a month which is not too bad and even better when you consider we have like a a $100 uh credit so that's not bad now I'll fast forward to when our upload is complete okay so that has finished and we can go ahead and just make a query okay let see what we get should get basically the same resources what we what we've had before with the the Pod base approach so as you can say which city is the highest population in the world we're just doing a semantic search here so we're going to just see the results that we get uh let's see okay it says I think I format it a little nicer here yeah what was l City biggest city so on and so on okay so these are quar questions that we're we're searching across here and then I can modify the the language of it I can say which metrop Metropolis is the highest number of people and just see what it says and yeah again we get what is the biggest city and then what is largest city so yeah sematic search everything checks out there so I mean that all looks good once you're finished with that we just want to save resources and just delete that index so we do that and we're now done so that's it's a very fast introduction to Pine servess it's very exciting it's going to save people a ton of money it is is going to make Vector search a lot more scalable accessible and we're going to see a lot of really cool performance upgrades so for now I'm going to leave it there I hope all this has been interesting and useful so thank you very much for watching and I will see you again in the next one bye

Original Description

Here we take a first look at the new Pinecone serverless, a complete rebuild of the Pinecone vector database optimized for real-world requirements, focusing on cost, latency, and recall performance. Here, we take a look at serverless and how to use it for RAG, semantic search, or other AI applications via the Pinecone Python client. 📌 Code: https://github.com/pinecone-io/examples/blob/master/docs/semantic-search.ipynb 🌲 Subscribe for Latest Articles and Videos: https://www.pinecone.io/newsletter-signup/ 👾 Discord: https://discord.gg/c5QtDB9RAP Twitter: https://twitter.com/jamescalam LinkedIn: https://www.linkedin.com/in/jamescalam/
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from James Briggs · James Briggs · 0 of 60

← Previous Next →
1 Stoic Philosophy Text Generation with TensorFlow
Stoic Philosophy Text Generation with TensorFlow
James Briggs
2 How to Build TensorFlow Pipelines with tf.data.Dataset
How to Build TensorFlow Pipelines with tf.data.Dataset
James Briggs
3 Every New Feature in Python 3.10.0a2
Every New Feature in Python 3.10.0a2
James Briggs
4 How-to Build a Transformer for Language Classification in TensorFlow
How-to Build a Transformer for Language Classification in TensorFlow
James Briggs
5 How-to use the Kaggle API in Python
How-to use the Kaggle API in Python
James Briggs
6 Language Generation with OpenAI's GPT-2 in Python
Language Generation with OpenAI's GPT-2 in Python
James Briggs
7 Text Summarization with Google AI's T5 in Python
Text Summarization with Google AI's T5 in Python
James Briggs
8 How-to do Sentiment Analysis with Flair in Python
How-to do Sentiment Analysis with Flair in Python
James Briggs
9 Python Environment Setup for Machine Learning
Python Environment Setup for Machine Learning
James Briggs
10 Sequential Model - TensorFlow Essentials #1
Sequential Model - TensorFlow Essentials #1
James Briggs
11 Functional API - TensorFlow Essentials #2
Functional API - TensorFlow Essentials #2
James Briggs
12 Training Parameters - TensorFlow Essentials #3
Training Parameters - TensorFlow Essentials #3
James Briggs
13 Input Data Pipelines - TensorFlow Essentials #4
Input Data Pipelines - TensorFlow Essentials #4
James Briggs
14 6 of Python's Newest and Best Features (3.7-3.9)
6 of Python's Newest and Best Features (3.7-3.9)
James Briggs
15 Novice to Advanced RegEx in Less-than 30 Minutes + Python
Novice to Advanced RegEx in Less-than 30 Minutes + Python
James Briggs
16 Building a PlotLy $GME Chart in Python
Building a PlotLy $GME Chart in Python
James Briggs
17 How-to Use The Reddit API in Python
How-to Use The Reddit API in Python
James Briggs
18 How to Build Custom Q&A Transformer Models in Python
How to Build Custom Q&A Transformer Models in Python
James Briggs
19 How to Build Q&A Models in Python (Transformers)
How to Build Q&A Models in Python (Transformers)
James Briggs
20 How-to Decode Outputs From NLP Models (Python)
How-to Decode Outputs From NLP Models (Python)
James Briggs
21 Identify Stocks on Reddit with SpaCy (NER in Python)
Identify Stocks on Reddit with SpaCy (NER in Python)
James Briggs
22 Sentiment Analysis on ANY Length of Text With Transformers (Python)
Sentiment Analysis on ANY Length of Text With Transformers (Python)
James Briggs
23 Unicode Normalization for NLP in Python
Unicode Normalization for NLP in Python
James Briggs
24 The NEW Match-Case Statement in Python 3.10
The NEW Match-Case Statement in Python 3.10
James Briggs
25 Multi-Class Language Classification With BERT in TensorFlow
Multi-Class Language Classification With BERT in TensorFlow
James Briggs
26 How to Build Python Packages for Pip
How to Build Python Packages for Pip
James Briggs
27 How-to Structure a Q&A ML App
How-to Structure a Q&A ML App
James Briggs
28 How to Index Q&A Data With Haystack and Elasticsearch
How to Index Q&A Data With Haystack and Elasticsearch
James Briggs
29 Q&A Document Retrieval With DPR
Q&A Document Retrieval With DPR
James Briggs
30 How to Use Type Annotations in Python
How to Use Type Annotations in Python
James Briggs
31 Extractive Q&A With Haystack and FastAPI in Python
Extractive Q&A With Haystack and FastAPI in Python
James Briggs
32 Sentence Similarity With Sentence-Transformers in Python
Sentence Similarity With Sentence-Transformers in Python
James Briggs
33 Sentence Similarity With Transformers and PyTorch (Python)
Sentence Similarity With Transformers and PyTorch (Python)
James Briggs
34 NER With Transformers and spaCy (Python)
NER With Transformers and spaCy (Python)
James Briggs
35 Training BERT #1 - Masked-Language Modeling (MLM)
Training BERT #1 - Masked-Language Modeling (MLM)
James Briggs
36 Training BERT #2 - Train With Masked-Language Modeling (MLM)
Training BERT #2 - Train With Masked-Language Modeling (MLM)
James Briggs
37 Training BERT #3 - Next Sentence Prediction (NSP)
Training BERT #3 - Next Sentence Prediction (NSP)
James Briggs
38 Training BERT #4 - Train With Next Sentence Prediction (NSP)
Training BERT #4 - Train With Next Sentence Prediction (NSP)
James Briggs
39 FREE 11 Hour NLP Transformers Course (Next 3 Days Only)
FREE 11 Hour NLP Transformers Course (Next 3 Days Only)
James Briggs
40 New Features in Python 3.10
New Features in Python 3.10
James Briggs
41 Training BERT #5 - Training With BertForPretraining
Training BERT #5 - Training With BertForPretraining
James Briggs
42 How-to Use HuggingFace's Datasets - Transformers From Scratch #1
How-to Use HuggingFace's Datasets - Transformers From Scratch #1
James Briggs
43 Build a Custom Transformer Tokenizer - Transformers From Scratch #2
Build a Custom Transformer Tokenizer - Transformers From Scratch #2
James Briggs
44 3 Traditional Methods for Similarity Search (Jaccard, w-shingling, Levenshtein)
3 Traditional Methods for Similarity Search (Jaccard, w-shingling, Levenshtein)
James Briggs
45 3 Vector-based Methods for Similarity Search (TF-IDF, BM25, SBERT)
3 Vector-based Methods for Similarity Search (TF-IDF, BM25, SBERT)
James Briggs
46 Building MLM Training Input Pipeline - Transformers From Scratch #3
Building MLM Training Input Pipeline - Transformers From Scratch #3
James Briggs
47 Training and Testing an Italian BERT - Transformers From Scratch #4
Training and Testing an Italian BERT - Transformers From Scratch #4
James Briggs
48 Faiss - Introduction to Similarity Search
Faiss - Introduction to Similarity Search
James Briggs
49 Angular App Setup With Material - Stoic Q&A #5
Angular App Setup With Material - Stoic Q&A #5
James Briggs
50 Why are there so many Tokenization methods in HF Transformers?
Why are there so many Tokenization methods in HF Transformers?
James Briggs
51 Choosing Indexes for Similarity Search (Faiss in Python)
Choosing Indexes for Similarity Search (Faiss in Python)
James Briggs
52 Locality Sensitive Hashing (LSH) for Search with Shingling + MinHashing (Python)
Locality Sensitive Hashing (LSH) for Search with Shingling + MinHashing (Python)
James Briggs
53 How LSH Random Projection works in search (+Python)
How LSH Random Projection works in search (+Python)
James Briggs
54 IndexLSH for Fast Similarity Search in Faiss
IndexLSH for Fast Similarity Search in Faiss
James Briggs
55 Faiss - Vector Compression with PQ and IVFPQ (in Python)
Faiss - Vector Compression with PQ and IVFPQ (in Python)
James Briggs
56 Product Quantization for Vector Similarity Search (+ Python)
Product Quantization for Vector Similarity Search (+ Python)
James Briggs
57 How to Build a Bert WordPiece Tokenizer in Python and HuggingFace
How to Build a Bert WordPiece Tokenizer in Python and HuggingFace
James Briggs
58 Metadata Filtering for Vector Search + Latest Filter Tech
Metadata Filtering for Vector Search + Latest Filter Tech
James Briggs
59 Build NLP Pipelines with HuggingFace Datasets
Build NLP Pipelines with HuggingFace Datasets
James Briggs
60 Composite Indexes and the Faiss Index Factory
Composite Indexes and the Faiss Index Factory
James Briggs

This video teaches how to use Pinecone Serverless for RAG search and semantic search, highlighting its cost-effectiveness, scalability, and flexibility. It showcases the differences between Pinecone Serverless and the pod-based Pinecone, including pricing models and performance. By following this video, viewers can learn how to build and optimize a vector database, implement RAG search, and evaluate the performance of different approaches.

Key Takeaways
  1. Install the Pinecone client and PRESI library
  2. Download a data set from Pyon data sets
  3. Create an index with serverless spec and cloud and region
  4. Upsert vectors in Pinecone Serverless
  5. Make a query on Pinecone Serverless
  6. Compare costs of Pinecone Serverless and Pod-based approach
  7. Delete index to save resources
💡 Pinecone Serverless offers a cost-effective, scalable, and flexible solution for RAG search and semantic search, with a significant cost savings compared to the pod-based Pinecone.

Related Reads

Up next
This FREE Tool Turns ANY PDF into Perfect Markdown (MinerU Live Test)
Prompt Engineer
Watch →