All projects

N9/06AI & agentsFintechComplexity: Advanced

2nd Runner-UpAI Build 2026, Vijayawada24+ hour offline hackathon · 1,039 students from 75+ colleges

Khata

A live co-pilot for sales calls: it checks every number a rep quotes against the real product rules and corrects mistakes in about a second.

Status
Live demo
Year
2026
Built for
AI Build 2026 · Vijayawada · Team Code Catalyst
Languages
TypeScript, SQL, CSS
Team
Sujal Negi, Vaishnavi C R
01

Overview

Khata listens to the sales rep’s side of a call about a pay-in-3 / zero-cost EMI product. It pulls out each factual claim the rep makes (a fee, an interest rate, a document needed) and checks it against a version-controlled source of truth. If a claim is wrong, the rep sees it within about a second, with a corrected sentence they can read out.

Every call ends with a “khata”: an audit receipt of each claim, its verdict and the exact rule that decided it. Managers see every rep’s record; reps see their own. With the rep’s approval, the call outcome and the next step, such as when to call the customer back, go into the CRM.

02

Problem and aim

Problem

Sales reps quote fees and rates from memory. A wrong number, or last quarter’s price, misleads the customer and creates compliance risk, and nobody notices until a complaint arrives.

Aim

Catch misquotes during the call, not after it, and leave a trustworthy record of what was said.

03

How it works

01 / 06

Listen

The browser listens only to the rep’s microphone. The customer’s audio never reaches the system.

02 / 06

Redact

Phone numbers, Aadhaar, PAN, email and the customer’s name are removed in the browser before anything is sent, while amounts like ₹199 or 14% are kept.

03 / 06

Extract

A language model turns each sentence into a structured claim, for example “processing fee, 3-month plan, ₹199”. That is its only job.

04 / 06

Adjudicate

Deterministic code compares the claim with the product spec and returns VERIFIED, WRONG, STALE (true under an old price list) or UNSUPPORTED, in milliseconds.

05 / 06

Correct

For a WRONG claim, a correction is drafted, then re-checked by the same code. If it fails, a template is used; if that fails, only the correct figure is shown.

06 / 06

Record

The khata is hash-chained and encrypted. With the rep’s approval, whitelisted CRM fields such as the objection and next step are updated.

04

Architecture

Next.js app: browser, server and a source of truth

ABrowser

  • ConsoleThe live call screen (sales reps only).
  • Speech + redactionWeb Speech API, then personal details removed before sending.
  • DashboardsAnalytics, call reviews, rep records.

BNext.js server

  • API routes/api/triage → /api/extract → /api/correct, /api/classify, /api/close.
  • AdjudicatorDeterministic verdicts and EMI maths.
  • Access controlSigned sessions; role-scoped queries.

CData and models

  • SQLiteCalls and encrypted, hash-chained khatas.
  • product_truth.jsonThe versioned product spec.
  • Language modelOptional. Parses sentences only; offline stub if absent.

Request flow

  1. The rep speaks; the browser turns it into text and redacts it before any request.
  2. /api/triage asks: is there a claim here? /api/extract turns it into a structured claim.
  3. The adjudicator compares the claim with the spec and returns a verdict in milliseconds.
  4. For a wrong claim, /api/correct drafts a fix that is re-checked before it is shown.
  5. At the end, /api/close writes the khata and proposes CRM updates for the rep to approve.
05

Languages and code

  • TypeScript99.0%
  • SQL0.5%
  • CSS0.3%
  • JavaScript0.2%

Repository

62 files14,482 linesTap any file to read its code

  • app/Pages and API routes (Next.js App Router).
    • analytics/Team and personal records, one row per closed call.
      • 349 lines
    • api/triage, extract, correct, classify, close, bootstrap and sign-in routes.
      • auth/2 files
        • login/1 file
          • 99 lines
        • logout/1 file
          • 22 lines
      • bootstrap/1 file
        • 37 lines
      • classify/1 file
        • 117 lines
      • close/1 file
        • 376 lines
      • correct/1 file
        • 237 lines
      • extract/1 file
        • 280 lines
      • triage/1 file
        • 134 lines
    • calls/1 file
      • [callId]/Read-only review of one call or one rep.
        • 555 lines
    • console/The live call screen.
      • 30 lines
      • 2183 lines
    • dashboard/Team and personal records, one row per closed call.
      • 485 lines
    • login/1 file
      • 202 lines
    • product/The product spec page and the live-demo rehearsal sheet.
      • 414 lines
    • reps/1 file
      • [userId]/Read-only review of one call or one rep.
        • 323 lines
    • script/The product spec page and the live-demo rehearsal sheet.
      • 224 lines
      • 14 lines
    • 62 lines
    • 84 lines
    • 38 lines
    • 32 lines
    • 11 lines
    • 43 lines
  • data/product_truth.json (spec with archive), customers, CRM and rates.
    • 69 lines
    • 179 lines
    • 102 lines
    • 27 lines
  • db/1 file
    • SQLite tables. 67 lines
  • lib/The logic.
    • Who can see what, sign-in and signed sessions. 53 lines
    • Turns a claim into a verdict. Imports nothing from the model code. 592 lines
    • 26 lines
    • Who can see what, sign-in and signed sessions. 152 lines
    • 128 lines
    • Inbound call states and dashboard numbers. 130 lines
    • Writes the khata (hash chain, encryption) and the CRM proposal. 808 lines
    • The three-tier correction loop and its zero-config tests. 210 lines
    • 365 lines
    • 57 lines
    • All EMI, APR and total-payable maths. 141 lines
    • 128 lines
    • Model provider, and the deterministic offline parser. 455 lines
    • Inbound call states and dashboard numbers. 183 lines
    • Removes phone, Aadhaar, PAN, email and names, keeps amounts. 155 lines
    • The three-tier correction loop and its zero-config tests. 2079 lines
    • Who can see what, sign-in and signed sessions. 53 lines
    • Model provider, and the deterministic offline parser. 444 lines
    • 223 lines
    • 310 lines
  • scripts/Database set-up and demo reset.
    • 24 lines
    • 211 lines
  • 57 lines
  • 57 lines
  • 29 lines
  • 18 lines
  • 21 lines
  • Protects pages that need a signed-in user. 108 lines
  • 7 lines
  • 31 lines
  • 7 lines
  • 391 lines
  • 34 lines
06

Methodology

  1. Keep the model out of the decision: the AI parses, code decides.
  2. Treat “we could not check” as different from “nothing was wrong”, and record coverage for every call.
  3. Scope data by role in the database query itself, not in the page.
  4. Work without a model or network too, so verdicts stay correct during an outage.
07

Technology

AppNext.js + TypeScriptConsole, dashboards and API routes.
Web Speech APILive speech-to-text from the rep’s mic.
TrustDeterministic adjudicatorArithmetic, not inference, decides verdicts.
AES-256-GCMEncrypts each khata at rest.
SHA-256 hash chainMakes later edits to records detectable.
DataSQLiteCalls, khatas and role-scoped reads.
08

Demo

09

Concepts

01Why not let the AI decide what is true?

Models can get numbers wrong and sound confident. Khata uses the model only to read a sentence into a structured claim; a plain program does the comparison. If the model fails, verdicts are still correct.

02What is a hash chain?

Each record stores a fingerprint (SHA-256 hash) of itself plus the previous record’s fingerprint. Changing any old record breaks every fingerprint after it, so tampering is detectable.

03Why redact in the browser?

Data that never leaves the device cannot leak in transit or in a server log. Only the redacted sentence is sent for analysis.

04What is the difference between WRONG and STALE?

A STALE claim was true under an older price list, so the rep needs the new list. A WRONG claim was never true. They need different coaching.

10

Team