Self-Service Analytics with Generative AI

Slice & dice your data using natural language conversations.

Amit Sharma
Engineered @ Publicis Sapient
6 min readAug 7, 2024

--

Self service analytics tool

Problem Statement : “The Data Deluge Dilemma

Senior leaders within organizations are increasingly seeking data-driven insights to inform strategic decisions. However, they often face a significant hurdle: accessing relevant and actionable information on operations without relying on IT resources or lengthy development cycles.

This challenge arises from the growing volume of data being generated by various business functions, making it difficult for leadership teams to identify key trends, perform comparative analyses, and make informed decisions in a timely manner. As a result, they often struggle with getting the insights they need, leading to missed opportunities, delayed decision-making, and potential revenue loss.

Solution : Generative AI-based chat assistant trained on analytics sources using RAG pipelines.

This AI-driven platform empowers senior leaders to access relevant insights and perform complex analyses with the ability to interact with the system through natural language.

Unlocking Business Value

Enhanced Decision-Making: Senior leaders can interact with the interface using natural language queries, allowing them to explore data and gain insights without the need for technical expertise. This empowers them to make data-driven decisions quickly and effectively.​

Real-Time Performance Monitoring: The interface provides real-time updates on key performance indicators (KPIs) and metrics, allowing senior leaders to stay informed about the current state of operations. This enables proactive problem-solving and timely adjustments to strategies.​

Customized Analytics: With NLP capabilities, the interface can generate customized reports and analytics based on the specific needs and interests of senior leaders. This personalized approach ensures that they receive the most relevant and actionable insights.​

How We Brought Our Generative AI Project to Life:

A Journey through Data, Technology and Speed

In the ever-evolving landscape of technology, integrating Generative AI into workflows can be a game-changer. My team and I embarked on a project focused on harnessing the power of GPT (Generative Pre-trained Transformer) models to revolutionize our operations. Here’s a behind-
the-scenes look at how we transformed from AI novices to successfully launching our Generative AI-focused project, navigating the intricacies of data, technology and speed along the way.

Starting from Scratch: Our Initial Knowledge and Challenges

One of the key challenges was defining the Use Case, especially given previous vendor failures. By leveraging GPT’s expertise, we researched the client’s domain, generated multiple solution options, and aligned on scope and delivery in a short time. We differentiated our approach by previewing the specific questions GPT could answer, using sample data from similar clients. This highlighted our value and clarified the scope of work, demonstrating where our Gen-AI tool outperformed their existing BI platform.

Innovating with a Data Dictionary

Understanding the Problem

Directly inputting large datasets into GPT proved inefficient. We needed a method for GPT to understand and work with data without ingesting it all, leading us to the concept of a ‘data dictionary.’

Creating the Data Dictionary

In our context, a data dictionary serves as a system prompt for GPT. It includes names of SQL tables and the required column names representing our clients’ data structures, acting as a blueprint for data organization.

Implementing the Two-Call Approach

To optimize our process, we devised a two-step GPT call system:

  1. Initial Query Processing: The first GPT call reads the user’s prompt and consults the data dictionary to identify the relevant tables and columns needed to fulfill the request. GPT then generates an SQL query based on this information.
  2. Data Retrieval and Analysis: We execute the generated SQL query against our database to retrieve the necessary data. This data is then passed to a second GPT call, which performs a detailed analysis and provides insightful results back to the user.

This innovative approach allowed us to leverage GPT’s capabilities more effectively, making our application faster and more responsive.

Pillars of success

Enhanced User Experience

We showcased our ability to create a compelling front-end experience, including a GPT-like interactive feature, voice input, client branding, and configurable greeting prompts. By adding appropriate charts and graphs to each response, we provided parity with the existing BI tool alongside our unique differentiators.

Mastering Data Pipelines

One of the cornerstones of our project was setting up an efficient data pipeline. We chose data warehouse for this purpose, as it seamlessly combined data transformation and storage capabilities within a single service. This integration simplified our workflow significantly, allowing us to handle data more effectively and without the need for multiple tools.

Prompt Engineering

We focused on designing precise prompts for AI models to improve the quality of responses. Key principles included clarity, context provision and iterative refinement, which proved effective in various applications like content generation and data analysis.

Speed: The Competitive Edge

Here is where we ran into our main issue with GPT integration and data analysis. For our project, achieving responsive analysis in under 20–25 seconds was a significant challenge. Balancing model selection, deployment strategies and cost-effectiveness was key to maintaining this competitive edge.

The Lessons We Took Away

  1. Define the source of truth as early as possible in an engagement: Our client chose to compare the results from our application with their existing BI reports as the source of truth, rather than comparing with it with the actual data we were using in the application. So the team had to spend additional time dealing with the complexities of metrics and data sources being used by the existing BI reports. But after a thorough investigation, we demonstrated that the variations were within an acceptable range and provided clear explanations for them.
  2. Experimentation is Key: Don’t be afraid to experiment with different phrasings and structures. Sometimes, a small tweak can significantly enhance the output quality.
  3. Leverage Examples: Providing examples within the prompt can guide the model towards the desired response format. For example, “Your response should be this in JSON format: {“status”: 200, “analysis_response”: “Analysis indicates a low performing store for the next few months”}.”
  4. Stay Updated: The field of AI is continuously evolving. Just this week, GPT-4o came out free for all users to test out. Understanding the differences between each model and which one works best for your application is crucial. Engaging with the community through forums, webinars, and publications can provide valuable insights.
  5. Developing a Comprehensive Data Dictionary: To manage the complexity of our data and maintain consistency, we developed a data dictionary. This tool served as a centralized repository of definitions and mappings for our data, aiding in clear communication and streamlined processes across various project stages.
  6. Automating SQL Query Creation with GPT : One of the standout innovations in our project was using GPT to automate the creation of SQL queries. This capability not only enhanced our productivity, but also minimized errors, allowing us to focus more on analyzing and interpreting the data.

Conclusion

By leveraging Generative AI in this self-service analytics platform, we’ve empowered senior leaders to make data-driven decisions quickly and effectively, driving enhanced decision-making and real-time performance monitoring. This has led to significant business gains, including improved response times, reduced costs and increased productivity. Additionally, the customized analytics capabilities have provided personalized insights, enabling organizations to stay ahead of the competition.

Bringing a Generative AI project to life is a multifaceted endeavor that requires deep data management, sophisticated technological integration, and a relentless focus on speed. From grappling with the complexities of data to devising innovative solutions like the data dictionary and the two-step GPT call system, our journey was filled with valuable learnings and breakthroughs.

By partnering with Publicis Sapient, organizations can unlock the full potential of Generative AI and drive transformative business outcomes like such.

Authors :

Ravi : AI Engineer

Ensar : AI Engineer

VJ : Product Manager

Amit : Engineering Lead

--

--

Amit Sharma
Engineered @ Publicis Sapient

Certified Cloud Architect and an Expert with 18 yrs. of experience in the design and delivery of cloud-native, cost-effective, high-performance DBT solutions.