Add Postgres-native vector retrieval to agent and RAG workflows with pgvector
Store embeddings beside application data in Postgres, create vector indexes, and query nearest neighbors for semantic search, RAG, recommendations, or agent memory retrieval.
npx skills add agentskillexchange/skills --skill add-postgres-native-vector-retrieval-to-agent-and-rag-workflows-with-pgvector
Use pgvector when an operator needs a Postgres-backed agent or RAG workflow to perform vector similarity search without adding a separate vector database. The workflow is bounded: install and enable the `vector` extension, create vector columns and indexes, load embeddings from documents or memories, run nearest-neighbor SQL queries, and feed the retrieved records back into an agent or retrieval pipeline. Invoke it when the user already trusts Postgres for the application data plane and needs semantic retrieval inside that same database. The boundary is Postgres-native vector storage and retrieval for agent/RAG contexts, not a general Postgres listing, a hosted vector product, or an embedding-model library.
What this skill actually does
Inputs and prerequisites: Postgres 13+, pgvector extension, SQL access to the target database, embeddings from the agent or RAG pipeline, and application code that can query Postgres.
Setup notes: Install pgvector using the upstream package, source, Docker, Homebrew, PGXN, APT, Yum, or provider-specific path, run `CREATE EXTENSION vector;`, add vector columns and indexes, then query embeddings with the documented distance operators from the agent or RAG application.
Source and verification boundary: use https://github.com/pgvector/pgvector#readme as the canonical reference before running the workflow; keep commands, API calls, CLI usage, and generated outputs reviewable against that upstream source.
Framework fit: publish this as a Multi-Framework workflow only when the operator can invoke the documented toolchain directly, rather than treating the upstream project as a generic product listing.