Motivation

Complex topics like the recent Sudanese civil war are daunting to start learning about because of the many actors with complex and shifting relationships. GraphRAG provides superior QA answering on the most up to date information. This project implements Microsoft's GraphRAG system using an ArangoDB backend and cuGraph for community finding.

Technical Summary

Presented is a FASTAPI backend powering an end-to-end GraphRAG agent. The agent creates a knowledge graph from text sources the user provides. This simple knowledge graph is persisted with Arango DB and then the agent leverages ArangoDB Langchain interface to intelligently add relationships between entities making a much denser graph. The user can then ask the agent questions which are passed through a RAG pipeline and a graph query pipeline to give hybrid answers that not only inform the reader but provide graph properties such as neighbors, degree, and pagerank about the answer's contents.

Challenges we ran into

  • The initial implementation struggled to provide good answers because the graph was too sparse. This was resolved by asking the agent to find the sparse nodes and add additional relationships based on overlapping node contents.

  • Direct implementation of agentic graph QA ran into many failed queries. This was resolved by manually going through queries that did succeed and using them as few-shot AQL examples in the langchain interface

    Accomplishments that we're proud of

  • High quality agentic question answering that is notably different from what the underlying model produces.

  • Quickly adapting to make the graph more dense

  • Contextual hybrid query answering that builds subgraphs for cuGraph to provide more detailed insight on

    What we learned

  • All about GraphRAG

  • A bit about the complex relationships in Sudan

Built With

Share this project:

Updates