{"data":{"slug":"pgvector-pgvector","name":"pgvector","tagline":"Open-source vector similarity search for Postgres","github_url":"https://github.com/pgvector/pgvector","owner":"pgvector","repo":"pgvector","owner_avatar_url":"https://avatars.githubusercontent.com/u/98363230?v=4","primary_language":"C","stars":23049,"forks":1325,"topics":["approximate-nearest-neighbor-search","nearest-neighbor-search"],"archived":false,"github_pushed_at":"2026-09-10T13:49:14+00:00","maintenance_label":"Active","stars_delta_30d":674,"url":"https://www.graphcanon.com/tools/pgvector-pgvector","markdown_url":"https://www.graphcanon.com/tools/pgvector-pgvector.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/pgvector-pgvector","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=pgvector-pgvector","description":"Open-source vector similarity search for Postgres","homepage_url":null,"license":"Other","open_issues":16,"watchers":142,"ai_summary":"pgvector is an extension for PostgreSQL that enables efficient vector similarity search using various distance metrics including L2, inner product, cosine distance, and L1 distance.","readme_excerpt":"## Getting Started\n\nEnable the extension (do this once in each database where you want to use it)\n\n```tsql\nCREATE EXTENSION vector;\n```\n\nCreate a vector column with 3 dimensions\n\n```sql\nCREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));\n```\n\nInsert vectors\n\n```sql\nINSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');\n```\n\nGet the nearest neighbors by L2 distance\n\n```sql\nSELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;\n```\n\nAlso supports inner product (`<#>`), cosine distance (`<=>`), and L1 distance (`<+>`)\n\nNote: `<#>` returns the negative inner product since Postgres only supports `ASC` order index scans on operators\n\n---\n\n### Docker\n\nGet the [Docker image](https://hub.docker.com/r/pgvector/pgvector) with:\n\n```sh\ndocker pull pgvector/pgvector:pg18-trixie\n```\n\nThis adds pgvector to the [Postgres image](https://hub.docker.com/_/postgres) (replace `18` with your Postgres server version, and run it the same way).\n\nSupported tags are:\n\n- `pg18-trixie`, `0.8.6-pg18-trixie`\n- `pg18-bookworm`, `0.8.6-pg18-bookworm`, `pg18`, `0.8.6-pg18`\n- `pg17-trixie`, `0.8.6-pg17-trixie`\n- `pg17-bookworm`, `0.8.6-pg17-bookworm`, `pg17`, `0.8.6-pg17`\n- `pg16-trixie`, `0.8.6-pg16-trixie`\n- `pg16-bookworm`, `0.8.6-pg16-bookworm`, `pg16`, `0.8.6-pg16`\n- `pg15-trixie`, `0.8.6-pg15-trixie`\n- `pg15-bookworm`, `0.8.6-pg15-bookworm`, `pg15`, `0.8.6-pg15`\n- `pg14-trixie`, `0.8.6-pg14-trixie`\n- `pg14-bookworm`, `0.8.6-pg14-bookworm`, `pg14`, `0.8.6-pg14`\n- `pg13-trixie`, `0.8.6-pg13-trixie`\n- `pg13-bookworm`, `0.8.6-pg13-bookworm`, `pg13`, `0.8.6-pg13`\n\nYou can also build the image manually:\n\n```sh\ngit clone --branch v0.8.6 https://github.com/pgvector/pgvector.git\ncd pgvector\ndocker build --pull --build-arg PG_MAJOR=18 -t myuser/pgvector .\n```\n\nIf you increase `maintenance_work_mem`, make sure `--shm-size` is at least that size to avoid an error with parallel HNSW index builds.\n\n```sh\ndocker run --shm-size=1g ...\n```","github_created_at":"2021-04-20T21:13:52+00:00","created_at":"2026-07-07T15:08:21.210201+00:00","updated_at":"2026-09-20T04:28:25.538003+00:00","categories":[{"slug":"vector-databases","name":"Vector Databases","url":"https://www.graphcanon.com/categories/vector-databases","markdown_url":"https://www.graphcanon.com/categories/vector-databases.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/vector-databases"}],"tags":[{"slug":"approximate-nearest-neighbor-search","name":"approximate-nearest-neighbor-search"},{"slug":"c-language","name":"c-language"},{"slug":"docker-support","name":"docker-support"},{"slug":"l2-distance","name":"l2-distance"},{"slug":"nearest-neighbor-search","name":"nearest-neighbor-search"},{"slug":"open-source","name":"open-source"},{"slug":"postgres-extension","name":"postgres-extension"},{"slug":"vector-similarity-search","name":"vector-similarity-search"}],"trust":{"provenance":{"is_fork":false,"github_id":359952601,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-18T08:06:16.146Z","maintenance":{"label":"Active","score":82,"methodology":"github_public_v1","releases_90d":0,"days_since_push":7,"last_release_at":null,"stars_delta_30d":674,"open_issues_delta_30d":2},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-09-18T08:06:17.875Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-18T08:06:15.027Z"},"deploy":{"source":"dockerfile:Dockerfile","self_host":true,"observed_at":"2026-09-18T08:06:15.027Z","managed_saas":false},"languages":{"value":["c"],"source":"github.language","observed_at":"2026-09-18T08:06:15.027Z"},"has_docker":{"value":true,"source":"dockerfile:Dockerfile","observed_at":"2026-09-18T08:06:15.027Z"},"license_spdx":{"value":"Other","source":"github.license","observed_at":"2026-09-18T08:06:15.027Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you need to perform vector similarity searches within a PostgreSQL database and require support for multiple distance metrics.","If your application is already using PostgreSQL and you want to extend its capabilities to handle vector data efficiently without migrating to a different database system.","When you prefer open-source solutions and need the flexibility to customize the extension to fit your specific requirements.","If you are working with a large dataset and require the performance benefits of using a robust relational database like PostgreSQL with vector search capabilities."],"when_not_to_use":["If your application does not require the full feature set of PostgreSQL and you are looking for a lightweight solution specifically designed for vector similarity searches.","When you need real-time, low-latency vector similarity searches that might be better served by specialized vector databases or in-memory solutions.","If you are working in an environment where PostgreSQL is not supported or where you need to integrate with a different database system.","When you require a solution that supports more advanced indexing techniques or approximate nearest neighbor search algorithms that are not natively supported by pgvector."],"source":"enrich:decision_facts","observed_at":"2026-09-18T11:37:51.697Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"pgvector is an extension for PostgreSQL that enables efficient vector similarity search using various distance metrics, including L2, inner product, cosine distance, and L1 distance."}]}}