Retrieval-Augmented Generation

A knowledge layer that never invents a number.

Generic chatbots hallucinate figures — unacceptable when the subject is a dealer's outstanding balance. Our RAG layer pairs a curated, reviewed knowledge base with grounded database queries, so every answer is both fluent and provably correct.

Grounded answer
Do I have any invoices pending this week?
Yes — 3 invoices are pending between 8th and 12th June. Total pending is ₹4,20,000.

count

SQL

sum

SQL

phrasing

LLM

The database computes the figures. The model only phrases them.

0
Numbers invented by the AI
Every total comes from SQL
Top-3
Curated matches per query
Above a confidence floor
0.78
Similarity threshold
Below it → fall back to tools
4
Languages understood
Paraphrase-expanded recall

The retrieval pipeline

From a dealer's words to a provable answer.

1

Question

A dealer asks in their own words, in any supported language.

2

Embed

The question is converted to a semantic vector and cache-checked.

3

Retrieve

Cosine similarity finds the closest curated knowledge entries.

4

Gate

Only matches above the confidence threshold are accepted.

5

Ground

The matched entry's rules drive a precise SQL query — the database does the math.

6

Compose

The answer is rendered into the entry's approved output template.

Inside a knowledge entry

Every entry is a small, governed contract.

A knowledge entry is far more than a question-and-answer pair. It carries the paraphrases that widen recall, the strict rules that protect financial integrity, the exact query that fetches the facts, and the approved template the answer must follow. Here is a real one.

1 Canonical question

Do I have any invoices pending this week?

2 Paraphrases (recall)

Do I have any invoices pending this month? · Do I have any invoices pending next week?

3 Strict rules (governance)

Financial totals must NEVER be calculated by the model. invoice_count, min_date, max_date and total_pending_amount MUST come from SQL aggregation. Run two queries — summary + rows. Only transaction_type = 'INVOICE'.

4 Grounded query (the database does the math)
SELECT count(*) AS invoice_count, min(payment_due_date) AS min_date,
       max(payment_due_date) AS max_date, sum(payment_due) AS total_pending_amount
FROM payment_followup
WHERE transaction_type = 'INVOICE' AND ...dealer scope...
5 Approved output template
"Yes, [invoice_count] invoices are pending between [min_date] and [max_date]."

  invoice no | amount | due date | pd1 | pd2 | pd3

Total pending amount is [total_pending_amount]

Financial integrity

Six guardrails that make the answers trustworthy.

The model never does math

Counts, sums, minimum and maximum dates always come from SQL aggregation — never derived by the language model from table rows.

Template-controlled answers

Each entry ships an approved output format. The AI fills the blanks; it does not improvise structure, tone or numbers.

Scoped to the dealer

Every retrieval and query is bound to the dealer's own account — no cross-account data can surface.

Type-scoped queries

Rules pin queries to the right records — invoices, credit memos or debit memos — so categories never blur.

Curated, not crawled

The knowledge base is hand-authored and reviewed, so answers reflect Berger policy rather than whatever a crawler found.

Graceful fallback

If no curated entry is confident enough, the agent falls back to its live data tools instead of guessing.

The knowledge base

Curated entries, expanding over time.

Admins author and review entries in the console; each is indexed with its paraphrases so the agent recognises the same intent however a dealer phrases it. A sample of the live catalog:

01

Which invoices are due for PD?

Joins payment data to customer master; only future PD dates.

+3 paraphrases
…for PD1?…for PD2?…for PD3?
02

Do I have any invoices pending this week?

Two-query pattern: SQL summary + row detail.

+2 paraphrases
…this month?…next week?
03

What are CNs and DNs?

Separate queries per type; never definitions, always the dealer's own records.

+8 paraphrases
What are CNs?What are DNs?credit notescredit memosdebit notesdebit memosList credit notesList debit notes
04

What are the payment modes available?

Mode depends on how billing was done — RTGS or Cheque / RTGS.

05

What is the total outstanding in my account?

Single grounded figure, scoped to the dealer's account.

Why it matters

The business case for governed retrieval.

Grounded retrieval is what separates a dependable enterprise agent from a chatbot that improvises. For a receivables conversation, that distinction is the difference between trust and liability.

Brand protection

No hallucinated figures or off-policy commitments ever reach a dealer.

Audit readiness

Every retrieval and answer is logged and replayable for review.

Operational agility

Business teams update the knowledge base — no code changes or model retraining.

Dealer trust

Consistent, policy-accurate answers, in the dealer's own language, build credibility.

Institutional knowledge

The knowledge base becomes a living, owned asset that compounds over time.

Answers at scale

Grounded, instant responses across the entire dealer base, around the clock.

One source of truth

One approved answer, every language.

Dealers ask in English, Hindi, Gujarati or Bengali. Rather than maintain a separate knowledge base per language, the agent normalises every question to its underlying meaning, retrieves from a single curated source, and answers back in the dealer's language — so there is no translation drift and no per-language inconsistency.

1

Transcribe

Speech is captured in the dealer's own language.

2

Normalize

Meaning is mapped to a language-agnostic representation.

3

Retrieve once

A single curated source of truth answers — whatever the language.

4

Speak native

The approved answer is rendered back in the dealer's language.

Continuously improving

A knowledge base that closes its own gaps.

Because entries are curated and reviewed — not scraped — coverage grows without diluting accuracy. Every conversation feeds a loop that turns yesterday's unanswered question into today's confident answer.

1

Conversation completes

Each interaction is classified by outcome and logged.

2

Gaps surface

Low-confidence or unanswered questions are flagged for review.

3

Admin curates

A reviewer adds or refines the entry — question, rules and template.

4

Everyone benefits

Auto-embedded, the corrected answer serves the very next dealer.