pgembed
pgembed · Generate vector embeddings through Ollama, OpenAI, or custom HTTP services
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101968 | pgembed | pgembed | 0.1.0 | RAG | Tecnisys-Community-1.0 | Python |
PostgreSQL · 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | vector plpython3u |
Usage
Sources:
pgembed generates pgvector embeddings through Ollama, OpenAI, or a custom HTTP endpoint. It is implemented with untrusted PL/Python; inference runs in an external service, not inside the database.
Core Workflow
A superuser must make plpython3u and vector available. Start a compatible Ollama server with the requested model before running the query.
API and Configuration
The embed_ollama, embed_openai, and embed_custom functions in the pgembed schema return vectors; their batch forms handle text arrays. Match the destination vector dimension to the selected model. pgembed.url_allowlist controls accepted hosts. pgembed.max_retries, pgembed.initial_backoff_ms, and pgembed.max_backoff_ms govern retries; pgembed.circuit_breaker_threshold and pgembed.circuit_breaker_reset_timeout_s govern a backend-local circuit breaker.
The README specifies PostgreSQL 13 or newer. No preload or server restart is needed for the extension itself. HTTP calls hold a database backend until completion; remote text and credentials require deliberate access control. A configurable hostname allowlist is not a substitute for database privileges and network policy. Do not put actual API keys in logged SQL. The Tecnisys Community License 1.0 restricts competing hosted-service use.