postgresql-pgvector
Use when adding vector similarity search to a PostgreSQL database — storing embeddings, querying nearest neighbors, hybrid text+vector search, or indexing with IVFFlat or HNSW. Also use when building RAG systems, semantic search, or recommendation engines on top of Postgres.
| Model | Source |
|---|---|
| sonnet | pack: database |
Full Reference
┏━ 🔧 postgresql-pgvector ━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when adding vector similarity search to a … ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
PostgreSQL + pgvector
Section titled “PostgreSQL + pgvector”Open-source extension that turns Postgres into a vector database. Stores embeddings as native vector columns alongside relational data — no separate vector DB required.
Requires: PostgreSQL 12+ · pgvector 0.7+
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Extension enable | CREATE EXTENSION IF NOT EXISTS vector; |
| Cosine distance operator | <=> |
| L2 distance operator | <-> |
| Recommended index | HNSW (vector_cosine_ops) |
| Default ef_search | 40 (increase to 100–200 for high recall) |
| text-embedding-3-small dims | 1536 |
| text-embedding-3-large dims | 3072 |
| Gemini text-embedding-004 dims | 768 |
| Cloud support | Supabase, Neon, RDS, AlloyDB |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Install pgvector locally or in Docker | reference/installation.md |
| Create tables, add vector columns, run similarity queries | reference/schema-and-operators.md |
| Add HNSW or IVFFlat indexes, tune performance | reference/indexing.md |
| Combine vector search with full-text search (RRF) | reference/hybrid-search.md |
| Store and query embeddings from Node.js, Drizzle, or Prisma | reference/nodejs-integration.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.
Related Skills
Section titled “Related Skills”supabase— Managed Postgres with pgvector and vector search helpers built inneon— Serverless Postgres with pgvector supportdrizzle— Type-safe ORM with raw SQL escape hatch for vector queriesprisma— ORM requiring$queryRawfor vector operationsanthropic-api/openai-api/google-genai— Generate embeddings to store