{"data":{"slug":"tensorchord-pgvecto-rs","name":"pgvecto.rs","tagline":"Scalable, Low-latency and Hybrid-enabled Vector Search in Postgres","github_url":"https://github.com/tensorchord/pgvecto.rs","owner":"tensorchord","repo":"pgvecto.rs","owner_avatar_url":"https://avatars.githubusercontent.com/u/100543303?v=4","primary_language":"Rust","stars":2186,"forks":86,"topics":["chatgpt","faiss","gpt","hacktoberfest","llm","nearest-neighbor-search","postgres","rust","vector","vector-database"],"archived":false,"github_pushed_at":"2025-02-26T14:11:43+00:00","maintenance_label":"Dormant","stars_delta_30d":7,"url":"https://www.graphcanon.com/tools/tensorchord-pgvecto-rs","markdown_url":"https://www.graphcanon.com/tools/tensorchord-pgvecto-rs.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/tensorchord-pgvecto-rs","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=tensorchord-pgvecto-rs","description":"Scalable, Low-latency and Hybrid-enabled Vector Search in Postgres. Revolutionize Vector Search, not Database.","homepage_url":"https://docs.vectorchord.ai/getting-started/overview.html","license":"Apache-2.0","open_issues":76,"watchers":20,"ai_summary":"pgvecto.rs is a vector database extension for PostgreSQL that enables scalable and low-latency vector search operations, supporting vector data types and distance calculations.","readme_excerpt":"## Quick start\n\nFor new users, we recommend using the [Docker image](https://github.com/tensorchord/pgvecto.rs/pkgs/container/pgvecto-rs) to get started quickly.\n\n```sh\ndocker run \\\n  --name pgvecto-rs-demo \\\n  -e POSTGRES_PASSWORD=mysecretpassword \\\n  -p 5432:5432 \\\n  -d ghcr.io/tensorchord/pgvecto-rs:pg17-v0.4.0\n```\n\nThen you can connect to the database using the `psql` command line tool. The default username is `postgres`, and the default password is `mysecretpassword`.\n\n```sh\npsql -h localhost -p 5432 -U postgres\n```\n\nRun the following SQL to ensure the extension is enabled.\n\n```sql\nDROP EXTENSION IF EXISTS vectors;\nCREATE EXTENSION vectors;\n```\n\npgvecto.rs introduces a new data type `vector(n)` denoting an n-dimensional vector. The `n` within the brackets signifies the dimensions of the vector.\n\nYou could create a table with the following SQL.\n\n```sql\n-- create table with a vector column\n\nCREATE TABLE items (\n  id bigserial PRIMARY KEY,\n  embedding vector(3) NOT NULL -- 3 dimensions\n);\n```\n\n> [!TIP]\n>`vector(n)` is a valid data type only if $1 \\leq n \\leq 65535$. Due to limits of PostgreSQL, it's possible to create a value of type `vector(3)` of $5$ dimensions and `vector` is also a valid data type. However, you cannot still put $0$ scalar or more than $65535$ scalars to a vector. If you use `vector` for a column or there is some values mismatched with dimension denoted by the column, you won't able to create an index on it.\n\nYou can then populate the table with vector data as follows.\n\n```sql\n-- insert values\n\nINSERT INTO items (embedding)\nVALUES ('[1,2,3]'), ('[4,5,6]');\n\n-- or insert values using a casting from array to vector\n\nINSERT INTO items (embedding)\nVALUES (ARRAY[1, 2, 3]::real[]), (ARRAY[4, 5, 6]::real[]);\n```\n\nWe support three operators to calculate the distance between two vectors.\n\n- `<->`: squared Euclidean distance, defined as $\\Sigma (x_i - y_i) ^ 2$.\n- `<#>`: negative dot product, defined as $- \\Sigma x_iy_i$.\n- `<=>`: cosine distance, defined as $1 - \\frac{\\Sigma x_iy_i}{\\sqrt{\\Sigma x_i^2 \\Sigma y_i^2}}$.\n\n```sql\n-- call the distance function through operators\n\n-- squared Euclidean distance\nSELECT '[1, 2, 3]'::vector <-> '[3, 2, 1]'::vector;\n-- negative dot product\nSELECT '[1, 2, 3]'::vector <#> '[3, 2, 1]'::vector;\n-- cosine distance\nSELECT '[1, 2, 3]'::vector <=> '[3, 2, 1]'::vector;\n```\n\nYou can search for a vector simply like this.\n\n```sql\n-- query the similar embeddings\nSELECT * FROM items ORDER BY embedding <-> '[3,2,1]' LIMIT 5;\n```","github_created_at":"2023-04-15T09:56:24+00:00","created_at":"2026-07-07T17:44:11.121107+00:00","updated_at":"2026-09-20T04:31:24.5101+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":"chatgpt","name":"chatgpt"},{"slug":"faiss","name":"faiss"},{"slug":"gpt","name":"gpt"},{"slug":"hacktoberfest","name":"hacktoberfest"},{"slug":"llm","name":"llm"},{"slug":"nearest-neighbor-search","name":"nearest-neighbor-search"},{"slug":"postgres","name":"postgres"},{"slug":"rust","name":"rust"}],"trust":{"provenance":{"is_fork":false,"github_id":628230315,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-09-18T08:31:22.251Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":568,"last_release_at":"2024-11-21T11:52:13Z","stars_delta_30d":7,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-09-18T08:31:24.250Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-09-18T08:31:21.089Z"},"languages":{"value":["rust"],"source":"github.language","observed_at":"2026-09-18T08:31:21.089Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-09-18T08:31:21.089Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["When you need to integrate vector search capabilities directly into an existing PostgreSQL database, as pgvecto.rs extends PostgreSQL with vector data types and distance calculations.","If you require a solution that supports a wide range of dimensions for vector data, from 1 to 65535, as pgvecto.rs allows for flexible vector data type definitions.","For applications that demand low-latency vector search operations, as pgvecto.rs is optimized for fast search within PostgreSQL.","When you prefer a solution that is open-source under the Apache-2.0 license, offering flexibility and transparency in its use and modification."],"when_not_to_use":["If your application does not require integration with PostgreSQL, as pgvecto.rs is specifically designed as an extension for PostgreSQL and does not offer standalone vector search capabilities.","When you need a solution that supports vector dimensions beyond 65535, as pgvecto.rs is limited to this maximum dimension size.","If you are looking for a solution that does not require the overhead of setting up and maintaining a PostgreSQL database, as pgvecto.rs is tightly coupled with PostgreSQL.","When you need a vector database that supports more complex vector operations beyond the three distance calculations provided by pgvecto.rs."],"source":"enrich:decision_facts","observed_at":"2026-09-18T10:12:14.867Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"pgvecto.rs is a vector database extension for PostgreSQL, built in Rust, that supports scalable and low-latency vector search operations, including specific vector data types and distance calculations."}]}}