Kipper

SQL vs. RAG for Financial Data: When Each Approach Works

SQL and RAG solve different problems. See why structured finance questions need queries, where vector search helps, and how to build AI answers people can check.

Team Kipper · October 21, 2026 · 10 min read
On this page +

See it live

Ask your finance system anything.

Invoices, AR aging, unpaid bills, payments.

Schedule free onboarding

No signup. Runs in your browser.

When somebody asks, “Which customers still owe us money?”, there are two very different ways an AI system might try to answer.

It could search documents that mention customers, invoices, and payment status. It would pull the passages that look most relevant. Then a language model would write an answer from them.

Or it could treat the question as a structured request. Find the open invoices. Join them to customers and payments. Apply the date and status filters. Add up what’s still owed.

Those approaches are often described as RAG versus SQL. The choice matters in finance because “sounds like the right answer” and “is the number in the books” are not the same standard.

The useful conclusion is not that one technology replaces the other. RAG and structured queries solve different problems:

  • RAG is well suited to documents. It can retrieve a travel policy, a contract clause, or an accounting procedure.
  • SQL is well suited to records. It can filter, join, aggregate, and return the rows and figures that exist in a database.

The best finance assistants use the method that matches where the answer actually lives.

Which one to use

Start with structured data and a query when the question asks for a number, a date, or a status. The same goes for a list of records or a comparison across transactions.

If the question asks what a policy says, what a contract permits, or how a process works, retrieve the relevant documents.

The mistake is treating a transaction database as if it were a document library.

What RAG actually does

Retrieval-Augmented Generation, or RAG, gives a language model a set of passages to use while composing an answer. A typical pipeline looks like this:

  1. Documents are split into chunks.
  2. The chunks are converted into embeddings.
  3. A user question is converted into an embedding.
  4. Vector search retrieves chunks that are semantically similar.
  5. The language model reads those chunks and writes a response.

This is a sensible design for questions such as:

  • “What is our approval limit for software purchases?”
  • “Can a contractor use the company card for travel?”
  • “What does the renewal clause in this supplier contract say?”
  • “How do we handle an employee reimbursement?”

The answer is in prose, so finding the right prose is the main challenge.

RAG can also be part of a finance application. A finance assistant might retrieve the company’s expense policy, then use a structured system to check a transaction against that policy. The two technologies can work together.

Why transaction questions are different

Financial records aren’t just text. They have relationships, types, dates, statuses, amounts, permissions, and accounting meaning.

Consider the question:

Which customers have invoices more than 60 days overdue, and what is the total outstanding balance for each?

To answer it reliably, a system needs to:

  • find the invoice records, not passages that mention invoices
  • pick the reporting date
  • calculate the age of each unpaid invoice
  • account for payments and credit memos
  • group the results by customer
  • sum the remaining balances
  • apply the asker’s permissions
  • return the records supporting each total

Semantic similarity can help locate a relevant invoice description. It doesn’t, by itself, perform the accounting operation above. Retrieving the five most similar passages is not the same as retrieving every qualifying invoice.

That distinction becomes more important as the question involves more records. A useful finance answer often requires a complete set, not a handful of representative examples.

Where vector search can go wrong

Vector search isn’t “wrong” because it’s probabilistic. It’s wrong when it is used for a task that requires exhaustive, typed, or relational operations.

It can retrieve relevant text without retrieving every relevant record

A vector index is generally optimized for relevance. A financial total is usually optimized for completeness.

If a user asks for total unpaid bills, returning the most semantically similar bills isn’t enough. One omitted bill changes the answer.

It does not inherently enforce arithmetic

A retrieved passage may contain an invoice amount, but a model still has to combine multiple amounts, payments, credits, and dates. The resulting arithmetic may be right, but the retrieval layer does not guarantee it.

It can blur time boundaries

“Revenue last quarter” and “revenue as of the last day of last quarter” are different questions. A document chunk rarely carries the full semantics needed to resolve that difference. A structured query can express the date boundary explicitly.

It can confuse similar entities

Two customers can have similar names. A vendor and a customer can share a trading name. A product can appear in both an invoice and a purchase order. Typed IDs and relationships are safer than relying on textual similarity alone.

It can make permissions harder to reason about

The retrieval system must ensure that unauthorized records never enter the model context. That is possible, but it needs to be designed and tested carefully. A database query with access controls enforced at query time gives the permission boundary a more explicit place to live.

None of these limitations make RAG useless. They explain why it should not be the only data layer for transactional questions.

What a structured query contributes

A structured query doesn’t ask, “Which text looks similar to this question?” It asks the data source to apply a defined operation.

Depending on the system, that operation may include:

  • filtering records by status, date, account, or entity
  • joining related records
  • grouping by a real field such as customer, class, department, or tracking category
  • calculating a sum, count, balance, or difference
  • sorting and paginating results
  • returning the source rows used in the calculation

The result is still limited by the quality and coverage of the underlying data. A query cannot repair an unreconciled ledger or infer a missing transaction. It does make the retrieval step inspectable and repeatable.

That is the important distinction: structured querying improves the reliability of the data-retrieval step; it does not make the entire AI system infallible.

What the language model does in a query-based assistant

A query-based finance assistant still uses a language model. The model may:

  1. interpret the user’s wording
  2. identify the records and fields involved
  3. generate or select a query
  4. explain the returned results in plain English

That means query generation needs controls. A production system should handle ambiguity explicitly and validate the query’s shape. It should enforce permissions before any data comes back. And it should say when an answer is outside the data it supports.

The model should not be the source of the number. It should be the interface to the system that owns the number.

This is also why claims such as “SQL means 100% accuracy” are too strong. A query can return an exact answer to the wrong question. A synced copy can be behind the source system. A finance system can contain an error. The honest claim is narrower and more useful. The figures come from a structured query over the available records. A model isn’t guessing them from text.

Using both where each fits

There is no need to choose one retrieval method for every kind of finance information.

User question Best primary source Why
“Which invoices are overdue?” Structured records Requires status, dates, balances, and a complete result set.
“What did we pay this vendor last month?” Structured records Requires filtering and aggregation over payment records.
“What is our travel approval limit?” Policy documents The answer is written in a policy, not stored as a transaction.
“Does this contract allow auto-renewal?” Contract documents The answer depends on a clause in prose.
“Show travel spend and explain the policy behind it.” Both Query the transactions, then retrieve the policy.

The last type is common in real finance work. A system can query the actual spend and retrieve the relevant policy. Then it can show which part came from records and which came from documents.

Keeping those sources distinct makes the answer easier to check.

What this means for Kipper

Kipper answers questions about supported NetSuite, QuickBooks, and Xero records. It turns a plain-English question into a structured query. The query runs against a synced copy of your finance data. Kipper applies the configured access boundary, then returns the records or figures the query produced.

That makes it a fit for questions such as:

  • “Which invoices from Acme are still unpaid?”
  • “What did we pay this supplier last month?”
  • “Show open purchase orders by vendor.”
  • “How much is outstanding by class?”
  • “Which items are below the quantity-on-hand threshold?”

Kipper returns records and figures. It doesn’t do general-ledger workflows, reconciliation, budgeting, or financial-ratio analysis, and it doesn’t forecast. Those stay in the finance system or with the AI assistant you use alongside it, which can project forward from the figures Kipper returns. A projection like that is the assistant’s, not something the books produced.

Stating that scope up front makes the tool easier to trust. You know what it can answer and where each result came from.

Kipper is read-only by architecture. The connected finance system is the source of truth. Kipper’s role is to make supported records easier for authorized people to ask about from the tools they already use.

How to evaluate an AI finance assistant

Ask these questions before looking at a feature list:

Where does the answer come from?

Is it retrieved from documents, queried from records, calculated by the model, or some combination? The answer should be visible at the level that matters.

Does the system retrieve completely?

For totals and lists, ask how it knows it found every qualifying record, not just the most relevant examples.

Can you inspect the supporting records?

A finance user should be able to move from an answer to the invoices, payments, bills, or other records behind it.

Where are permissions enforced?

Permissions should be applied before data reaches the model, not only described in a prompt. Ask whether access is checked for every question and whether activity is logged.

What happens when the data cannot answer?

The safest response isn’t an estimate. It’s a clear statement that the data, scope, or supported records are insufficient.

How current is the data?

“Real-time” can mean different things. Ask how the source is synchronized, what the delay is, and whether the answer displays when the data was last refreshed.

How to choose between SQL and RAG

RAG isn’t a failed technology, and SQL isn’t a magic guarantee. They’re retrieval methods for different kinds of information.

Use RAG to find the policy, contract, procedure, or explanation. Use structured queries to find the invoice, payment, balance, or record set. Combine them when the user needs both the number and the rule behind it.

For finance teams, the important design principle is simple:

Let the model interpret the question and explain the result. Let the system that owns the records provide the facts.

That separation doesn’t remove every possible error. It makes the errors easier to detect, the permissions easier to govern, and the answer easier to check before somebody relies on it.

FAQ

Is RAG bad for financial data?

No. RAG is useful when the answer lives in documents such as finance policies, contracts, or accounting guidance. It is a poor primary retrieval method for questions that require exact filters, joins, totals, or comparisons across transaction records.

Does SQL eliminate AI hallucinations?

No. SQL can make the data-retrieval step exact. The full answer can still be wrong, though. The question might be misread, or the data might be stale or incomplete. Permissions might be set wrong. Or the model might misstate what the query returned.

When should an AI finance assistant use SQL instead of RAG?

Use a structured query when the answer is a value or a set of records. Think of an unpaid invoice, a vendor total, an AR aging list, or a payment date. Use RAG when the answer is written in prose, like a policy rule, a contract term, or an accounting procedure.

Why can vector search struggle with financial questions?

Vector search retrieves text that is semantically similar to the question. It doesn’t calculate a reliable total on its own. It doesn’t enforce a date boundary or join invoices to payments. And it can’t tell whether it found every relevant record. Those operations belong in a structured query layer.

How does Kipper answer questions about finance records?

Kipper translates a plain-English question into a structured query against a synced, permissioned copy of supported NetSuite, QuickBooks, or Xero records. It returns the records or figures produced by that query and does not use document retrieval as the data-retrieval step.

Sources

Ask your finance data anything.

Kipper connects NetSuite, QuickBooks, and Xero to the tools your team already uses.

Prefer to try it yourself? Start a free trial .