AWS Builder Center

Bijli Sathi

building BijliSaathi on AWS

The calculator writes numbers, the AI writes words: building BijliSaathi on AWSIndia met 270.8 GW of peak electricity demand in May 2026. Nationally, there was zero energy shortage the whole fiscal year. And yet, on hot summer nights, families across Chennai, Delhi, Noida and Odisha still lost power for 40 to 60 minutes at a time.That's not a supply problem. It's a timing problem. Solar floods India's grid at midday; coal carries the evening peak. The country's own Time-of-Day electricity rules already pay households 10–20% to shift usage into the cheap hours — almost nobody knows those hours exist, or what to move into them.That gap is what I built BijliSaathi to close: a WhatsApp-style assistant that reads a family's real electricity bill, checks their state's real tariff rules and the weather forecast, and sends back exactly one message a day — *shift this appliance, to this hour, save this much.*This is the story of building it on AWS, alone, in hackathon time.
One rule that had to survive contact with an LLMEarly on I set a rule for the whole system: the calculator writes numbers, the model writes words. No language model call anywhere is allowed to invent a rupee figure, a time window, or a risk level. Every number a family sees — the cheap-hours window, the rupees saved, tonight's cut-risk level — comes out of a deterministic pipeline first. The LLM's only job is to phrase what the pipeline already decided, in the family's own language.It sounds obvious written down. It's surprisingly easy to violate by accident the moment you let a model "help summarize the plan." Keeping the boundary hard — a typed  PlanNumbers  object goes in, prose comes out, nothing else crosses that line — is the single decision that made the rest of the system trustworthy enough to put real rupee figures in front of a judge.The other half of that honesty: every number on screen carries a label —  Real ,  Estimated ,  User-reported ,  Projection , or  Modelled . A bill you photograph is real. An appliance's share of that bill is an estimate, shown as a range, not a fake-precise single figure. Tonight's cut-risk is modelled from heat and grid stress, not a prediction of a specific outage. Judges forgive estimates. They don't forgive numbers dressed up as facts.
Building the real AWS architecture — for free, before spending a rupee on itThe product spec called for a specific serverless architecture: API Gateway and Lambda for the chat handler, Step Functions running a daily fetch → forecast → risk → plan → send pipeline, DynamoDB for storage, EventBridge for scheduling, S3 for raw data. The kind of architecture that's easy to draw on a slide and much harder to actually stand up and prove works before demo day, especially solo and on the clock.LocalStack + the AWS SAM CLI turned out to be the right combination for that.  template.yaml  became the single source of truth — the same SAM template that would deploy to a real AWS account also deploys against LocalStack, running entirely on my machine with no AWS account, no card, and no bill. I could run a full Step Functions execution, watch it write a real plan into a real (local) DynamoDB table, hit the API through an actual API Gateway URL, and know the architecture was sound before it ever touched anything billed.Step Functions in particular earned its place: the daily pipeline isn't a chain of function calls hidden in application code, it's a real state machine — fetch grid and weather data, forecast, compute risk, build the plan, send it — and its execution history in the console made debugging a broken step trivial in a way that stepping through Lambda logs never would have been.EventBridge does two jobs: it triggers the daily pipeline on schedule, and — once I realized Lambda cold starts were a real risk for a live demo, not just a production concern — it also pings the API Lambda directly every 5 minutes to keep an instance warm. The handler recognizes that ping and returns immediately, without touching Express or DynamoDB.
The gotcha nobody warns you about: WASM inside a bundled LambdaI used Cedar — AWS's open-source authorization policy language — to gate who can see what: a family sees only their own household, a society manager sees their apartment block's aggregate staggered EV-charging plan (never an individual member's bill), and the public sees only the aggregate impact counter. Cedar's policies are genuinely pleasant to write, and  cedar-wasm 's  isAuthorized  call meant these weren't decorative checks — they're real, evaluated authorization decisions.Getting it into a Lambda was the sharpest edge I hit all build. esbuild bundles your JavaScript beautifully — but Cedar's WASM binary is loaded at runtime via  fs.readFileSync , not imported, so esbuild has no idea it needs to carry that file along. The Lambda deployed clean, built clean, and then threw  ENOENT  the moment it actually tried to authorize a request. The fix was unglamorous: copy the real  .wasm  file into each function's build output by hand, as a deploy step. It's the kind of failure that only shows up at invoke time, and it's worth knowing about before it costs you an hour during a demo.
What's real, in the endEvery core feature in the spec is built and tested end to end against the real pipeline — not mocked stand-ins: a bill photo genuinely gets read by a vision model, not typed in; the cheap-hours window comes from real tariff data and a real weather forecast; the May 2026 heatwave backtest replays real historical grid figures through the live risk-scoring code, not a canned string. All 7 stretch features are built too, including Society/RWA mode's staggered EV charging, authorized for real with Cedar.The whole thing runs, right now, on real AWS-shaped infrastructure verified against LocalStack — and on a live Railway deployment for the actual demo. Both share the same core logic; only the storage layer and transport differ.
The takeawayBuilding solo, on a deadline, the constraint that helped most wasn't a clever architecture decision — it was refusing to let anything invent a number. Once that rule was non-negotiable, every other choice (which AWS service, which model, which shortcut to take and which to refuse) got easier to make honestly. That's the same principle India's own grid faces, just at a smaller scale: the fix isn't more power. It's using the power you already have, at the right time, and being straight about what you actually know versus what you're estimating.BijliSaathi is live at bijli-web-production.up.railway.app. The full write-up of what's real vs. simplified, and the complete AWS architecture, is in the project's repo.
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