When I first started exploring question-answering on PDFs, one thing confused me:
๐ Why do we use Sentence-BERT and FAISS together?
Canโt FAISS just create embeddings on its own?
Hereโs the simple breakdown ๐
๐น Sentence-BERT
Itโs a neural network model.
Converts text into embeddings (vectors of numbers).
These vectors capture the meaning of the text.
Example: โdogโ and โpuppyโ โ end up with vectors close to each other.
๐น FAISS (Facebook AI Similarity Search)
It doesnโt create embeddings.
Instead, itโs an efficient search engine for vectors.
Given a query vector, it finds the nearest neighbors (most similar chunks of text) super fast.
๐ Think of it like this:
Sentence-BERT = Translator (text โ coordinates on a โmap of meaningโ)
FAISS = GPS (finds the closest points on that map in milliseconds)
๐ก Together, they make semantic search possible:
Sentence-BERT gives us the โlanguage of meaningโ (embeddings)
FAISS makes searching through thousands or millions of embeddings lightning fast
Without Sentence-BERT โ FAISS has nothing meaningful to compare.
Without FAISS โ you can still compare embeddings, but itโs painfully slow at scale.
Top comments (0)