AI engineering glossary · RAG vector search
What is HNSW M (m parameter)?
M parameter (also called HNSW M): In HNSW, the maximum number of links each node keeps to its neighbours. Larger values build a denser graph that improves recall and robustness but increases memory use and index build time.
M parameter: an example
Raising M from 16 to 32 increases graph memory roughly proportionally and improves recall at a given search effort.
Related terms
More RAG vector search terms
- Maximal marginal relevance
- Metadata filtering
- Multi-hop retrieval
- Multi-query retrieval
- Multi-tenancy
- Multi-vector retrieval
- Multimodal retrieval
- Nearest neighbour search
Where you learn it
M parameter is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.