Inspiration
This project began with a fascination for uncovering hidden patterns in flight data and transforming them into visual, interactive insights. Inspired by the complexity of air travel networks, I set out to build an end-to-end solution that leverages modern graph databases and cutting-edge language models.
What it does
Flight Graph Insights converts flight data into a graph structure (airports as nodes, flights as edges) and provides:
- Dynamic Query Translation: Converts natural language queries into AQL for direct database = interrogation or into executable Python code for NetworkX-based analysis.
- Hybrid Query Processing: Decomposes complex queries into multiple sub-tasks for granular analysis.
- Interactive Visualization: Generates technical visual outputs using matplotlib, combined with real-time logs and results via a Gradio UI.
How we built it
These are some key components:
- Graph Storage & Processing:
- ArangoDB: Stores the flight dataset as a graph.
- NetworkX (with nx-arangodb & nx-cugraph): Materializes and processes the graph in memory. Notably, GPU acceleration with cuGraph was successfully achieved using Google Colab, significantly enhancing performance for large-scale computations.
- ArangoDB: Stores the flight dataset as a graph.
- Natural Language Processing:
- LangChain & LangGraph: Translate queries into either AQL or Python code.
- Dynamic Code Execution:
- Implements error detection and iterative code correction loops to ensure robust execution of generated NetworkX code.
- Visualization & UI:
- Matplotlib & Gradio: Generate plots and provide an interactive, real-time interface with detailed logs using the Rich library and ansi2html.
Challenges we ran into
Combining multiple advanced technologies (graph databases, network analysis, and language models) required careful orchestration. Here are some key challenges:
- Dynamic Code Execution: Generating and executing Python code on-the-fly with error correction was challenging. Ensuring that dynamically generated code runs reliably required implementing robust error handling and iterative correction loops.
- Divide-and-conquer- Hybrid workflow: Orchestrating multiple layers (AQL, NetworkX, and LLMs) into a seamless divide-and-conquer framework.
- User Experience: Developing an intuitive Gradio UI that effectively displays both textual results and visualizations, while also providing real-time internal logs, took thoughtful design and testing.
Accomplishments that we're proud of
- Hybrid Query Processing:
- Successfully decomposing complex queries into manageable sub-tasks and synthesizing the results into a concise answer.
- Robust Integration:
- Seamlessly integrating ArangoDB, NetworkX, LangChain, and LangGraph into a unified system.
- Interactive Visualization:
- Developing an interactive Gradio UI that not only outputs text-based answers but also dynamically generated visualizations.
- Real-time Debugging & Logs:
- Implementing a detailed logging mechanism using the Rich library and ansi2html, offering insights into the chain-of-thought behind each query response.
What we learned
Throughout this project, we gained invaluable insights into:
- Graph Databases & Analytics: The power and flexibility of graph databases like ArangoDB and how in-memory processing with NetworkX can uncover hidden patterns.
- Natural Language Processing: How LLMs can be harnessed to make complex pipelines with the help of langchain and langgraph
What's next for Flight Graph Insights: A Divide-and-Conquer Strategy
Looking ahead, several exciting opportunities await:
- Improved Visualizations: Incorporating additional visualization libraries and interactive dashboards for a richer user experience.
- Broader Applications: Exploring how the underlying technology can be adapted to other domains with complex network data beyond flight information.
Built With
- ansi2html
- ansi2html-data-handling:-pandas
- arango-datasets
- arangodb
- gradio
- jupyter
- langchain
- langchain-openai
- langchain-openai-visualization:-matplotlib
- langgraph
- matplotlib
- networkx
- notebook
- numpy
- nx-arangodb
- nx-cugraph
- nx-cugraph-(gpu-accelerated)-natural-language-processing-&-code-generation:-langchain
- openai
- pandas
- plotly
- plotly-user-interface:-gradio-logging-&-debugging:-rich
- python
- rich
- seaborn
Log in or sign up for Devpost to join the conversation.