pqnai
pqnai · Queued forecasting and retrieval backed by an external Go worker
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102175 | pqnai | pqnai | 0.3.0 | RAG | PostgreSQL | C |
PostgreSQL · 14, 15, 16, 17
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
- README.md
- extension/pqnai–0.3.0.sql
- docs/architecture.md
- .github/workflows/ci.yml
- extension/pqnai.control
pqnai exposes forecasting and retrieval procedures backed by the external pqnaid Go worker. This early version implements moving-average forecasts and chunked retrieval using pgvector and Ollama; ARIMA, hybrid retrieval and reranking remain planned.
Core Workflow
Operational Boundaries
Install vector first and create pqnai as a superuser. The fixed schema holds jobs, sources and chunks. The worker must use the same database and be able to reach Ollama. No PostgreSQL preload is declared; running the SQL extension alone does not provide inference. Upstream CI targets PostgreSQL 14–17.
Use top-level CALL outside an explicit transaction block: the procedures commit queued jobs before waiting for the worker. A timeout does not undo that committed work. pqnai.enqueue_job and pqnai.wait_for_job are lower-level queue helpers. Restrict job and stored-document access; per-tenant access control is not implemented in this version. The installed vector column has 384 dimensions, so changing the embedding dimension requires a schema migration. Plan retention for queue and document data.