# NL2SQL

## Natural Language → SQL (NL2SQL) – the “ChatGPT” for your building data

With our NL2SQL module, you can access **everyday language** to all data in Eliona – with no SQL knowledge at all. A Large Language Model (LLM) translates your questions live into correct SQL queries, executes them, and returns the results immediately.&#x20;

<figure><img src="https://content.gitbook.com/content/Nyvwhz1kEMXcHf4HLuZ8/blobs/XPXJIvfc0kdJbC5alWth/AI%20Engineering%20-%201453.png" alt=""><figcaption></figcaption></figure>

***

## What is an LLM?

A **Large Language Model** like ChatGPT is a neural network pretrained on huge amounts of text. It understands relationships in language, answers questions, and can – with the right fine-tuning – also generate technical commands like SQL.

### How does NL2SQL work in Eliona?

1. **Enter question**\
   “When do I consume the most energy – and which five consumers are responsible?”
2. **LLM translation**\
   The model turns your request into an optimized SQL query, and through our **Smart Building Ontology** knows all assets and measurement points.
3. **Query & result**\
   You immediately see a table and graphical presentation.

***

## What problems does NL2SQL solve?

* **Data democratization**\
  Energy managers, CFOs, and technicians get **ad hoc** insights, with no BI training required.
* **Alleviating the skills shortage**\
  “Non-experts” handle simple analyses – up to **30% fewer** data engineer tickets.
* **Silo-free organization**\
  Combine site, cost, and emissions data in a single question.
* **Faster ROI**\
  Typical **80% time savings** for standard reports, payback usually under 3 months.

### Practical example

> **Question:** “How high was the peak power consumption in the last quarter, and which five systems contributed the most?”
>
> **Answer:**
>
> 1. Peak load: **310 kW** on May 12, 4:00 PM
> 2. Top 5 consumers: Ventilation Hall A (24%), Cooling Compressor C (18%), …

All results appear as a table plus an integrated bar chart.

***

## Data protection & transparency

* **On-premise LLM** – your data never leaves your network.
* **Chain of Thought**-explanations: Transparent insight into which assets and filters the LLM selected.
* **Safeguards:** If it is a write action or launching an app, the action is always shown to the user first and must be confirmed by them.

{% hint style="success" %}
With NL2SQL, Eliona makes your building data **so easy to access** as ChatGPT – fast, secure, and without lengthy SQL writing.
{% endhint %}
