Skip to content
Niyam

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

$0.13

average AI cost per government order, down from $0.88

Measured on 6 test documents

100%

of test citizens get the right answer, every version since v2

Evaluation results

25 of 25

hand-written test citizens correct after the agent rebuilt a whole scheme from its founding order

From-scratch run

2

real Maharashtra schemes, built from their real Marathi orders

Explore the rules

The problem

Rules live in PDFs. Decisions are made by code. Nobody keeps them in sync.

Eligibility for welfare is decided by software: portals, field-worker apps, helplines and chatbots. The law behind it is published as PDF orders that change often. When the code falls behind the law, real people are wrongly excluded or wrongly paid.

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, 2024

Huge 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 study

Rules 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 2026

Niyam 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

  1. 1A department publishes a GR as a Marathi PDF.
  2. 2Someone has to notice it, read it and find what changed.
  3. 3Each app and helpline updates its own rules by hand, weeks later, or never.
  4. 4Nobody can see which clause an answer came from, so mistakes are hard to challenge.

With Niyam

  1. 1Niyam spots the new GR on the official list within 15 minutes.
  2. 2It quotes each changed clause and checks every quote against the PDF.
  3. 3It updates one open rulebook with tests; a second agent verifies it against the law.
  4. 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

Each step is recorded in a trace, so you can see exactly what happened, including mistakes and recoveries.
  1. 1

    Watch

    Checks official sources every 15 minutes for new government orders.

  2. 2

    Triage

    Decides if the document changes any scheme Niyam covers.

  3. 3

    Extract

    Quotes the exact clauses that change eligibility, and checks every quote.

  4. 4

    Encode

    A coding agent updates the rulebook and writes tests.

  5. 5

    Verify

    A separate agent checks the new rules against the law, blind to the change.

  6. 6

    Resolve

    Settles disagreements, or asks a human a plain question.

  7. 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

The real 3 July 2024 amendment to the Ladki Bahin scheme, in Marathi, processed end to end by Niyam.
Clause 4(3), page 2Quote verified in the document

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

Version 1 worked, but its traces showed a costly loop. Version 2 fixed what the traces revealed. Version 3 used cheaper models wherever measurement showed no loss, cutting cost per document from $0.88 to $0.13. It also encoded the whole scheme from its founding order and passed all 25 of our hand-written test citizens.
v1 baseline: first complete pipelinev2 benefit formula in context, loop guard, pinned base checkoutv3 cheaper models where measurement showed no loss: Haiku 5.5 coding agent and triage, Sonnet 5.5 verifier; truncated-output recovery

Correct choice to act alone or ask a human

v1
66.7%
v2
100%
v3
100%

Average cost per document

v1
$0.88
v2
$0.28
v3
$0.13

Test citizens get the right answer

v1
97.6%
v2
100%
v3
100%

Independent verifier agrees

v1
95.7%
v2
100%
v3
100%

Changes found

v1
100%
v2
100%
v3
100%

New values exactly right

v1
100%
v2
100%
v3
100%

Limits read correctly (more than vs or more)

v1
100%
v2
100%
v3
100%

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 eligibility

NGOs and field workers

Explain every answer with the official clause, and see exactly when and why a rule changed.

Explore the rules

Developers and apps

One API call returns eligibility with sources. Plug it into your app, helpline or chatbot.

Get an API key

AI assistants

Add Niyam as an MCP tool so your assistant answers with current rules instead of guessing.

Add the MCP server

Built with

The tools that make Niyam trustworthy

ToolIn plain words
neatlogsA 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.
EntireA 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.
cfo.aiAn AI finance planner.Built our pricing, costs, revenue and runway plan from the real cost per document measured in neatlogs.
ClaudeThe AI models.Read Marathi government orders, write and test rule code (Claude Code), and check the result independently.
OpenFisca formatAn open standard for laws as code.Every limit is stored with its start date and its source, so history is never overwritten.
AWSCloud servers.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

Free API keys, a live event stream for agent runs, and an MCP server for AI assistants.
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.