This project explores the use of Large Language Models (LLMs) to replace traditional Business Intelligence (BI) and Risk department workflows. The goal is to leverage LLMs for querying and interpreting data, providing insights, and integrating these capabilities into user-friendly interfaces like web apps and Slack.
The journey began with generating fake data to simulate real-world scenarios. This was done in the development/generate_data directory. The generated data served as the foundation for testing and validating the LLM-based approaches.
The first attempt to use LLMs for BI and Risk tasks is implemented in 1_naive_approach.py. This script demonstrates a basic approach to querying and interpreting data using LLMs. While it worked to some extent, it lacked a user-friendly interface and had limited functionality.
To improve usability, a UI was added using Chainlit in 2_chainlit_test.py. This allowed users to interact with the LLM through a web-based interface. The Chainlit app worked well and provided a more intuitive way to query and analyze data.
Building on the success of the Chainlit app, the functionality was extended to Slack in 3_slack_app.py. This integration enabled users to interact with the LLM directly within Slack channels. While the Slack app worked, it faced challenges related to governance, model teaching, and scalability.
To address the limitations of the Slack app, the project transitioned to using Databricks Genie. Genie provides a robust platform for managing data governance and teaching models, making it a more suitable solution for enterprise use cases.
- Data Querying: Use LLMs to generate SQL queries and retrieve data.
- Data Interpretation: Provide natural language explanations of query results.
- User Interfaces: Interact with the system via a web app (Chainlit) or Slack.
- Databricks Genie: Leverage Genie for enhanced governance and model management.
- Generate Data: Start by generating fake data in the
development/generate_datadirectory. - Naive Approach: Test the basic functionality using
1_naive_approach.py.python 1_naive_approach.py - Chainlit App: Run
2_chainlit_test.pyto use the web-based UI.chainlit run 2_chainlit_test.py -w - Slack App: Deploy
3_slack_app.pyto integrate with Slack. This is way more complex since you need to create a tunnel to your local machine or deploy it on a server. - Databricks Genie: Use the Databricks Genie integration for advanced features. Sorry my personal account
- Governance is Key: Proper governance and model management are critical for enterprise adoption.
- Iterative Development: Starting with a naive approach and iterating through UI and integrations helped refine the solution.
- LLM Potential: is future of BI