{"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":2183,"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":4,"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 project that enhances PostgreSQL to perform scalable, low-latency vector searches, supporting hybrid search capabilities.","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-08-21T12:00:58.146534+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-08-21T12:00:57.362Z","maintenance":{"label":"Dormant","score":18,"methodology":"github_public_v1","releases_90d":0,"days_since_push":540,"last_release_at":"2024-11-21T11:52:13Z","stars_delta_30d":4,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T11:25:13.571Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-21T12:00:57.811Z"},"languages":{"value":["rust"],"source":"github.language","observed_at":"2026-08-21T12:00:57.811Z"},"license_spdx":{"value":"Apache-2.0","source":"github.license","observed_at":"2026-08-21T12:00:57.811Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Need integration with PostgreSQL for vector searches","Require hybrid search capabilities alongside traditional SQL queries"],"when_not_to_use":["Preferring a database system without PostgreSQL dependencies","Looking for a standalone solution, as pgvecto.rs is a PostgreSQL extension"],"source":"enrich:decision_facts","observed_at":"2026-07-12T15:20:13.617Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"pgvecto.rs extends PostgreSQL for efficient vector searches using Rust."}]}}