Ready-to-use graph algorithms you can easily run in MemgraphDB

MAGE is an open-source library that contains graph algorithms in the form of query modules you can use right away with our graph database.

Install Memgraph with docker

docker run -p 7687:7687 memgraph/memgraph-mage

MAGE graph algorithms work in multiple programming languages

Query Modules make it possible— they are user-defined procedures grouped into modules that extend the basic functionalities of Cypher.

import mgp
import random

def get_path(    
   start: mgp.Vertex,    
    length: int = 10,
) -> mgp.Record(path=mgp.Path):
   """Generates a random path of length `length` or less starting       from the `start` vertex.

   :param mgp.Vertex start: The starting node of the walk.       :param int length: The number of edges to traverse.    
    :return: Random path.    
    :rtype: mgp.Record(mgp.Path)    
    path = mgp.Path(start)    
    vertex = start
   for _ in range(length):
           edge = random.choice(list(vertex.out_edges))                       path.expand(edge)            
           vertex = edge.to_vertex
        except IndexError:
   return mgp.Record(path=path)

Create custom query modules that fit your use case

If our ready-made query modules don’t make the cut, you can expand the Cypher language even further. By using our public Python or C API, you can design custom query modules.

Fully open-source graph algorithm library

MAGE is free to use, distribute, and modify. We encourage developers to share innovative and useful query modules (custom Cypher procedures), so the whole community can benefit from them.

Out-of-the-box dynamic algorithms for streaming analytics

MAGE contains a suite of dynamic graph algorithms that compute query and update operations as quickly as possible—making them an excellent solution for real-time data streams.

Applications, not Analytics

MAGE is a dedicated algorithm library for Memgraph

MAGE was created as part of Memgraph — an open-source platform for graph computation on streaming data that includes a suite of ecosystem tools like MemgraphDB, a graph database, Lab for graph visualisation, and more.

Memgraph Home Illustration
Build & Grow browser


Analyse Infrastructure Networks with Dynamic Betweenness Centrality

Remember when the global internet came under attack by sharks? In this tutorial, you can learn how an incident like that can affect the global submarine internet network by analysing data streamed into Memgraph.

Arrow icon
Memgraph MAGE tutorial image
Applications, not Analytics

Try our ready-to-use graph algorithms

MAGE contains graph algorithms you can use right away with MemgraphDB.

Build & Grow browser