Skip to content
← Tools / Skills
ToolTimescale/10 trustMetrics-checked

pgai

Turn PostgreSQL into a RAG and agent retrieval engine.

Visit official site →

About

pgai is Timescale's open-source toolkit that turns PostgreSQL into a production retrieval engine for RAG and agentic applications. Its Vectorizer declaratively creates and syncs vector embeddings from Postgres tables and S3 documents, keeping them updated as data changes, like an index that manages embeddings instead of B-trees.

It adds semantic search over pgvector and pgvectorscale, in-database RAG inside a single SQL statement, LLM chat completions from providers like OpenAI, Anthropic, Cohere, and Ollama, plus a semantic catalog for natural-language-to-SQL.

Lifecycle note: community mirrors of the project carry a notice that pgai is no longer maintained as of February 2026, so confirm upstream status before adopting it for new work.

What it can do

  • Declarative embedding vectorizer for Postgres tables
  • Vector and semantic search in SQL
  • In-database RAG in one statement
  • LLM completions and text-to-SQL

Setup

pip install pgai, then run pgai install against your Postgres connection string, or install the ai extension with CREATE EXTENSION.

Prerequisites

PostgreSQL 16+ with pgvector; Python 3.10+.

Use cases

ragvector-searchtext-to-sqlembeddings

Works with

Trust score — 7/10

/10 trustMetrics-checked

Scored 7/10 (metrics tier, metrics-v1). Evidence: Verified via vendor site/docs/GitHub and reputable coverage, wave 122; Trending score 68/100 from researcher assessment.

Sources

Every fact above was checked against these sources. Where a claim comes from the provider and couldn't be independently verified, the text says so.