GST Nirikshak - Turning Scattered Tax Data into Explainable Evidence
An offline analytics workbench for GST investigators: it brings more than ten kinds of tax, logistics, financial and legal data together on shared keys, so an officer can go from a first signal to a documented, explainable case in one place.
Data integrationGraph analyticsExplainable analyticsPython · DuckDBPrivacy by designAI-assisted development
Context: built in 2024 during my data analytics role in India’s indirect-tax administration, and handed over to the team before I left (see experience) · My role: creator and sole project lead, working under the guidance of senior authorities: idea, data research, specification, architecture, AI-assisted build and validation · The name:Nirikshak means “inspector” or “observer” in Hindi.
Network analysis in the app: a circular-trading ring (orange) and two units with cancelled registrations (dashed borders) passing credit to one beneficiary (square). Every name and figure is synthetic.
25+input file formats from more than ten kinds of source
80explainable checks in 15 rule packs
12modules following the investigator’s workflow
507automated tests against synthetic data with known answers
~53klines of Python, idea to version 1.0 in 15 milestones
GST produces rich data, but for an investigator building a case the pieces sit in separate portals, downloads and spreadsheets: returns, purchase statements, e-way bills, third-party reports, books, bank statements and a law that changes by notification. Joining them was manual, slow and hard to explain afterwards.
What I built
A desktop web application that runs entirely on the officer’s own PC. It recognises 25+ file formats, links them on shared keys in one case store, and runs reconciliations, screens, network and movement analysis and 80 rule-based checks, ending in ranked worklists, evidence-backed findings and reports.
My role
I took it from idea to a working, tested application: mapped the workflow, studied the data formats, wrote the build specification, designed the data model and architecture, built it in fifteen milestones with the AI coding assistants available at the time, ChatGPT (GPT-4) and GitHub Copilot, validated every module against synthetic data with known, planted problems, and handed it over to the team.
The result
A complete version 1.0, validated end to end on a synthetic demo zone with 20 cases and then handed over to the team for use before I left in 2024. Every figure traces back to its source rows, the rule that produced it and the legal provision, so a finding can be defended, not just displayed.
I ran GST Nirikshak as a project from start to finish: I proposed it, got it approved, worked out the requirements with the officers who would use it, wrote the specification, built it in fifteen planned milestones, proved it on synthetic data, prepared the team to use it, and handed it over before I left in August 2024.
Initiate2024 · proposal and approval
→
Plan2024 · workflow, spec, 15 milestones
→
Build2024 · milestone by milestone
→
Test and pilot2024 · 507 tests, demo zone
→
Train2024 · tour, manual, demo zone
→
Monitor2024 · milestone reviews, reporting
→
CloseAug 2024 · handover to the team
The full life cycle, owned end to end, under the guidance of senior authorities.
Owner
Creator and sole project lead: the idea, the specification, the plan, the build, the validation and the handover.
Sponsor and approval
Senior authorities approved the project and received progress reports; I worked under their guidance throughout.
Users and stakeholders
The investigating officers of the team who would use the workbench, and the senior authorities who would rely on its findings.
Decisions I owned
Scope and modules, the data model, the checks and their legal basis, the milestone plan, the quality bar of correct before complete, and the handover.
Phase
What I did
Output
Initiate
Saw that building a case meant pulling evidence from many portals and spreadsheets by hand; proposed an offline workbench that links them; obtained approval
Approved proposal
Plan
Mapped the investigator’s workflow with the officers who do the work, studied the structure of every data source, wrote a build specification (version 3.1) with acceptance tests, and split the build into fifteen milestones
Specification and milestone plan
Build
Built one milestone at a time with the AI coding assistants of 2024, ChatGPT (GPT-4) and GitHub Copilot, reviewing and integrating each milestone before the next began
Twelve working modules
Test and pilot
Built a synthetic data generator with planted problems, 507 automated tests and a demo zone of 20 cases that exercises every module, and ran the whole workflow end to end on it
Proven against known answers
Train
Prepared a guided first-run tour, a How-to page, a manual built into the app and the demo zone, so the team could learn on safe data
A team ready to use it
Monitor and control
Tracked progress milestone by milestone against the plan and kept senior authorities informed
Progress visible at every milestone
Close and hand over
Handed the application, its manual and its demo zone over to the team before I left in August 2024
Returns, statements, e-way bills, third-party reports and legal notifications arrive as PDF, Excel, JSON, CSV and text, each in its own layout.
Manual matching
Comparing sales with tax paid, credit claimed with credit available, or goods billed with goods moved was done by hand in spreadsheets: slow and easy to get wrong.
Hard to explain
A figure in a report could not easily be traced back to its rows and its legal basis, so results were hard to repeat and harder to defend.
Networks hide in tables
Fake-invoice networks pass credit through chains and loops of firms. Seeing them needs graph analysis that spreadsheets cannot do.
Confidential by nature
Tax data is confidential, so cloud tools were not an option. Whatever helped had to run on the officer’s own machine.
Understand the work. I mapped the investigator’s workflow from finding a lead to computing a demand, and the questions asked at each step.
Study the data. I studied the structure of the returns, statements and reports the work depends on: their fields, layouts and how they relate. Structure only; no data was copied.
Specify. I wrote a detailed build specification (version 3.1): the data model, every check with its legal basis, the screens, the security model and the acceptance tests.
Build in milestones. I planned fifteen milestones and built the application one milestone at a time, using the AI coding assistants available in 2024, ChatGPT (GPT-4) and GitHub Copilot, under fixed rules for the shared code, privacy and testing. Each milestone was reviewed and integrated before the next began.
Prove it. I built a synthetic data generator that plants known problems, 507 automated tests with expected values, and a demo zone of 20 cases that exercises every module.
Hand it over. Once every module passed on synthetic data, I handed the application to the team for use, before my departure in August 2024.
The core idea is simple: clean every source into one case store and link it on a small set of shared keys. Once the keys line up, each analysis becomes a join instead of a manual hunt.
1 · Sources 10+ kinds, 25+ formats
Returns and purchase statements
Third-party reports
Goods movement
Registration data
Law: rates and rules by date
Books, bank and trade data
2 · Connect one case store
Recognise each file by its headings
Fingerprint it (SHA-256)
Clean, normalise, self-check
Link on shared keys in DuckDB
3 · Analyse explainable methods
Reconcile and match
Screen and benchmark against peers
Rule checks, law by date
Graph analysis
Movement feasibility
Estimates with stated assumptions
4 · Act what the officer gets
Ranked worklists
Explainable findings
Reports and annexures
Tax, interest and deadlines
Case tracking and reports
From scattered files to explainable findings: every source is cleaned into one case store and linked on shared keys.
Kind of source
Examples
What it adds
Own returns
Sales return, summary return with tax paid, annual return
What the business declares, month by month and for the year
Supplier statements
Auto-drafted purchase statements built from suppliers’ filings
The credit the business is actually entitled to, invoice by invoice
Third-party reports
Tax deducted by government buyers, e-commerce collections, income-tax statements
What others report paying the business: an independent check on turnover
Goods movement
E-way bills, the public PIN code directory
Whether billed goods were plausibly moved
Registration data
Registration details across the area
The wider population, for screening and peer comparison
Law
Rates, exemptions, reverse charge, blocked credit, cess, each with its effective date
The correct treatment on any given date, so checks are time-aware
Books and finance
Trial balance, sales register, bank statements
Turnover in the books against the returns; money flows
Trade
Shipping bills and bills of entry
Exports and imports against refunds and credit claimed
Files are recognised by their headings rather than fixed row positions, so the app copes with banner rows, merged headers and small layout changes.
The app ships with a demonstration story. It shows how each extra source adds a layer of proof. All firms and figures are synthetic.
Spot it. Population screens rank a group of closely linked new registrations at the top of the worklist, each with a score and the reasons behind it.
Connect it. Supply links from returns, purchase statements and e-way bills become a network of 18 units. Graph search finds a ring of four firms passing credit in a loop and two firms with credit but no real purchases, all feeding one beneficiary (the picture at the top of this page). The analysis takes about a tenth of a second.
Test it. The ring’s 95 e-way bills are tested for whether the goods could physically have moved: 36 consignments fail, and the tax on them is computed exactly, with a clearly labelled estimate for the bills not tested.
Corroborate it. Financial records show money moving in a loop between two of the firms, matching the pattern in the network.
Explain it. Each finding becomes an issue with its legal provision, its method (exact or estimate), its confidence and its source rows. The officer drafts the report with annexures; a supervisor approves it before it is registered.
Act on it. For a related case, the app computes tax by month, interest day by day, payments already made, penalty options and the statutory deadlines.
Twelve modules follow the investigator’s workflow, from deciding whom to look at to computing a demand and reporting on it.
Lead generation
Loads a registration extract of hundreds of thousands of records in about 30 seconds, runs 11 explainable screens with product-code peer benchmarks and back-testing, and produces ranked worklists.
Return analysis
Reconciles sales with tax paid and credit claimed with credit available, month by month, with late-filing interest and an annual comparison across returns.
Invoice-level credit matching
Matches the purchase register with suppliers’ filings to find credit without an invoice, duplicate claims and suppliers who stopped filing.
Third-party data
Compares what government buyers and e-commerce operators reported with the business’s own return, alongside peers who work for the same buyers.
Law masters
Effective-dated rates, exemptions, reverse charge, blocked credit and cess, each with its notification: “what was the rate on this date”, and sweeps that list everyone affected by a change.
Sector playbooks and estimates
13 sector checklists, and estimates as ranges, proxies, peer-based or extrapolated figures, with every assumption shown and editable.
Network analysis
Builds a supply network and finds trading cycles, clusters, chain levels and credit flows, then draws the picture and the annexures.
Goods movement
Distances from PIN codes and vehicle-feasibility tests, with exact and extrapolated tax on goods that could not have moved.
Enrichers
A books-to-returns turnover bridge and links to income-tax statements, bank statements, customs data and job-work records.
Case reports
An evidence locker and legal library; drafts reports in the office’s own Word format with Excel annexures, with maker-checker approval.
Register and reporting
Replaces a spreadsheet register: dated events, follow-up ageing, reminder letters, management reports in existing layouts and a fuzzy duplicate check.
Demand computations
Tax by period, interest day by day, payments appropriated, penalty options, limitation dates and a deadline dashboard.
In tax enforcement, a number is only useful if it can be defended. The design follows from that.
Explainable by design
Every figure traces back to its source rows, the rule that produced it and the legal provision. Each check states its method (exact, proxy or estimate) and its confidence. Estimates print their assumptions, and changing one recomputes the figure. Officers’ decisions on findings survive a re-run of the checks.
Private and tamper-evident
Fully offline: outside network connections are blocked while the app runs. Every imported file is fingerprinted, the audit log is hash-chained, backups are signed, and case packages are digitally sealed so any change shows. The web layer is hardened, and the app runs without admin rights.
Tested properly
A synthetic data generator plants known problems, so every check is tested against expected values: 507 automated tests, including property-based tests and performance benchmarks. No real taxpayer data in the code, tests or documentation.
Made to be used
A browser interface with light and dark themes, a guided first-run tour, a “How to” page, a 22-chapter manual built into the app, and a one-click demo zone of 20 synthetic cases for training and presentations.
A local web application: a Python server on the officer’s own PC and the normal browser as the interface. No internet, no cloud, no installation rights needed.
Layer
Tools
Why
Analytics engine
DuckDB (embedded SQL), PyArrow
Fast columnar analysis of large extracts on one PC, with no database server
Graph and matching
Own graph algorithms, RapidFuzz
Trading cycles, clusters and chain levels; fuzzy name and address matching
File handling
python-calamine, pypdfium2, JSON and CSV readers
Reading returns and reports from Excel, PDF, JSON and CSV
Documents
python-docx, XlsxWriter, Pillow
Reports, notices, annexures and network pictures in the office’s own formats
Web server
FastAPI, Uvicorn, Jinja2
A testable server with server-rendered pages
Interface
HTMX, Alpine.js, Tabulator, Cytoscape.js
Interactive tables and network pictures, all bundled locally
Security
cryptography (Ed25519), Argon2, SHA-256
Signatures, sealed packages, passwords and file fingerprints
Quality
pytest, Hypothesis, pytest-socket
Unit, property-based and offline-enforced tests
Packaging
PyInstaller, portable build
Runs on locked-down Windows PCs without admin rights
AI assistance
ChatGPT (GPT-4), GitHub Copilot
Drafting and reviewing code, tests and documentation, always checked against the specification and the tests
I treated the project as a product. I started from the officers’ workflow and the shape of the data, wrote a specification precise enough to build and test against, and split it into fifteen milestones. I wrote it with the help of the AI coding assistants of the time, ChatGPT (GPT-4) and GitHub Copilot, under fixed rules for the shared code, privacy and testing, with one standard above all, correct before complete: every check needs expected values on synthetic data. I reviewed and integrated each milestone, packaged the result as one app with a guided tour, a manual and a demo zone, tested it end to end on synthetic data and then handed it to the team.
1 · Discoverworkflow and data formats
→
2 · Specifyspec v3.1: data model, checks, acceptance
→
3 · Build15 milestones with ChatGPT and GitHub Copilot
→
4 · Validateplanted problems, 507 tests, demo zone
Reconciliation and variance analysis, anomaly screening, peer benchmarking, graph and network analysis, geospatial feasibility, estimation and extrapolation, back-testing, explainable analytics, fraud detection
Data engineering
Data integration, multi-format ingestion (PDF, Excel, JSON, CSV), entity resolution and fuzzy matching, data modelling, SQL (DuckDB), PyArrow, data quality checks, data lineage, synthetic data generation
Domain and product
GST and indirect tax, tax compliance analytics, requirements and specification, workflow design, milestone planning, user documentation, GovTech
Engineering and delivery
Python, FastAPI, HTMX, automated testing (pytest), security and privacy by design, offline-first architecture, AI-assisted development (ChatGPT, GitHub Copilot), Git
GST Nirikshak shows how I work with data: start from the decision someone has to make, find every source that bears on it, connect them on keys that hold up, and make every number explain itself.
The source code is private. A walkthrough on the synthetic demo data is available on request.
Data analyticsData integrationGraph analyticsExplainable analyticsFraud detectionPythonDuckDBFastAPIPrivacy by designAI-assisted developmentGovTech