PostgreSQL AI Edition (pg_ai)
pg_ai puts AI inside the database: embeddings, semantic search, RAG and agents callable from SQL, with local inference. No API key, no second vector database, one docker compose up.
Capabilities
- Native embeddings and semantic search in PostgreSQL.
- RAG and ReAct-style agents callable from SQL.
- Local inference via Ollama and an async background worker.
- Security inherited from Postgres roles and RLS.
Why it matters
Embeddings stay transactional with their data; fewer systems to maintain and data never leaves the host. No sync pipelines or external inference APIs.
Stack
A C engine (pg_ai_core) with planner hooks + PL/pgSQL functions · Ollama · PostgreSQL.
Considerations
- Open-source project; local inference to keep data on-host.