Introducing Our New Intelligent Database Agent

By 
Shivay Nagpal & Ellen Björnberg
January 23, 2026

Turning Your Questions into Answers, Faster

The biggest challenge in modern enterprises isn’t a lack of data - it’s the speed at which meaningful insights can be extracted from it.

Answering a business question like “Which campaigns are driving the highest ROI?” or “Which customers contribute the most to long-term revenue?” often triggers a manual workflow. A request is sent to a data analyst, translated into database queries (structured instructions that tell the database what data to retrieve), executed, validated, refined, and finally summarized before reaching decision-makers.

This process works - but it creates delay, context switching, and a growing dependency on specialized analysts. As organizations scale, this becomes a structural bottleneck.

Our Database Agent was built to reduce this friction by automating not just query generation, but the reasoning process analysts typically perform manually.

Beyond simple query translation

Natural-language-to-SQL systems; tools that convert human questions into database instructions - are not new. Most treat the problem as a one-shot translation: convert the question into a query, run it, and return the result.

This approach breaks down quickly in real analytical work.

Data analysts don’t operate in single passes. They reason. They inspect results, notice inconsistencies, adjust assumptions, and rerun queries. Much of their value lies not in writing SQL itself, but in recognizing when the first answer is incomplete, misleading, or misaligned with the business question.

Instead of treating analysis as translation, our Database Agent  treats it as an iterative decision-making process - executed through database queries but guided by analytical judgment. Under the hood, this follows a hierarchical workflow based reasoning pattern, where planning, execution, evaluation, and refinement are treated as explicit steps rather than a single prompt–response cycle.

The architecture

The Database Agent is built as a multi-step reasoning system rather than a single execution pipeline. Instead of moving directly from question to query, it decomposes each request into distinct stages that mirror how experienced analysts approach complex analysis.

At a high level, the system follows a structured workflow:

• understanding the user’s intent

• deciding whether the task can be answered with structured data

• generating and executing database queries

• evaluating whether the result satisfies the original question

• refining the approach when it does not

Each step has a clearly defined responsibility, allowing the agent to reason, adapt, and stop when necessary instead of forcing an answer.

This architecture is what enables iteration, traceability, and controlled execution -  all properties that are typically enforced manually by experienced analysts.

From business intent to executable reasoning

When a user asks a question, the agent does not immediately generate SQL.

It first performs intent analysis - determining what the user actually wants to know, not just what they literally typed. For example, is this:

• a simple lookup?

• a ranking or comparison?

• a multi-step analysis requiring several queries?

This mirrors what an analyst does before writing a query: clarifying the goal before touching the data.

Once the intent is understood, the agent generates SQL that pushes computation into the database itself, using aggregations, grouping, and analytical functions (ways of summarizing large datasets directly inside the database). This SQL-first approach ensures that the heavy calculations happen close to where the data lives, instead of exporting massive datasets for external processing.

Iterative execution and self-evaluation

Where traditional tools stop after returning the first result, our Database Agent evaluates its own output.

It asks questions like:

• Did this result actually answer the business question?

• Is the structure of the output aligned with the intent?

• Does the answer seem incomplete or misleading?

If needed, it refines its approach and executes another query.

This replicates the back-and-forth that normally happens between analysts and stakeholders - but compresses it into seconds, without meetings, tickets, or manual rework.

Importantly, the agent also knows when to stop. If repeated attempts fail due to missing data, incompatible table structures, or invalid assumptions, it marks the task as impossible rather than returning a guess.

Knowing when not to answer is treated as a first-class capability, not an error state. This prevents false confidence; a common risk in automated analytics.

Managing data scale, shape, and cognitive load

One of the hardest problems in automated database analysis isn’t correctness - it’s output control.

Some database tables are narrow and can safely return many rows. Others are wide, containing dozens of columns, where returning too much data would overwhelm both the system and the reader.

The Database Agent addresses this using token-based dynamic truncation. In simple terms, it estimates how much information can be safely returned based on the size and structure of the data, and dynamically adjusts output size accordingly. This is necessary because fixed row limits fail in practice when table width varies significantly.

In practice, this ensures:

• enough data to understand context

• not so much data that results become unreadable

• consistent usability across very different datasets

This replaces a common manual analyst task: trimming, sampling, and reshaping large result sets so they are interpretable.

Detecting when a question cannot be answered

An intelligent system must know its limits. Some questions cannot be answered through database analysis alone - for example, requests that require prediction, sentiment analysis, or information not present in structured data. The Database Agent detects these cases early and explains why the task cannot be completed, instead of producing misleading results.

This mirrors how experienced analysts operate: knowing when data cannot support a reliable conclusion.

​​Full traceability and analyst-grade transparency

In enterprise environments, answers must be auditable. Every database query executed by the agent generates a numbered reference with execution metadata. Final conclusions explicitly cite these references, allowing users to trace any statement back to the exact data operations that produced it.

This transforms the agent from a black box into a transparent reasoning system - much like an analyst showing their work.

Security through hard technical boundaries

Automated database access carries inherent risk. To mitigate this, the Database Agent enforces strict read-only execution at the database layer. Any query that attempts to modify data, such as deleting or updating records, is blocked before execution.

From manual analysis to data reasoning

The Database Agent is not designed to replace data analysts, but to change how their expertise is applied. By removing repetitive manual work such as translating routine questions, iterating on basic queries, and producing one-off summaries, analysts regain time for deeper modeling, strategic analysis, and work that requires human judgment. At the same time, business teams gain faster access to trustworthy answers without bypassing analytical rigor.

At a systems level, this represents a shift in how organizations interact with data - from one-shot query generation to iterative reasoning, from analyst bottlenecks to automated analytical workflows, and from opaque outputs to traceable, explainable conclusions. 

The Database Agent is not just a text-to-SQL tool; it is a reasoning engine that happens to speak SQL.

Learn more