pgvector-rag

Create and manage pgvector databases in PostgreSQL with Ollama for RAG pipelines.

1|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/constructive-io/constructive-skills --skill pgvector-rag
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pgvector-rag
Source: https://github.com/constructive-io/constructive-skills/tree/main/skills/pgvector-rag
Command: npx skills add https://github.com/constructive-io/constructive-skills --skill pgvector-rag

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive toolkit for building vector search and Retrieval-Augmented Generation (RAG) applications directly within PostgreSQL, leveraging Ollama for local LLM inference.

Core Features & Use Cases

  • Vector Database Setup: Configure PostgreSQL with pgvector for efficient vector storage.
  • Embedding Generation: Generate embeddings for text using Ollama models.
  • RAG Pipelines: Implement end-to-end RAG workflows, from document ingestion to LLM-powered responses.
  • Use Case: Build an AI-powered Q&A system over your company's internal documentation. When a user asks a question, the Skill finds relevant document chunks using semantic search in PostgreSQL and then uses Ollama to generate a concise answer based on that context.

Quick Start

Use the pgvector-rag skill to set up your vector database and generate embeddings for your documents.

Frequently Asked Questions about pgvector-rag

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a RAG pipeline using PostgreSQL and Ollama?

To build a RAG pipeline with PostgreSQL and Ollama, you ingest documents, generate text embeddings via Ollama, store them in PostgreSQL using pgvector, and perform semantic search to retrieve context for LLM response generation.

Can I use PostgreSQL as a vector database for semantic search?

Yes, PostgreSQL functions as a vector database for semantic search by installing the pgvector extension, which enables efficient vector storage and similarity search directly within your existing relational database environment.

How do I generate embeddings for documents stored in PostgreSQL?

You generate embeddings for PostgreSQL documents by passing text chunks to Ollama models for local LLM inference, then storing the resulting vector representations in pgvector columns for subsequent similarity matching.

Do I need an external API to run LLM inference for my RAG application?

No external API is required for LLM inference in your RAG application. This Skill integrates with Ollama to run local LLM inference, enabling embedding generation and response synthesis entirely on your own infrastructure.

What is the best way to implement semantic search over internal company documentation?

The best way to implement semantic search over internal documentation is creating a RAG pipeline that chunks text, generates embeddings with Ollama, stores them in pgvector, and queries similar chunks to provide context for LLM answers.

When should I use pgvector instead of a dedicated vector database for RAG?

You should use pgvector instead of a dedicated vector database when your RAG application benefits from keeping vector embeddings alongside relational data in PostgreSQL, reducing infrastructure complexity while maintaining local LLM inference.