An AI agent for public welfare
When the law changes, the code changes with it.
Niyam reads every new government order (called a GR) and updates the welfare eligibility rules, written as code , by itself. Every rule links back to the exact sentence of the order it came from.
Latest real run: Ladki Bahin amendment, 6 changes found, 16 of 16 independent checks agree.
Government order (Marathi original), page 2, clause 4(3)
किमान वयाची 21 वर्षे पूर्ण व कमाल वयाची 65 वर्ष पूर्ण होईपर्यंत
English: Minimum age 21, until the maximum age of 65 is completed.
Rule code, parameters/age_max.yaml
2024-06-28: value: 60
+ 2024-07-03: value: 65
+ reference: GR 202407031335114330, p.2
Verified by an independent agent
age 65 eligible, 66 not
New here? Start with what you need
Pick one. Every page has an About this page box, and i buttons that explain each term. Use EN, हिं or मरा at the top to read help in English, Hindi or Marathi.
25 of 25
hand-written test citizens correct after the agent rebuilt a whole scheme from its founding order
From-scratch runThe problem
Rules live in PDFs. Decisions are made by code. Nobody keeps them in sync.
When code drifts from the law, people lose food
In Telangana, an eligibility algorithm cancelled more than 1.8 million food security cards between 2014 and 2019. A widow lost her rations after the system confused her late husband, a rickshaw puller, with a car owner. Her case reached the Supreme Court.
Al Jazeera and Pulitzer Center, 2024Huge money, low reach
India spends about $210 billion a year on welfare and more than 800 million people are eligible, yet only about 40 percent manage to apply. Every app that answers "am I eligible?" depends on rules that are kept up to date by hand.
Acumen, Haqdarshak case studyRules change, enforcement lags
Maharashtra later removed 92 lakh women from one scheme after verification, after about Rs 14,000 crore had already been paid. Rules such as the income ceiling existed on paper; the systems applying them did not keep up.
Business Today, July 2026Niyam is not about any party or government. Rules change for good reasons. The problem is that the change reaches the code late, or never, and nobody can check it.
What Niyam is
An agent that keeps the rules correct, and proves it.
Today, without Niyam
- 1A department publishes a GR as a Marathi PDF.
- 2Someone has to notice it, read it and find what changed.
- 3Each app and helpline updates its own rules by hand, weeks later, or never.
- 4Nobody can see which clause an answer came from, so mistakes are hard to challenge.
With Niyam
- 1Niyam spots the new GR on the official list within 15 minutes.
- 2It quotes each changed clause and checks every quote against the PDF.
- 3It updates one open rulebook with tests; a second agent verifies it against the law.
- 4Every answer shows its clause, and every line shows who wrote it and why.
What it does
Watches official sources for new government orders, finds the clauses that change who is eligible, and updates the rule code with tests, without a person watching.
Who it helps
Anyone who answers "am I eligible?": helplines, field workers, NGOs, apps and chatbots. They all get correct, current rules from one open place.
What makes it different
It proves its work. A second agent checks every change against the law, every line of code links to its clause, and the agent's reasoning is saved with the change.
How it works
Seven steps, from a government order to correct rules
- 1
Watch
Checks official sources every 15 minutes for new government orders.
- 2
Triage
Decides if the document changes any scheme Niyam covers.
- 3
Extract
Quotes the exact clauses that change eligibility, and checks every quote.
- 4
Encode
A coding agent updates the rulebook and writes tests.
- 5
Verify
A separate agent checks the new rules against the law, blind to the change.
- 6
Resolve
Settles disagreements, or asks a human a plain question.
- 7
Publish
Opens a change request with sources and proof. Merges alone only when safe.
Live proof
This is a real run, not a mock-up
Original government order (Marathi)
अ.क्र. (३) किमान वयाची २१ वर्षे पूर्ण व कमाल वयाची ६५ वर्ष पूर्ण होईपर्यंत.English translation: Sr. No. (3) Minimum age 21 years completed and maximum age until 65 years are completed.
Maximum age is raised from 60 to 65 completed years.
A number or list changed: more people eligible
Unmarried women become eligible, but only one unmarried woman per family.
A number or list changed: more people eligible
Only one unmarried woman per family can receive the benefit.
New condition added: fewer people eligible
Contract staff (along with outsourced and volunteer workers) in a family are no longer disqualifying if income is up to Rs 2.50 lakh. Only regular/permanent employees and pensioners still disqualify.
A number or list changed: more people eligible
Receiving Rs 1,500 or more per month from other government schemes now disqualifies; previously only more than Rs 1,500 did.
Condition reworded: fewer people eligible
The disqualification for families jointly owning more than five acres of farm land is removed.
Condition removed: more people eligible
Independent verifier
16 of 16
test citizens agree with the new rules
Confidence
0.88
Sent to a human because one change removes people from the scheme; reviewed and merged
Cost of this run: $0.69
Measured, not claimed
We test the whole agent on documents with known answers
Correct choice to act alone or ask a human
Average cost per document
Test citizens get the right answer
Independent verifier agrees
Changes found
New values exactly right
Limits read correctly (more than vs or more)
Measured by us on 6 runs: a real Ladki Bahin amendment, the same order as a scan, two real unrelated orders, and two labelled synthetic robustness tests. Lower cost is better.
Who it is for
One source of truth, many ways to use it
People checking eligibility
Answer a few questions and see which schemes you may qualify for, with the reason and the official source, in English, Hindi or Marathi.
Check eligibilityNGOs and field workers
Explain every answer with the official clause, and see exactly when and why a rule changed.
Explore the rulesDevelopers and apps
One API call returns eligibility with sources. Plug it into your app, helpline or chatbot.
Get an API keyAI assistants
Add Niyam as an MCP tool so your assistant answers with current rules instead of guessing.
Add the MCP serverBuilt with
The tools that make Niyam trustworthy
| Tool | In plain words | What it does in Niyam |
|---|---|---|
| neatlogs | A flight recorder for AI agents.Records every step of every run. We used the traces to find a costly loop in version 1, fix it, and prove the fix with numbers. | Records every step of every run. We used the traces to find a costly loop in version 1, fix it, and prove the fix with numbers. |
| Entire | A memory of how code was written.Saves the agent's full reasoning with every rule change, so anyone can ask "why does this rule say this?" and see the session behind it. | Saves the agent's full reasoning with every rule change, so anyone can ask "why does this rule say this?" and see the session behind it. |
| cfo.ai | An AI finance planner.Built our pricing, costs, revenue and runway plan from the real cost per document measured in neatlogs. | Built our pricing, costs, revenue and runway plan from the real cost per document measured in neatlogs. |
| Claude | The AI models.Read Marathi government orders, write and test rule code (Claude Code), and check the result independently. | Read Marathi government orders, write and test rule code (Claude Code), and check the result independently. |
| OpenFisca format | An open standard for laws as code.Every limit is stored with its start date and its source, so history is never overwritten. | Every limit is stored with its start date and its source, so history is never overwritten. |
| AWS | Cloud servers.Runs the watcher and the API around the clock. | Runs the watcher and the API around the clock. |
Trust and limits
What Niyam will and will not do
Will
- Act on its own only for simple, verified changes, such as an amount or a date.
- Ask a human whenever a clause is unclear, or a change would remove people from a scheme.
- Show the source clause and the reasoning for every rule.
- Keep every past version of every rule, so any date can be checked.
Will not
- Decide anyone's application. The government department decides.
- Ask for names, Aadhaar numbers or phone numbers.
- Get around a CAPTCHA or a login on any government website.
- Follow instructions hidden inside documents. We test this on purpose.
For developers
Eligibility with sources, in one call
curl -X POST $NIYAM_API/api/v1/eligibility \
-H "Authorization: Bearer $NIYAM_KEY" \
-d '{"age": 34, "gender": "female", "annual_family_income": 240000}'Questions
Questions a first-time visitor asks
What is a GR?
A Government Resolution: an official order from a state government department. GRs create schemes and change their rules. Maharashtra publishes them as PDFs, mostly in Marathi.
What does "rules as code" mean?
Writing the rules of a scheme as a small computer program, so a computer applies them exactly the same way every time and anyone can test them.
Is Niyam an official government service?
No. It is an independent project built at a hackathon. Final eligibility is always decided by the government department.
How do I know Niyam is right?
Every rule links to its source clause. Every change is tested, and a second agent that never sees the change checks it against the law. When anything is unclear, or a change would remove people from a scheme, a human decides.
Does Niyam collect personal data?
No. The eligibility checker needs facts like age and income, never names, Aadhaar or phone numbers. The API rejects anything that looks like an ID number.
Which schemes are covered?
This first version covers Mukhyamantri Majhi Ladki Bahin Yojana in Maharashtra, built from its real government orders. The design scales to any scheme and state.
Can I use it in my own app or AI assistant?
Yes. Create a free API key on the Developers page, or add the MCP server to Claude, Cursor or any MCP client.
What happens when two orders disagree, or a clause is unclear?
Niyam applies clear rules first, such as a correction overriding the original. If it is still unclear, it writes a plain-English question with both readings and waits for a human.
More in Learn, written for people with no technical background. Evidence for judges is on one page.
References
Sources
- Al Jazeera and Pulitzer Center, How an algorithm denied food to thousands of poor in India's Telangana (2024)
- Amnesty International, Use of Entity Resolution in India (2024)
- Acumen, Haqdarshak case study
- Business Today, 92 lakh beneficiaries removed after verification (2026)
- Merigoux, Chataing, Protzenko, Catala: A Programming Language for the Law (2021)
- OECD OPSI, Cracking the Code: Rulemaking for humans and machines (2020)
- OpenFisca, rules as code
- Government of Maharashtra, GR 202406281814018230 (28 June 2024) and GR 202407031335114330 (3 July 2024)
Built in 56 hours at neatHack 2026. Source code: usv240/niyam. Rulebook: usv240/niyam-rulebook.