Inspiration

As a competitive triathlete, I spend a lot of time looking at race data, but with every race having results in different places, it can be difficult to analyze trends across a season. So I thought it would be exciting to collect all the raced data in one place and build a tool that provides a centralized way for athletes to analyze their competition, discover rivalries, and even optimize their future race choices using graph-based AI.

How I built it & challenges I faced

I started by collecting race data from public sources. I had to think about what structure I wanted to use for the data and how to best represent it as a graph. I decided to go with a bipartite graph structure where athletes and races are represented by nodes and athletes are connected to races they participated in. I thought this would be a more rich representation then just an graph with athlete <-> athlete connections since it would also provide details on how athletes were connected.

Give this complex graph structure, one challenge I ran into was getting the LLM tools I was using to understand the structure and how to extract insights from it. I used a two pronged approach to solve this problem - first, I designed a few more complex tools for my agent to use by writing the AQL graph queries myself, second, for simpler queries, I used the ArangoGraphQAChain, but I added a prompt with a few well chosen examples that highlighted the best way to extract information from the graph.

What I learned

This project was an incredible opportunity to work with state of the art AI and Graph tooling including ArangoDB, NetworkX, Langchain, and cuGraph. In collecting data and building my graph, I learned the ins and outs of how graphs are built and stored in both NetworkX and ArangoDB as well as the best graph algorithms for extracting meaningful insights. In building my agent, I got hands on experience with what kind of prompts work better then others, and how to provide tools in the best way for the agent to make us of them.

Built With

  • arangodb
  • colab
  • cugraph
  • langchain
  • networkx
  • python
Share this project:

Updates