pgGraph
Graph search, traversal and shortest-path queries over your existing PostgreSQL tables.
- Source repo
- Evokoa/pgGraph
- Stars
- ★ 1.1k
- Last updated
- 2mo ago
- FARS reviewed
- Nov 25, 2026
- License
- NOASSERTION
- Primary language
- Rust
- FA score
- 60/100 · Some gaps
At a glance
- Works with
- Portable with changes
- You'll need
- Typical use
- Teams with a relational production database who want 'find records related to Alice within two hops' without migrating data
- Main limitation
- Each backend that loads a graph keeps roughly one artifact-sized private snapshot, and base graph pages are not shared across backends through the OS page cache, so memory needs sizing
- Website
- polygres.com ↗ set on GitHub
- Maintenance
- Commits in the last 6 monthslast commit 2026-09-23
- Source review
- 60/100 · Some gaps
What does this agent do, and when should you use it?
pgGraph is a Rust/pgrx PostgreSQL extension that runs graph search, traversal, shortest path and relationship queries directly against ordinary PostgreSQL tables, without a separate graph database or a new query language. Your tables stay authoritative; the extension compiles relationships into forward and reverse CSR edge stores as a rebuildable .pggraph artifact and exposes queries through functions in the graph schema. Build, sync, vacuum and maintenance are SQL-callable and visible, and results come back as source table coordinates or hydrated PostgreSQL rows. Traversal includes explicit circuit breakers — depth limits, visited-node tracking, frontier limits, pagination and memory safeguards. It supports PostgreSQL 14–18 and ships as Docker images, a Homebrew tap and PGXN/pgrx source installs, with a managed option from Evokoa at polygres.com.
pgGraph reads your existing PostgreSQL tables and the foreign key relationships between them. graph.build() compiles those relationships into forward and reverse compressed sparse row (CSR) edge stores, producing a .pggraph artifact that is written atomically; when a new backend starts it validates the artifact and copies it into a backend-private anonymous mapping before exposing immutable forward graph arrays and a resolution index through read-only views. At query time the SQL layer resolves coordinates, labels, filters and tenant scopes, then enters a tight loop that streams CSR neighbors while checking compact adaptive one-, two- or four-byte EdgeTypeId values, typed FilterIndex values, tenant bitmaps, active bits and sync overlays. SQL-facing functions such as graph.search() and graph.shortest_path() return source table coordinates or hydrate raw rows on demand. Build, sync, vacuum and maintenance are all SQL-callable operations, and the engine enforces depth limits, visited-node tracking, frontier limits, pagination and OOM/memory safeguards as circuit breakers.
- Teams with a relational production database who want 'find records related to Alice within two hops' without migrating data
- Application developers who need shortest paths between entities such as a person and a company
- Engineering teams adding graph traversal to an existing schema without learning Cypher or adopting a graph namespace
- Architects evaluating the CSR versus mutable projection modes with the Streamlit playground and Panama or LDBC preset datasets
- Multi-tenant SaaS backends that need tenant-scoped traversal with depth and pagination caps
- AI application developers preparing a graph traversal layer inside PostgreSQL for GraphRAG-style retrieval
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
brew install pggraphcargo install cargo-pgrx --version 0.19.1 --lockeddocker pull ghcr.io/evokoa/pggraph:1.2.1
- Config files
graph/rust-toolchain.toml- Install notes cover
- macOS · Docker
How do you install or deploy this agent?
The fastest path is the bundled quickstart, which starts a disposable Docker PostgreSQL 17 and installs the extension:
# install into the repo's own Docker Compose database
git clone https://github.com/evokoa/pggraph.git
cd pggraph
scripts/quickstart.shTo install into an already running PostgreSQL Docker container:
scripts/quickstart.sh docker my-postgres 17 appdb postgresOn macOS with a local PostgreSQL 17, use the Evokoa Homebrew tap:
brew tap Evokoa/tap
brew install pggraph
brew test pggraph
brew services start postgresql@17Source or PGXN builds require PostgreSQL development headers plus pg_config, the Rust toolchain (1.96, pinned by graph/rust-toolchain.toml) and cargo-pgrx 0.19.1:
cargo install cargo-pgrx --version 0.19.1 --locked
PG_MAJOR=$(pg_config --version | sed -E 's/[^0-9]*([0-9]+).*/\1/')
cargo pgrx init --pg${PG_MAJOR}="$(which pg_config)"
pgxn install pgGraphOr build and install manually:
git clone https://github.com/evokoa/pggraph.git
cd pggraph
make installThe PGXN distribution name is pgGraph; the PostgreSQL extension name is graph.
How do you use this agent?
After installation, create the extension and confirm the version:
psql -d postgres -c "CREATE EXTENSION graph;"
psql -d postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'graph';"Inside the container you can use the bundled psql:
docker exec pggraph psql -U postgres -d graph \
-c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('graph', 'pg_cron');"Then let pgGraph discover foreign key relationships on your tables, call graph.build() to build the graph, and query it with functions in the graph schema. For deployment, use the versioned multi-architecture release image and verify its published digest:
docker pull ghcr.io/evokoa/pggraph:1.2.1Upgrading to 1.2.1 requires updating the extension and rebuilding each graph (see the release notes). Optionally start the Streamlit playground with a preset dataset:
scripts/quickstart.sh playground panama csr
scripts/quickstart.sh playground panama mutableSafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- No data migration: source tables, constraints, indexes, ACLs, RLS, backups and application writes stay standard PostgreSQL concerns; the graph is derived, rebuildable state
- CSR adjacency gives O(1) neighbor lookup and streams neighbors in memory, avoiding recursive SQL and repeated joins
- Explicit circuit breakers — depth limits, visited-node tracking, frontier limits, pagination and OOM/memory safeguards — reduce the risk of unbounded expansion crashing the database
- Several install channels: Docker images for PostgreSQL 14–18, a Homebrew tap, and PGXN/pgrx source builds
- Independent of native SQL/PGQ, sidestepping PostgreSQL 19's removal of that feature
- Each backend that loads a graph keeps roughly one artifact-sized private snapshot, and base graph pages are not shared across backends through the OS page cache, so memory needs sizing
- Upgrading to 1.2.1 requires updating the extension and rebuilding every graph — real operational work
- Source builds need matching PostgreSQL server dev packages, Rust 1.96 and cargo-pgrx 0.19.1; mismatches surface as errors such as a missing postgres.h
- The Homebrew tap is updated separately from Docker and PGXN, so you must verify the installed extension reports 1.2.1
- Optimized for repeated bounded traversal over known topology; it is not a general graph database and has no Cypher-style query language
- Repository metadata reports the license as NOASSERTION while the README states Apache-2.0; check the LICENSE file before adopting
How does this agent compare with similar options?
The README explicitly contrasts pgGraph with Apache AGE: AGE is a property graph database inside Postgres with graph namespaces, vertex and edge tables, agtype and openCypher; pgGraph asks you to keep your schema and learn no Cypher, accelerating bounded traversal with SQL functions such as graph.search() and graph.shortest_path(). It also addresses PostgreSQL's native SQL/PGQ (CREATE PROPERTY GRAPH, GRAPH_TABLE), which was removed from the PostgreSQL 19 release branch; pgGraph supports PostgreSQL 14–18 independently of it.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| pgGraph This agent | 60 · Some gaps | — | ★ 1.1k | 2mo ago | Rust | — |
| Tabularis: Open-Source Desktop SQL Workspace | 73 · Some gaps | Desktop appFree + model costs | ★ 5.5k | 1d ago | TypeScript | ChatGPT · Codex · Claude Code · Claude.ai |
| BrainDB Memory Database | 59 · Major gaps | Self-hosted serviceFree + model costs | ★ 117 | 1mo ago | Python | Claude Code |
| AgentBench | 54 · Major gaps | Self-hosted serviceFree + model costs | ★ 3.8k | 9mo ago | Python | OpenAI API |
How does FollowAgents rate this agent?
Why each dimension lost points
Security docs show ACL preflight, admin boundaries, SECURITY DEFINER search_path pinning, RLS visibility scopes, tenant scoping and quotas, a fairly complete privilege design (least_privilege 2). However the Docker init script creates pg_cron and schedules maintenance every five minutes by default, a persistent external side effect without per-action confirmation (external_effects 1, user_confirmation 2). Data flow is explained (derived state, private artifact snapshot) but artifacts contain source primary keys and topology; sensitive handling relies on ACL/RLS only, no encryption or masking (sensitive_data_handling 2). Dependency security has exact pins, lockfiles, a 6-hour age gate and sfw wrapper (dependency_security 2). Rollback via reset/rebuild and retaining last valid generation is described (rollback 2). Attribution is only README badges and Evokoa branding; publisher unverified (source_attribution 1).
Error model has SQLSTATE and stable diagnostic table, high-quality failure messages (failure_messages 3). But SECURITY.md claims 1.0.x is supported while README/AGENTS say 1.2.1, a version inconsistency (self_consistency 1). Dependency availability has explicit Rust/pgrx/PostgreSQL matrix and multi-channel install (dependency_availability 2).
Targets graph queries over existing Postgres data; audience and scenarios clear (audience_and_scenarios 2). Capability boundaries explained via AGE and SQL/PGQ comparisons and limitations (capability_boundaries 2). Trigger precision: AGENTS.md is actually a package-manager safety wrapper, weakly related to the product, and auto_discover heuristics may misfire (trigger_precision 1). Environment fit covers macOS/Linux/WSL2 and multiple PG versions (environment_fit 2).
Docs are well structured with user guide, contributor guide and API reference (information_architecture 2). Install notes are thorough across Homebrew/PGXN/Docker/source (install_notes 3). Naming: PGXN name pgGraph differs from extension name graph, requiring explicit callout (naming_stability 2). Examples and FAQ exist via quickstart and playground (examples_and_faq 2). Known limitations documented in limitations-and-fit and config warnings (known_limitations 2). LICENSE is full Apache-2.0 but metadata says NOASSERTION (license 2). Release notes and version badge present (versioning_changelog 2). Maintenance responsibility points to Evokoa and an external tap; publisher unverified (maintenance_responsibility 1).
Output usability: SQL functions return structured results plus a playground (output_usability 2). Marginal value over recursive SQL is clear (marginal_value 2). Cost: requires Docker/Rust/pgrx builds and per-backend private snapshots consuming memory, relatively high (cost_benefit 1).
README claims trace to docs and code modules (claim_traceability 2). Multiple docs and test scripts corroborate each other (cross_source_corroboration 2). Docs separate fact from inference, e.g. SQL/PGQ removal cites upstream commit (fact_inference_separation 2). All static reading, no execution.
- SECURITY.md claims 1.0.x support while README/AGENTS state 1.2.1; the security support scope may be stale.
- Docker image enables pg_cron and schedules maintenance every five minutes by default, a persistent side effect to confirm before deployment.
- Graph artifacts contain source primary keys and topology; sensitive protection relies on ACL/RLS with no encryption or masking shown.
- Publisher identity is unverified and the Homebrew tap is maintained in an external repo; verify signatures and digests before install.
- AGENTS.md is a package-manager safety wrapper, weakly related to the product, and should not be treated as product instructions.
- License metadata is NOASSERTION while LICENSE is Apache-2.0; reconcile manually.
FAQ
Does it copy my data into a separate graph database?
Which PostgreSQL versions are supported?
Is there a cost?
Can an unbounded traversal take down the database?
Metadata says NOASSERTION for the license — can I use it commercially?
Is pgGraph safe to use?
Is pgGraph still maintained?
Who makes pgGraph?
What is pgGraph's official website?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.