AWS Builder Center

SevaFix: Rules Decide, AI Explains

SevaFix helps citizens prepare, track, diagnose, and repair Indian government-benefit applications. This is how I combined deterministic policy checks, document intelligence, immutable versioning, and cited AI explanations on AWS—without pretending AI is the authority.

Imagine entering an annual family income of ₹3,50,000 in a scholarship application while the uploaded income certificate says ₹9,00,000.
The form may appear complete, but the contradiction is already there—waiting to become a rejection.
That is the problem I built SevaFix to address.
SevaFix is an AWS-native companion that helps citizens prepare, track, diagnose, and repair Indian government-benefit applications. It does not replace an official portal or decide whether someone is eligible. Instead, it detects preventable mistakes, explains them using official evidence, and helps create a corrected application without erasing the original history.
The principle behind the entire project is simple:
Rules decide. AI explains.

Why SevaFix?

Discovering a government scheme is only the beginning. Applicants still need to understand:
  • Whether their form matches their documents
  • Which documents are required
  • Whether a rule is current
  • Why an application may have failed
  • What they should correct before resubmitting
A generic chatbot can generate a confident answer, but government applications require more than confidence. They require dated official sources, reproducible checks, privacy controls, and clear boundaries between assistance and authority.
SevaFix therefore follows five rules:
  1. Every important check must be connected to reviewed official evidence.
  1. Deterministic code—not generative AI—evaluates structured requirements.
  1. Low-confidence document extraction must be confirmed by the user.
  1. Submitted applications and published policies remain immutable.
  1. AI explanations must fail safely when supporting evidence is insufficient.

The citizen journey

SevaFix provides two distinct journeys.

Preparing a new application

The citizen signs in, selects the scheme, completes the form, and uploads the required documents.
SevaFix extracts relevant facts from those documents and runs checks against the policy version assigned to the application. If an important extracted value has low confidence, the system asks the citizen to confirm it instead of silently treating it as correct.
When every blocking check passes, the application receives the status:
 READY_WITH_SEVAFIX_CHECKS 
This wording is intentional. It means the implemented checks passed—it does not promise government approval. The citizen still submits through the official portal.

Diagnosing and repairing a failed application

A citizen can also bring in a previously failed application. SevaFix freezes the original state, analyzes the available evidence, and shows:
  • The likely issue
  • The values that caused it
  • The applicable policy evidence
  • The confidence and limitations of the diagnosis
  • A recommended corrective action
Selecting Fix my application creates a new draft linked to the previous immutable version.
The resulting history remains understandable:
 Prepared V1 → Submitted → Returned → Repair V2 → Resubmitted 


How it works on AWS

SevaFix uses a serverless architecture deployed primarily in the AWS Mumbai Region.
Citizen
|
Next.js frontend
|
Amazon Cognito
|
Amazon API Gateway
|
AWS Lambda
/ | \
DynamoDB Amazon S3 Diagnosis worker
| |
Step Functions Amazon Bedrock
|
Amazon Textract
The main AWS services have clearly separated responsibilities:
  • Amazon Cognito manages authentication and citizen, reviewer, and administrator roles.
  • Amazon API Gateway provides authenticated HTTP endpoints.
  • AWS Lambda runs the API, validation, diagnosis, source-monitoring, deletion, and notification logic.
  • Amazon DynamoDB stores applications, immutable versions, validation results, timelines, repairs, rules, and policy records.
  • Amazon S3 stores encrypted citizen documents and official policy snapshots.
  • AWS Step Functions coordinates the asynchronous document-processing workflow.
  • Amazon Textract extracts facts from uploaded documents.
  • Amazon Bedrock produces constrained, evidence-backed explanations.
  • Amazon EventBridge, SQS, SNS, CloudWatch, and X-Ray support scheduling, notifications, retries, monitoring, and tracing.
The infrastructure is defined using AWS SAM and CloudFormation so that it can be deployed and reviewed consistently.

Documents are evidence—not automatic truth

Uploading a document does not immediately make every extracted value trustworthy.
The document workflow is:
  1. Generate a short-lived signed upload URL.
  1. Record the expected file size, type, metadata, and SHA-256 checksum.
  1. Upload directly to a private Amazon S3 bucket.
  1. Verify the uploaded object.
  1. Process it asynchronously using Step Functions and Textract.
  1. Normalize the extracted facts with confidence and provenance.
  1. Ask for confirmation when a decisive fact has low confidence.
  1. Use only confirmed facts in the relevant validation rules.
This is important because OCR is a sensor, not an authority.

Why validation happens before AI

Some checks should never depend on a generative model.
If a form says ₹3,50,000 and a certificate says ₹9,00,000, the values do not match. That result should not change because a prompt or model changed.
SevaFix therefore uses deterministic rules for checks such as:
  • Required fields and documents
  • Name consistency
  • Form income versus certificate income
  • Policy income thresholds
  • Course mode and type
  • Scholarship declarations
  • Academic-year requirements
  • Document confidence and confirmation
Every check produces an explicit result such as  PASS ,  FAIL ,  NEEDS_REVIEW , or  BLOCKED .
Only after a failure has been established does Amazon Bedrock receive the structured result and a limited set of reviewed policy evidence. Direct identifiers are redacted, model storage is disabled, returned citations are validated, and unsupported responses are rejected.
If AI generation fails, the deterministic result remains available. The application loses a fluent explanation—not the underlying truth.


Proving the repair loop

The live acceptance test intentionally introduced a faulty synthetic income certificate.
The application form declared ₹3,50,000, while the certificate declared ₹9,00,000.
The deployed workflow:
  1. Processed the documents through S3, Step Functions, and Textract
  1. Detected the mismatch using a deterministic rule
  1. Classified it as an income mismatch
  1. Clearly labelled the diagnosis as inferred, not an official rejection reason
  1. Returned citations from the reviewed policy package
  1. Recommended verifying the correct value
  1. Created a linked repair draft
  1. Replaced the faulty evidence
  1. Produced a corrected V2 that passed the checks


Keeping policies current

Government guidance can change, and official pages may occasionally conflict.
SevaFix monitors allowlisted official HTTPS sources and records their content hashes. When a source changes, the system creates a reviewer item instead of automatically changing a live rule.
A reviewer can compare the evidence, approve or reject the change, publish an immutable policy version, or roll back the active version without deleting history.
When two official sources exposed conflicting application dates, SevaFix recorded the situation as:
 CONFLICT_REQUIRES_HUMAN_REVIEW 
It did not invent a deadline simply to provide an answer.

Privacy is part of the architecture

Government applications can contain sensitive personal and financial information. SevaFix includes:
  • Server-side ownership checks
  • Role-separated reviewer endpoints
  • Private and encrypted S3 buckets
  • DynamoDB point-in-time recovery
  • Short-lived signed upload and viewing URLs
  • File-size, type, metadata, and checksum validation
  • PII-minimized logs and AI prompts
  • Document and account-deletion workflows
  • Synthetic, watermarked documents for testing
SevaFix never stores government portal passwords or bypasses OTP, login, or CAPTCHA flows. When an authorized API is unavailable, the citizen completes the official action manually.

What I learned

Building SevaFix taught me that responsible AI is not only about selecting a model.
It is about deciding what the model must never control.
Deterministic validation, source provenance, immutable history, human review, privacy, and honest failure states are less flashy than a chatbot—but they are what make an application trustworthy.
Supporting one scheme completely was also more valuable than creating shallow support for hundreds of schemes. It forced me to solve the difficult parts: uncertain OCR, policy conflicts, retries, deletion, versioning, and repair.

Closing thought

SevaFix makes a simple promise:
Catch preventable problems before submission and make failures understandable afterward.
The goal is not to build an AI that sounds certain. It is to build a system that can show its work, admit uncertainty, protect the citizen, and guide them toward the correct official action.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article