# Leveraging RAG-powered LLMs for analytical tasks

[Grab](https://yomu.fyi/company/grab) · Edmund Hong · Oct 9, 2024

**Type:** Problem & solution

## Summary

Data analysts at Grab faced an increasing volume of stakeholder data requests that required manually writing and executing repetitive SQL queries with minor parameter changes. To automate routine tasks like metric reporting and fraud investigations, the Integrity Analytics team paired an internal prompt-management platform, Spellvault, with Data-Arks, an in-house Python-based middleware that packages SQL queries and Python functions into APIs. A scheduler triggers automated report summarization, while an analytical bot named A\* bot executes relevant investigation queries via RAG and returns summarized findings in Slack. Automated report generation saves an estimated three to four hours per report and shortens multi-query fraud investigations to minutes. Grab favored RAG over fine-tuning because it avoids continuous retraining costs, scales faster across diverse use cases, and surfaces current production data.

## Context

Data analysts struggled with a growing number of stakeholder data requests, spending substantial time manually writing and executing similar SQL queries with minor parameter modifications for recurring reports and fraud investigations.

## Approach / What changed

Grab integrated Spellvault, an internal prompt-management and low-code RAG platform, with Data-Arks, a Python API middleware that turns uploaded SQL queries and scripts into callable endpoints, orchestrating tasks via a scheduler and Slack bots.

## Takeaways

- The automated Report Summarizer calling Data-Arks APIs and LLM summarization saves an estimated 3 to 4 hours per report.
- Data-Arks integrates with Slack, Wiki, and Jira APIs, enabling employees across teams to self-serve by turning custom SQL queries and Python scripts into callable APIs.
- Grab selected RAG over fine-tuning to eliminate expensive model retraining cycles and allow LLM applications to retrieve real-time data directly from production databases.

**Tags:** [LLMs](https://yomu.fyi/topic/llm), [Python](https://yomu.fyi/topic/python), [REST APIs](https://yomu.fyi/topic/rest-api)

[Read original post](https://engineering.grab.com/transforming-the-analytics-landscape-with-RAG-powered-LLM)
