GRAPH COMPUTATION, RECONSIDERED
Your data.Connected.
A new dimension for your graph queries.
GraphBLAS-powered acceleration for PostgreSQL,
starting with Apache AGE™.
Python interface. Sparse matrices. More possibilities.
THE EXECUTION LAYER
One query.
The right route.
Keep your graph in Apache AGE. pg-graph caches its topology as sparse matrices and routes supported queries to GraphBLAS, the database, or both.
MATCH (p:Person)-[:KNOWS*1..3]->(friend:Person)
RETURN DISTINCT friendTraverse the cached topology with GraphBLAS sparse matrix operations.
A Python interface for your existing graph
Graph topology, expressed as sparse matrices
Database filters meet in-memory traversal
EARLY BENCHMARKS
Let the numbers
do the talking.
Recorded query latency on a Twitter follow graph. Explore the results from an early comparison with Neo4j.
pg-graph · mean · 4-hop traversal
Exploratory measurements. Graph loading is excluded; these results have not been independently reproduced.
What’s behind these numbers?
The saved run contains 10 starting vertices × 10 timed runs, with 2 warm-up queries per vertex. The original result files call this engine “AGEBlas”; it is presented here under the pg-graph product name.
Hardware, database versions, exact dataset size, and output-equivalence evidence were not retained with the run. These are preliminary engineering results, not a general performance comparison. Shortest-path and algorithm benchmarks were excluded.
THE GRAPH PLAYGROUND
Small graph.
Real possibilities.
Follow a connection. Find the influential nodes.
An illustrative social graph, with results recorded from the pg-graph Python engine.
| Person | Node ID |
|---|---|
| Bo | 102 |
| Cy | 103 |
| Dee | 104 |
| Eli | 105 |
| Faye | 106 |
| Gus | 107 |
Unique people reachable from Ada within 3 hops.
pg.explicit().multi_hop_neighbors(101, max_hops=3, edge_label="KNOWS")Recorded engine results on a fixed sample graph. No database connection is made by this page.
BUILT FOR THE CURIOUS
Make the
connection.
Your graph. Your Cypher.
A Python interface to explore what comes next.
# With pg_graph installed and Apache AGE configured
from pg_graph import PGGraph
pg = PGGraph.connect(
database="mydb",
graph="social",
)
# Let the router choose an execution path.
results = pg.execute("""
MATCH (p:Person)-[:KNOWS*1..3]->(friend)
WHERE p.name = 'Ada'
RETURN DISTINCT friend.name
""")What do I need to get started?
Python 3.11+, the pg_graph package and its Cypher grammar dependency, plus PostgreSQL with Apache AGE and an existing graph. The downloadable example reads connection settings from environment variables.
Where does the data live?
Your graph stays in PostgreSQL. Graph topology is loaded into an in-memory GraphBLAS cache in the Python process. Property access and database operations use Apache AGE.
Is it ready for production?
pg-graph is an experimental Python project. It is best evaluated on static or controlled graph snapshots. Cache synchronization and refresh behavior need further work; full Cypher compatibility and production reliability are not claimed.