# pgvector > Open-source vector similarity search for PostgreSQL. pgvector is a Postgres > extension, not a service: it adds vector data types, distance operators and two > approximate-nearest-neighbour index access methods to a database you already run. > There is no HTTP API, no endpoint, no API key and no hosted offering. You reach it > with SQL over an ordinary Postgres connection. Generated by API Evangelist on 2026-08-27 from the project's own public material. This is not published by pgvector. Method: generated. Source: https://github.com/pgvector/pgvector ## What it is - Extension name: `vector`. Install with `CREATE EXTENSION vector;` - Current version: 0.8.6, released 2026-07-29. Requires PostgreSQL 13+. - License: PostgreSQL License. Free. No paid tier, no commercial edition. - Maintainer: Andrew Kane. Home: https://github.com/pgvector/pgvector - The project operates no domain. pgvector.dev is a third-party redirect, not theirs. ## How to call it There is no request to make. The canonical query is: ```sql CREATE EXTENSION vector; CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3)); INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]'); SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5; ``` The index is only used when `ORDER BY` is a bare distance operator in ascending order and a `LIMIT` is present. Wrapping the operator in an expression defeats it. ## Types - `vector` — single-precision, up to 16,000 dims, `4 * dims + 8` bytes - `halfvec` — half-precision, up to 16,000 dims, `2 * dims + 8` bytes (0.7.0+) - `sparsevec` — up to 16,000 non-zero elements, `8 * nnz + 16` bytes (0.7.0+) - `bit` — Postgres' own type, given binary distance operators by pgvector (0.7.0+) All elements must be finite. NaN and Infinity are rejected at input time. ## Distance operators - `<->` Euclidean (L2) · `<#>` negative inner product · `<=>` cosine · `<+>` taxicab (L1) - `<~>` Hamming and `<%>` Jaccard, for `bit` ## Indexes - `hnsw` — graph index. Build: `m` (16), `ef_construction` (64). Query: `hnsw.ef_search` (40), `hnsw.iterative_scan`, `hnsw.max_scan_tuples` (20000), `hnsw.scan_mem_multiplier` (1) - `ivfflat` — inverted list index. Build: `lists`. Query: `ivfflat.probes` (1), `ivfflat.iterative_scan`, `ivfflat.max_probes` (100) Index dimension ceilings are lower than type ceilings: `vector` and `halfvec` index to 2,000 and 4,000, `bit` to 64,000, `sparsevec` to 1,000 non-zero elements under HNSW. Set query options with `SET LOCAL` inside a transaction so they scope to one query. ## Things that fail silently - Fewer than k results after adding an index is normal, not a bug: results are capped by `hnsw.ef_search` or `ivfflat.probes`. Enable iterative index scans (0.8.0+). - NULL vectors — and zero vectors under cosine distance — are not indexed. - A `WHERE` clause is applied after the index returns candidates, so filtering can return fewer rows than asked for. ## Client libraries First-party, one per language, all under github.com/pgvector. They encode and decode the vector types for your existing Postgres driver; they do not connect on their own. - Python `pgvector` 0.5.0 · JavaScript/TypeScript `pgvector` 0.3.0 · Ruby `pgvector` 0.3.3 - Rust `pgvector` 0.4.2 · Go `pgvector-go` v0.4.1 · PHP `pgvector/pgvector` v0.2.2 - .NET `Pgvector` 0.3.2 · Java `com.pgvector:pgvector` 0.1.6 · Elixir `pgvector` 0.4.0 - Dart, Haskell, Nim, Julia, C++, Swift, Lua also published. 19 further repositories are example code only, with no package. Full detail with versions and publication dates: packages/pgvector-packages.yml ## Reference - Documentation and reference: https://github.com/pgvector/pgvector#readme - Contract (the extension DDL): https://raw.githubusercontent.com/pgvector/pgvector/master/sql/vector.sql - Changelog: https://github.com/pgvector/pgvector/blob/master/CHANGELOG.md - Issues: https://github.com/pgvector/pgvector/issues - Organization: https://github.com/pgvector ## What does not exist Stated so an agent stops looking: no OpenAPI, no GraphQL, no gRPC, no AsyncAPI, no webhooks, no MCP server, no agent card, no /.well-known/ documents, no status page, no SLA, no rate limits, no pricing page, no SECURITY.md. Several of those are inapplicable to a database extension. The missing SECURITY.md is not — it is a real gap.