Urgent.News

What's breaking now, across thousands of outlets.

Tech

Two databases, one question: how I built Eligible

A government benefits finder that answers one sentence, and shows its work. Type this: I am a 34 year old tailor in Hyderabad, I make about 2.4 lakh a year, two kids in school You get back 488 Indian government schemes you actually qualify for . Each card names the rule that let it through. Underneath, 72 schemes that came close, each one naming the exact number that stopped it: "Your ₹2.4 lakh…

A government benefits finder named Eligible provides a one-sentence answer along with a breakdown of how a user qualifies for specific schemes. Users input their details, such as age, income, and occupation, and Eligible generates a list of 488 Indian government schemes that match their criteria. The system uses two databases - VectorsDB and TablesDB - to achieve this.

VectorsDB holds one document per scheme, containing the scheme's slug and an embedded eligibility paragraph. TablesDB holds the arithmetic information, like jurisdiction, level, age limits, income ceiling, benefit amount, and document count. By using separate databases for meaning and facts, Eligible avoids storing multiple sources of truth for the same fact, which would lead to inconsistencies and potential errors in the app.

The parser function, parseIncomeCeiling, processes the eligibility paragraph to extract income ceiling values and determines if they are stated or not. It filters out irrelevant sentences and computes the maximum ceiling value under a certain threshold to ensure the scheme is accessible. Once the best ceiling value is found, the rule is returned along with the sentence it came from. This information is then used to display the government's own words in the UI, providing transparency to the user.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

More from Tuesday 3 November →