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.
Retrieval-Augmented Generation
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.
count
SQL
sum
SQL
phrasing
LLM
The database computes the figures. The model only phrases them.
The retrieval pipeline
A dealer asks in their own words, in any supported language.
The question is converted to a semantic vector and cache-checked.
Cosine similarity finds the closest curated knowledge entries.
Only matches above the confidence threshold are accepted.
The matched entry's rules drive a precise SQL query — the database does the math.
The answer is rendered into the entry's approved output template.
Inside a knowledge entry
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.
Do I have any invoices pending this week?
Do I have any invoices pending this month? · Do I have any invoices pending next week?
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'.
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... "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
Counts, sums, minimum and maximum dates always come from SQL aggregation — never derived by the language model from table rows.
Each entry ships an approved output format. The AI fills the blanks; it does not improvise structure, tone or numbers.
Every retrieval and query is bound to the dealer's own account — no cross-account data can surface.
Rules pin queries to the right records — invoices, credit memos or debit memos — so categories never blur.
The knowledge base is hand-authored and reviewed, so answers reflect Berger policy rather than whatever a crawler found.
If no curated entry is confident enough, the agent falls back to its live data tools instead of guessing.
The knowledge base
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:
Joins payment data to customer master; only future PD dates.
Two-query pattern: SQL summary + row detail.
Separate queries per type; never definitions, always the dealer's own records.
Mode depends on how billing was done — RTGS or Cheque / RTGS.
Single grounded figure, scoped to the dealer's account.
Why it matters
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.
No hallucinated figures or off-policy commitments ever reach a dealer.
Every retrieval and answer is logged and replayable for review.
Business teams update the knowledge base — no code changes or model retraining.
Consistent, policy-accurate answers, in the dealer's own language, build credibility.
The knowledge base becomes a living, owned asset that compounds over time.
Grounded, instant responses across the entire dealer base, around the clock.
One source of truth
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.
Speech is captured in the dealer's own language.
Meaning is mapped to a language-agnostic representation.
A single curated source of truth answers — whatever the language.
The approved answer is rendered back in the dealer's language.
Continuously improving
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.
Each interaction is classified by outcome and logged.
Low-confidence or unanswered questions are flagged for review.
A reviewer adds or refines the entry — question, rules and template.
Auto-embedded, the corrected answer serves the very next dealer.