Case study · Analytics & AI · Finance
Genie Agents - ROIC & P&L
A conversational agent built with Databricks Genie, focused on financial data and performance indicators, especially ROIC (Return on Invested Capital) and the P&L (income statement, DRE in Brazil).
The idea was to let users query financial information with natural-language questions, reducing reliance on hand-written SQL and on navigating traditional dashboards.
- Databricks Genie
- Unity Catalog
- SQL
- Parquet
- Prompt Engineering
Agent goal
Build a conversational interface that answers questions about the company's financial performance, letting people explore indicators, accounting results and period-over-period comparisons without knowing how the tables are structured. Examples of questions this kind of agent can handle:
- What was this month's ROIC?
- What is the cumulative ROIC over 3 months? 6 months? Year to date? All time?
- How did ROIC change versus the previous month?
- What is the year-to-date net revenue?
- Which accounts had the biggest impact on the P&L result?
- How do actuals compare with the budget?
- What were the main financial variances between periods?
These examples illustrate the intended functional scope, not necessarily a list of questions whose execution was validated in the project.
Data preparation and modeling
The project built on the data engineering work done on the ROIC and P&L data, including data delivered as Parquet files and stored in Unity Catalog Volumes. Preparation steps included:
- Standardizing financial and accounting fields.
- Organizing dimensions such as general ledger account, profit center and P&L groupings.
- Prompt engineering to give context to the measures.
This preparation is what lets Genie query structured data and correctly interpret periods and financial dimensions.
Genie configuration
Databricks Genie was used as the natural-language layer over corporate data. The functional focus was enabling queries over two main, completely different domains:
| Domain | Fact table |
|---|---|
| ROIC | FT_ROIC |
| DRE | FT_DRE |
For this kind of solution to work well, it is essential to describe tables and columns, give context to the financial metrics and set rules for how questions are interpreted. That reduces ambiguity and produces SQL that better matches business rules.