pgvector-semantic-search
把向量检索整合进关系库,便于构建语义检索与近邻查询功能。
需安装 pgvector 扩展并注意大规模向量的存储与性能成本
在 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.
帮我安装这个 skill:https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/pgvector-semantic-search/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/timescale/pg-aiguide/main/skills/pgvector-semantic-search/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