rag
pgrag · Deprecated RAG helper extension for document extraction/chunking and remote embedding, reranking, and chat APIs.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 100254 | rag | pgrag | 0.0.0 | RAG | Apache-2.0 | Rust |
PostgreSQL · 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | vector |
Usage
Sources:
rag is the base extension from the deprecated pgrag project. It provides local document-to-text conversion and character-based chunking, plus HTTPS clients for several remote embedding, reranking, and chat APIs. The project is no longer developed or maintained, so use it only with an explicit migration and security plan.
Core Workflow
Install its declared vector dependency, then use the local conversion helpers without a model extension:
Main API Groups
- Local conversion:
rag.markdown_from_html(text),rag.text_from_pdf(bytea), andrag.text_from_docx(bytea). PDF extraction has no OCR or complex-layout support. - Local chunking:
rag.chunks_by_character_count(text, integer, integer)returns overlapping text chunks. - OpenAI:
rag.openai_set_api_key(text),rag.openai_get_api_key(), embedding helpers, andrag.openai_chat_completion(json). - Anthropic and Fireworks: matching key setters/getters plus
rag.anthropic_messages(text, json), Fireworks embedding helpers, andrag.fireworks_chat_completion(json). - Voyage AI: key setters/getters, embedding helpers, and scalar/array reranking score and distance functions.
Operational Notes
The reviewed version is 0.0.0, non-relocatable, and requires vector; the control file also sets superuser = true. It declares no preload requirement. Remote helpers perform outbound HTTPS requests inside database sessions, so latency, provider failures, quotas, and response handling become query concerns. Key getter functions return stored credentials; restrict function privileges and never expose them to untrusted roles. Pin dependencies because the upstream repository is archived and deprecated.