HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
facebookresearch
faiss
C++2017–2026
facebookresearch / faiss

faiss

A library for efficient similarity search and clustering of dense vectors.

45Distinct people
53Mentions
1Explicit recommenders
41.6KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

A library for efficient similarity search and clustering of dense vectors.

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

This tutorial is very complex. Here's how to get free semantic search with much less complexity: 1. Install sentence-transformers [1] 2. Initialize the MiniLM model - `model =…

vikp used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 9–Nov 16 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/16/2026, 5:58:53 AM UTC.

E-means: Outperforming k-means in one-tenth the epochs direct repository linkDebated

The author defends e-means as a superior, drop-in replacement for Lloyd's algorithm that uses scaling laws to automatically tune hyperparameters and escape local minima faster. Critics argue the method relies on known techniques like exponential moving averages and mini-batches without sufficient novelty or rigorous comparison against well-tuned baselines like scikit-learn's implementation.

81 readable replies · Supporting reply 1 · Supporting reply 2 · Supporting reply 3 · Supporting reply 4

Mentions over time

HN mentions by year53 dated mentions

Observed mentions: 2017-03-02 20:35:13 UTC to 2026-04-10 23:12:49 UTC.

051015202017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments20172018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 comments2020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments20212022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 20 mentions; 1 submissions, 19 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 2 submissions, 0 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC211
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC303
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC505
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC817
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC303
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC20119
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC817
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC220

What Hacker News says

20 sources
If you want to experiment with vector stores, you can do that locally with something like faiss which has good multiplatform support and sufficient tutorials: https://github.com/facebookresearch/faiss Doing full retrieval-augmented generation (RAG) and getting LLMs to interpret the results has more steps but you get a lot of flexibility, and despite what AI influencers say there's no standard best-practice. When you query a vector DB you get the most similar texts back (or an index integer in the case of faiss), you then feed those result to an LLM like a normal prompt, which can be optimized with prompt engineering. The codifer for the RAG workflow is LangChain, but their demo is substantially more complex and harder-to-use than even a homegrown implementation: https://minimaxir.com/2023/07/langchain-problem/
In Approximate Nearest Neighbor Oh Yeah (Annoy)
Indexes for vector databases in high dimensions are nowhere near are effective as the 2-d indexes used in GIS or the 1-d B-tree indexes that are commonly used in databases. Back around 2005 I was interested in similarity search and read a lot of conference proceedings on the top and was basically depressed at the state of vector database indexes and felt that at least for the systems I was prototyping I was OK with a full scan and later in 2013 I had the assignment of getting a search engine for patents using vector embeddings in front of customers and we got performance we found acceptable with full scan. My impression today is that the scene is not too different than it was in 2005 but I can't say I haven't missed anything. That is, you have tradeoffs between faster algorithms that miss some results and slower algorithms that are more
Read the rest
correct. Somebody might feel the glass is half full somebody else might feel it is half empty, I can really see it either way. I think it's already a competitive business. You have Pinecone which had the good fortune of starting before the gold rush. Many established databases are adding vector extension. I know so many engineering managers who love postgresql and they're just going to load a vector extension and go. My RSS reader YOShInOn uses SBERT embeddings to cluster and classify text and certainly More Like This and semantic search are on the agenda, I'd expect it to take about an hour to get https://github.com/facebookresearch/faiss up and working, I could spend more time stuck on some "little" front end problem like getting something to look right in Bootstrap than it would take to get working. I can totally believe somebody could make a better vector db than what's out there but will it be better enough? A startup going through YC now could spend 2-3 to get a really good product and find customers and that is forever in a world where everybody wants to build AI applications right now.
In Ask HN: Are there any unsolved problems with vector databases
vikp·Jul 12, 2023Recommendation phrase
This tutorial is very complex. Here's how to get free semantic search with much less complexity: 1. Install sentence-transformers [1] 2. Initialize the MiniLM model - `model = SentenceTransformer('all-MiniLM-L6-v2')` 3. Embed your corpus [2] 4. Embed your queries, then search the corpus This runs on CPU (~750 sentences per second), and GPU (18k sentences per second). You can use paragraphs instead of sentences if you need more text. The embeddings are accurate [3] and only 384 dimensions, so they're space-efficient [4]. Here's how to handle persistence. I recommend starting with the simplest strategy, and only getting more complex if you need higher performance: - Just save the embedding tensors to disk, and load them if you need them later. - Use Faiss to store the embeddings (it will use an index to retrieve them faster)
Read the rest
[5] - Use pgvector, an extension for postgres that stores embeddings - If you really need it, use something like qdrant/weaviate/pinecone, etc. This setup is much simpler and cheaper than using a ton of cloud services to do embeddings. I don't know why people make semantic search so complex. I've used it for https://www.endless.academy, and https://www.dataquest.io and it's worked well in production. [1] https://www.sbert.net/ [2] https://www.sbert.net/examples/applications/semantic-search/... [3] https://huggingface.co/blog/mteb [4] https://medium.com/@nils_reimers/openai-gpt-3-text-embedding... [5] https://github.com/facebookresearch/faiss
In Serverless Semantic Search, Free tier only
SCaNN (the paper) is roughly two different things: 1. a SIMD-optimized form of product quantization (PQ), where code to distance lookup can be performed in SIMD registers 2. anisotropic quantization to bias the database towards returning better maximum inner product search (MIPS) candidates, versus usual quantization (such as PQ) that aims to minimize compressed vector reconstruction error. In MIPS it is much more likely that the query data set may be of a completely different distribution than the database vectors. If your application needs L2 lookup rather than MIPS which does not admit a metric, then only the PQ part is relevant. For cosine similarity, you can get that by normalizing all vectors to the surface of a hypersphere, in which case it has the same order as L2 (see "L2 normalized Euclidean distance" on https://en.wikipedia.org
Read the rest
/wiki/Cosine_similarity ). SCaNN is implemented in Faiss CPU, on the GPU the fast PQ part is less relevant due to the greater register set size and throughput (rather than latency) optimized nature of the hardware, but the GPU version is more geared towards batch lookup in any case. https://github.com/facebookresearch/faiss/wiki/Fast-accumula... https://github.com/facebookresearch/faiss/wiki/Indexing-1M-v... We have not found the anisotropic quantization part to be that useful for large datasets, but results may vary. Graph-based ANN techniques tend to be better in many cases for these small datasets than IVF based strategies. (I'm the author of GPU Faiss)
In Billion-Scale Approximate Nearest Neighbor Search [pdf]
With 4B vectors, you can look at methods like quantization and compression, both detailed here for Faiss - https://github.com/facebookresearch/faiss/wiki/Indexing-1G-v... Elasticsearch uses HNSW, not sure what options they have but quantization/compression will help reduce disk storage requirements. Alternatively, you can look at dimensionality reduction algorithms and only store that output in ES. Or pick a model with a small number of dimensions. For example https://huggingface.co/sentence-transformers/all-MiniLM-L6-v... only has 384 dims vs 768/1024/2048/4096.
In What is a Vector Database? (2021)
Thanks for following up on this. We designed EVA from scratch for managing unstructured data (e.g., video, audio, images, etc.). EVA leverages relational database systems to manage structured data and widely-used libraries to manage feature embeddings (FAISS library [1]). We aim to leverage decades of experience in relational database systems and reduce risk in production deployment. [1] https://github.com/facebookresearch/faiss
In Show HN: EVA – AI-Relational Database System

Showing the 15 most recent of 20 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.