Approximate index (HNSW, IVFFlat)

An approximate vector index, such as HNSW or IVFFlat, speeds up nearest-neighbor search in exchange for a sometimes approximate result. HNSW uses a navigable graph, IVFFlat uses clusters; the settings trade off speed, memory, and recall.

Example

CREATE INDEX ON chunks USING hnsw (embedding vector_cosine_ops);

Related concepts

The whole glossary