AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
An AI agent that reads new government orders and keeps welfare eligibility rules, written as code, in sync with the law. Every rule links to the clause it came from.
Developer toolsTypeScript · PythonGitHub @usv240OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
An AI agent that keeps welfare eligibility rules in sync with government orders. Every rule linked to its source clause. #neatHack
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
When the law changes, the code changes with it.
Niyam (Hindi and Marathi for "rule") is an AI agent that reads new government orders and keeps welfare eligibility rules, written as code, in sync with the law. Every rule links to the clause it came from, every change is tested and independently verified, and the agent's full reasoning is saved with the change.
Built during neatHack 2026 by team USV.Read the full README ↗When the law changes, the code changes with it.
Niyam (Hindi and Marathi for "rule") is an AI agent that reads new government orders and keeps welfare eligibility rules, written as code, in sync with the law. Every rule links to the clause it came from, every change is tested and independently verified, and the agent's full reasoning is saved with the change.
Built during neatHack 2026 by team USV.
| Website | usv240.github.io/niyam (GitHub Pages) and 34-227-135-194.sslip.io (AWS) |
| Live API and watcher | AWS EC2 t3.small in Hackathon_VPC, us-east-1: https://34-227-135-194.sslip.io/api/v1/health |
| Demo video | added on submission day |
| Rulebook maintained by the agent | usv240/niyam-rulebook |
| Showcase pull request opened by the agent | usv240/niyam-rulebook#2 |
| Entire checkpoint on that change | 01M4JDH944E4HPRCA4WKDJTFN7 (commit 2d67c14) |
| Build log | hackathon.md |
Demo video: youtu.be/LI24QLu4gzc. neatHack submission: quote post with the 2-minute demo.
In India, eligibility for welfare is decided by software: portals, field-worker apps, helplines, chatbots. The law behind it is published as PDF Government Resolutions (GRs), mostly in Marathi in Maharashtra, and it changes often. Nobody keeps the code in sync. When code drifts from the law, people are wrongly excluded or wrongly paid: in Telangana an eligibility algorithm cancelled more than 1.8 million food cards (Al Jazeera and Pulitzer Center, 2024), and nobody affected could see why.
Watch -> Triage -> Extract -> Encode -> Verify -> Resolve -> Publish
Six evaluation cases: the real 3 July 2024 Ladki Bahin amendment, the same order as a scan with no text layer, two real unrelated GRs, and two synthetic robustness tests labelled as synthetic inside the PDF (a pure benefit increase, and a hidden prompt injection).
| Metric | v1 | v2 | v3 |
|---|---|---|---|
| Changes found, values, boundaries | 100% | 100% | 100% |
| Test citizens get the right answer | 97.6% | 100% | 100% |
| Correct choice to act alone or ask a human | 67% | 100% | 100% |
| Independent verifier agrees | 95.7% | 100% | 100% |
| Cost per document | $0.88 | $0.29 | $0.13 |
| Time per document | 110 s | 54 s | 40 s |
v3 is a measured model choice. Per-stage cost tracking showed the coding agent was 56% of the cost. We tested cheaper models stage by stage on the same cases: Haiku 5.5 for triage and for the coding agent, and Sonnet 5.5 instead of Opus 5.5 for the verifier, kept 100% quality. Haiku 5.5 for extraction did not: it reported "no changes" for a real age-limit change, so extraction stays on Sonnet 5.5. The experiment also exposed a bug (a cut-off structured answer crashed instead of recovering), now fixed and unit tested. All runs: evals/results/extra/v3a.json, v3b.json, v3c.json.
Further runs (in evals/results/extra/):
01M4JFNT0M069MG48K0FT9V50P).--onboard), Niyam encoded Sanjay Gandhi Niradhar Anudan Yojana from the real 56-page 2019 consolidated GR (PR #3, 49 tests, $1.54). Then the real 6 July 2023 order raising assistance to Rs 1,500 was judged safe to merge alone (only amounts rise, 16 of 16 checks agree, confidence 0.98, $0.20, dry run). Run live, the same order raised a question about widows with three or more children and went to a human (PR #4): 2 of 4 runs would have acted alone; the other 2 asked a person, the safe direction. Reviewing PR #3 caught a real mistake: a new disabled field defaulted to true, which would widen eligibility; fixed before merge. All four agent PRs are now reviewed: #2, #3 and #4 merged, #1 closed as superseded.The improvement came from the neatlogs traces: in v1 the coordinator ruled three different ways on one test case and the job spent $3.05 before the budget stopped it. The root cause was that the benefit formula ("pay the difference") was missing from the context given to the verifier and coordinator. v2 adds it, plus a loop guard. One v2 run was discarded because of a bug in our own file guard; the full, honest story is in hackathon.md. Raw results: evals/results.
| Claim | Evidence |
|---|---|
| The agent completes a substantial task end to end | PR #2: a Marathi GR in, 6 changes encoded with 46 passing tests, 16 of 16 independent checks agree |
| The agent improved | evals/results/v1.json and v2.json, with neatlogs trace ids for every run |
| We used neatlogs | One trace per job, a span per stage and per recovery; trace ids in every eval result and PR |
| We used Entire | Checkpoints on every agent commit in the rulebook (for example 01M4JDH944E4HPRCA4WKDJTFN7) and on build commits in this repository |
| We used cfo.ai | 36-month plan built by cfo.ai's Ari, three cases; PDF; inputs and summary in business/ |
| The agent recovers from failures | Scan with no text layer recovered by transcription (recovery.ocr_fallback); a crashed job resumed from its last good state; loop guard escalation |
| Code written during the event | Both repositories created after 12:30 IST on 10 October 2026 |
commit_linking: always so the headless agent's sessions link without a prompt.# API (eligibility with sources, rules on any date, jobs with live events, BYOD, keys)
cd agent && uv venv && uv pip install -e . && uvicorn niyam.api:app --port 8000
# Run the agent on a government order
python -m niyam process path/to/gr.pdf --date 2024-07-03
# Evaluations
python ../evals/run_evals.py --version v3
# MCP server for AI assistants
claude mcp add niyam --env NIYAM_API_BASE=http://localhost:8000 -- uvx --from "git+https://github.com/usv240/niyam#subdirectory=agent" niyam-mcp
# Website (static export; works without the API)
cd web && npm install && npx next build
Keys go in a .env file outside the repository (see .env.example). Needs ANTHROPIC_API_KEY, and NEATLOGS_API_KEY for traces.
| Path | What |
|---|---|
agent/niyam/ | The agent: orchestrator.py (state machine), stages/ (triage, extract, encode, verify, resolve, publish), pdftext.py (citation checker), confidence.py (trust policy), api.py, mcp_server.py, sources/watcher.py |
agent/tests/ | Tests for the citation checker, trust policy, watcher and API privacy |
evals/ | Harness, cases (real and labelled synthetic), results per version |
web/ | Website: landing, demo replay, rule explorer, eligibility checker (English, Hindi, Marathi), BYOD, developers, judges, learn, trust, status |
scripts/export_site_data.py | Builds the website's data from the rulebook and real runs |
business/ | Business plan |
infra/ | Deployment |
MIT