项目概述
Open-source vector similarity search for Postgres
项目地址
https://github.com/pgvector/pgvector
项目页面预览

关键指标
- Stars:19237
- 主要语言:C
- License:Other
- 最近更新:2026-01-14T15:20:37Z
- 默认分支:master
本站高速下载(国内可用)
- 源码压缩包下载:点击下载(本站镜像)
- SHA256:54865748f55f2c469f257d43aecaa14fefddff338a1ace5d0d4efd9ff05d8796
安装部署要点(README 精选)
Installation
Getting Started
Enable the extension (do this once in each database where you want to use it)
CREATE EXTENSION vector;
Create a vector column with 3 dimensions
CREATE TABLE items (id bigserial PRIMARY KEY, embedding vector(3));
Insert vectors
INSERT INTO items (embedding) VALUES ('[1,2,3]'), ('[4,5,6]');
Get the nearest neighbors by L2 distance
SELECT * FROM items ORDER BY embedding <-> '[3,1,2]' LIMIT 5;
Also supports inner product (<#>), cosine distance (<=>), and L1 distance (<+>)
Note: <#> returns the negative inner product since Postgres only supports ASC order index scans on operators
Installation Notes – Linux and Mac
Installation Notes – Windows
常用命令(从 README 提取)
cd /tmp
git clone --branch v0.8.1 https://github.com/pgvector/pgvector.git
cd pgvector
make
make install # may need sudo
export PG_CONFIG=/Library/PostgreSQL/18/bin/pg_config
sudo --preserve-env=PG_CONFIG make install
通用部署说明(适用于大多数项目)
- 下载源码并阅读 README
- 安装依赖(pip/npm/yarn 等)
- 配置环境变量(API Key、模型路径、数据库等)
- 启动服务并测试访问
- 上线建议:Nginx 反代 + HTTPS + 进程守护(systemd / pm2)
免责声明与版权说明
本文仅做开源项目整理与教程索引,源码版权归原作者所有,请遵循对应 License 合规使用。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END








暂无评论内容