Skip to content

PostGraphDB/postgraph

Repository files navigation

PostGraph

Codacy Badge

Introduction

PostGraph is a multi-model, graph centric query engine build on Postgres. PostGraph is designed to work fast with your OLTP, OLAP and AI Applications.

PostGraph Supports

  • Cypher - Use the Cypher Query Language to explore your data and run Graph queries.
  • Vectors - Combine Vectors with your graph data to unlock new and valuable insights
  • PostGIS - Unlock the power of spatial data in your graph database.
  • Full Text Search - Sift through vast amounts of textual data and combine with Vectors to unlock your natural language processing models

Requirements

  • Linux
  • PosgreSQL v14
  • PostGIS 3.3
  • Development Files for PostgreSQL and PostGIS

Building & Installation From Source

git clone https://github.com/PostGraphDB/postgraph
cd postgraph
make POSTGIS_DIR=/path/to/postgis/source/files
sudo make install

Once PostGraph is installed, it needs to be enabled in each database you want to use it in. In the example below we use a database named postgraph.

createdb postgraph
psql postgraph -c "CREATE EXTENSION PostGIS"
psql postgraph -c "CREATE EXTENSION LTree"
psql postgraph -c "CREATE EXTENSION PostGraph"

You can find the location of the postgresql.conf file as given next:

$ which postgres
/usr/local/pgsql/bin/postgres
$ ls /usr/local/pgsql/data/postgresql.conf
/usr/local/pgsql/data/postgresql.conf

As can be seen, the PostgreSQL binaries are in the bin subdirectory while the postgresql.conf file is in the data subdirectory.

Set the following in postgresql.conf depending on the version of PostGraph and it's dependecy PostGIS:

shared_preload_libraries = 'postgis-3', 'postgraph'

POSTGIS Dependencies: autoconf automake libtool libxml2-devel geos-devel proj-devel protobuf-devel protobuf-c-compiler protobuf-compiler gdal-devel

Quick Start

Use psql to start a command line session with your database

psql postgraph

Create a graph

SELECT create_graph('graph_name');

Create Data with the Cypher Command

SELECT *
FROM cypher('graph_name', $$
    CREATE (v { name: 'Hello Graph!'})
    RETURN (v)
as (v vertex);

Roadmap

Completed:

  • Support for the OpenCypher Query Language
  • Vector Embeddings, powered by pgVector
  • Support for Time data

In Progress:

  • Support For IVFFLAT Indices, Approximate K-Nearest Neighbors
  • Support for Geographic Information Systems, powered by PostGIS

Planned

  • Support For HNSW Indices, Faster Approximate K-Nearest Neighbors
  • Support For Full Text Search, For combing with Vector Embeddings for Natural Language Processing
  • Support of Time-Series Graph Data, powered by TimeScaleDB
  • Machine Learning Techniques
  • Label Partitioning - For advanced storage and performance techniques
  • Geospatial Trajectory Data, powered by MobilityDB

Thank You to All the Supporters!

Stargazers repo roster for @Postgraphdb/postgraph Forkers repo roster for @Postgraphdb/postgraph