pg_graphrag
pg_graphrag · Knowledge graphs with provenance, temporal facts and permission-aware retrieval
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 102269 | pg_graphrag | pg_graphrag | 0.1.0 | RAG | Rust |
PostgreSQL · 18
| Relationships | |
|---|---|
| Requires | btree_gist |
Usage
Sources:
pg_graphrag 0.1.0 stores knowledge graphs with source evidence, temporal relationships and permission-aware retrieval. The SQL schema requires PostgreSQL 18 features, including uuidv7 and WITHOUT OVERLAPS, even though its Cargo manifest contains older-major build flags. This preview’s repository does not establish a license.
Core Workflow
Install as a superuser; btree_gist is required. Objects are in graphrag. The database does not call an LLM: applications supply extraction results and community summaries. The lightweight path below builds a graph without an LLM.
ingest_extraction stores structured extraction for a source chunk. local_search combines graph, dense and lexical retrieval; relational_paths returns explanation paths with evidence. build_communities, pending_report and set_report support application-generated summaries. Temporal searches can supply as_of; removing a document removes its derived evidence through the supported API.
Permissions
Document/chunk ACLs contain PostgreSQL role names; empty ACLs are public. Call graphrag.enable_row_security() to protect direct table access, then use graphrag.grant_reader or graphrag.grant_writer deliberately. Run retrieval as the actual caller, for example with a transaction-local role, rather than as the owner or superuser that bypasses row security. The extension filters derived entities and reports by visible source evidence; ungrounded curated attributes may be public.
Limits
No preload or restart is required. Dense retrieval scans candidates and does not require pgvector; it is not a claim of indexed vector search. LLM output remains untrusted application data, and summaries can become stale. Verify access rules and the supported refresh/deletion workflow with a representative corpus before deployment.