pg_sag_rag
Pure-SQL multi-hop event/entity retrieval, query routing, and in-database RAG evaluation.
pg_sag_rag · Pure-SQL multi-hop event/entity retrieval, query routing, and in-database RAG evaluation.
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 101926 | pg_sag_rag | pg_sag_rag | 0.1.0 | RAG | Apache-2.0 | SQL |
PostgreSQL · 14, 15, 16, 17
Usage
Sources:
pg_sag_rag Pure-SQL multi-hop event/entity retrieval, query routing, and in-database RAG evaluation.
Enablement
Install the files for the intended server, then create pg_sag_rag in the target database:
The reviewed control or official workflow requires vector, pg_trgm. CASCADE only succeeds when those extension files are already installed on the server.
Core Workflow
The following example is taken from the reviewed upstream documentation. Adapt object names, paths, credentials, and workload values before use.
Main Objects
The reviewed install surface includes these prominent objects:
| Object | Kind | Operational role |
|---|---|---|
sag_rag.event | TABLE | Extension-owned table; account for its data in backup and upgrades. |
sag_rag.entity | TABLE | Extension-owned table; account for its data in backup and upgrades. |
sag_rag.create_hnsw_indexes | FUNCTION | Callable function from the reviewed install surface. |
sag_rag.document | TABLE | Extension-owned table; account for its data in backup and upgrades. |
sag_rag.event_entity | TABLE | Extension-owned table; account for its data in backup and upgrades. |
sag_rag.recall_at_k | FUNCTION | Callable function from the reviewed install surface. |
sag_rag.run_evaluation_auto | FUNCTION | Callable function from the reviewed install surface. |
sag_rag.search_events_auto | FUNCTION | Callable function from the reviewed install surface. |
Operations and Boundaries
- The verified PostgreSQL-major evidence covers 14, 15, 16, 17; do not infer unlisted majors.