pgvector-semantic-search

仓库创建 2025年7月24日最近提交 1 个月前SkillHot 收录 20 天前
▸ 精选理由

把向量检索整合进关系库,便于构建语义检索与近邻查询功能。

▸ 风险提示

需安装 pgvector 扩展并注意大规模向量的存储与性能成本

这个 Skill 做什么

在 PostgreSQL 中配置 pgvector 向量相似检索,用于 RAG 与语义搜索。

在 PostgreSQL 里存向量并做相似度检索,用于语义搜索、RAG 或其他基于嵌入的应用。需要把文本转成 embeddings、创建 ANN 索引(如 HNSW 或 IVFFlat)并优化召回和性能时用。特别之处是在数据库内直接做向量检索,支持 halfvec、量化等手段节省空间并提升大规模检索效率。

▸ 展开 SKILL.md 英文原文

Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search. **Trigger when user asks to:** - Store or search vector embeddings in PostgreSQL - Set up semantic search, similarity search, or nearest neighbor search - Create HNSW or IVFFlat indexes for vectors - Implement RAG (Retrieval Augmented Generation) with PostgreSQL - Optimize pgvector performance, recall, or memory usage - Use binary quantization for large vector datasets **Keywords:** pgvector, embeddings, semantic search, vector similarity, HNSW, IVFFlat, halfvec, cosine distance, nearest neighbor, RAG, LLM, AI search Covers: halfvec storage, HNSW index configuration (m, ef_construction, ef_search), quantization strategies, filtered search, bulk loading, and performance tuning.

数据与抓取向量搜索pgvector语义检索通用
1.8k
Stars
99
Forks
10
仓库内 Skill
+13
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/pgvector-semantic-search/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/pgvector-semantic-search/SKILL.md"
SKILL.MD 节选查看完整文件 ↗
# pgvector for Semantic Search

Semantic search finds content by meaning rather than exact keywords. An embedding model converts text into high-dimensional vectors, where similar meanings map to nearby points. pgvector stores these vectors in PostgreSQL and uses approximate nearest neighbor (ANN) indexes to find the closest matches quickly—scaling to millions of rows without leaving the database. Store your text alongside its embedding, then query by converting your search text to a vector and returning the rows with the smallest distance.

This guide covers pgvector setup and tuning—not embedding model selection or text chunking, which significantly affect search quality. Requires pgvector 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有