Accelerating Graph Query Languages for Machine Learning and Retrieval Augmented Generation
Alexandria Barghi · 2024
Graph query languages are becoming increasingly popular across a variety of domains to specify complex queries, analytics, and traversals in a format familiar to users of traditional tabular query languages, such as SQL. While there are many options today for accelerating SQL queries, such as Spark, graph query languages are still behind in their support for massive-scale analytics. As large institutions increasingly deploy graph databases and use graph queries to build complex analytics pipelines, they quickly run into challenges scaling to a production system, where each query traverses billions, or even trillions of edges, and involves calculations depending on sparse graph features. This paper analyzes how graph query languages are used in conjunction with large scale tree-based, CNN, and GNN models for both standalone modeling and retrieval augmented generation (RAG), as well as the fundamental requirements and techniques needed to scale graph queries to support these applications. Using the Gremlin graph query language and BitGraph graph processing framework, this paper then illustrates how these techniques can be applied in practice and the performance yield of each.