FAISS
Welcome, champion! 🔥
You've mastered 0 of 43 lessons. Start your first lesson free — no signup needed.
About this course
FAISS is an open-source library for searching large sets of vectors for the ones closest to a query. If you already turn text, images or products into embeddings, FAISS is one of the common ways to find the nearest ones quickly. This online FAISS course on Abekus teaches the Python API through short reading-card lessons, each followed by an MCQ quiz, all built on one running example: 10,000 product embeddings for an Indian online store, searched with the query "wireless earbuds".
Who this FAISS course is for
It is written for Python developers and ML or data engineers who already have embeddings from some model and now need similarity search over them, for semantic search, recommendations or retrieval for RAG. You should be comfortable with Python and NumPy arrays. No earlier FAISS experience is needed: the first lesson is a five-line nearest neighbour search with IndexFlatL2, and every later idea is added to that same script.
The course stays on the Python API with faiss-cpu. It does not teach how to train or choose an embedding model, the C++ API, building FAISS from source or GPU installation, and it does not cover vector database products such as Milvus, Pinecone or pgvector beyond one comparison of a library with a database. It gives no benchmark numbers for specific hardware.
How the lessons work
Each lesson is a short set of reading cards on one idea, usually with a few lines of Python and the output they print, followed by a quiz of multiple-choice questions. Lessons run from basics up. You start with exact search on flat indexes: the add and search calls, the distance array D and the id array I, float32 input of shape (n, d), and is_trained and ntotal. Then come ids and removal with IndexIDMap and add_with_ids, inverted file indexes with nlist, training and nprobe, product and scalar quantization, and HNSW graphs with M, efConstruction and efSearch. The last topics cover factory strings such as "IVF100,PQ16", saving and loading indexes, measuring recall@k against a flat ground truth, and choosing an index for a given size and memory budget. You go at your own pace.
The same names and numbers are used throughout. The data is always product_vecs.npy with d = 384, the query always has shape (1, 384), k is 5, and index types are written as Python classes or factory strings, so you can read every code sample against the one before it.
MCQ practice vs video courses for FAISS
Video courses on Udemy, Coursera or YouTube are a good fit if you want someone to build a full search demo on screen. This course is built for a narrower job: reading a short explanation with real code and then checking straight away whether you can predict what it does. FAISS has many settings that look alike and behave differently, such as L2 distance and inner product, nlist and nprobe, M and efSearch, or IVF-Flat and IVF-PQ, and the quickest way to find where you mix them up is to answer questions that make you choose. Many learners use both formats: a video for the overall build, and question practice for the details that decide recall and memory use.
Common FAISS mistakes
The course takes these on directly, because each one gives search results that look fine but are wrong or slow:
- Using inner product and calling it cosine similarity. Inner product equals cosine only when vectors are normalised to unit length first.
- Ignoring the dtype and shape. FAISS works in float32, and a single query must be a 2D array of shape (1, d), not a 1D vector.
- Expecting an untrained IVF or PQ index to accept vectors. These indexes need train() on a representative sample before add().
- Reading -1 in the id array as a real result. It means fewer than k results were found, for example when nprobe is too small.
- Assuming every index supports deletion. remove_ids works on some index types; HNSW does not support it.
- Trusting approximate search without measuring it. Recall@k against exact flat search is the check that shows what a setting costs.
Best way to learn FAISS
Learn it on one dataset you understand and change one setting at a time. Build a flat index first so you have exact answers, then swap in IVF, PQ or HNSW, raise and lower nprobe or efSearch, and compare recall and memory with the flat results. The last part of the course works this way: it compares flat, IVF and HNSW side by side, sets out a FAISS library against a vector database, walks through choosing an index by size and memory and choosing a metric for your embeddings, and applies the ideas to semantic product search, passage retrieval for RAG and filtered search with IDSelector.