The address stops being a phone call: PataSetu on AWS
We built an address-resolution engine for India in four days at First Commit. Landmark-based addresses in; structured fields, DIGIPIN and a calibrated confidence out; every customer message gated by a Cedar policy. Four things we got wrong, with the measurements that caught them.

Live: website ( https://main.d16dqxnda3ut4f.amplifyapp.com/ ) · operations console ( https://shashank.d1oa7awydlkizq.amplifyapp.com ) · source, results and the full learnings journal ( https://github.com/ShashankVaish/address-simplfy )
An Indian delivery address is usually not an address. It is a set of
directions given to a human being:
h no 14 behind shiv mandir near gupta general store opp water tank
ramesh nagar delhi 110015 call before coming
Three things follow from that, and all three cost money. The rider phones the
customer on almost every order. The first delivery attempt still fails a lot.
And whatever the rider learns — gate 3, ask the guard, lift on the left — dies
in their head; the next rider starts from zero.
We spent four days at First Commit building PataSetu, an address-resolution
engine that takes that text and returns a structured address, a coordinate, a
DIGIPIN, and a confidence score that means what it says. When it genuinely
does not know, it asks the customer exactly one question. And it learns: every
confirmed delivery makes the next address in that neighbourhood easier.
This post is about the four things we got wrong on the way, because they were
more interesting than the things we got right.
- The government's own geocode format had changed, and nobody's blog knew
DIGIPIN is India Post's official 10-character geocode. Every secondary source
we found — tutorials, GitHub gists, a couple of npm packages — writes it with
hyphens: 39J-JTT-4565. The official encoder does not. It emits a continuous
string, and the hyphens are a display convention that some sources promoted to
a data format.
We vendored the official encoder, wrote a test that checks the format against
India Post's published examples, and that test is the first thing the README
tells you to run. The lesson generalises: when a standard has an official
implementation, read the implementation, not the posts about it.
- Real data was available, and it had junk in it
We planned to scrape 120 addresses. Instead we found the All-India Pincode
Directory — every post office in the country, with coordinates, published as
open data. Real addresses, no personal information, and a gazetteer for free.
It also contains a post office called TEST OFFICE at pincode 999999,
coordinates placed in the sea, and offices whose coordinates belong to a
different state. None of this fails loudly. A pincode lookup on junk simply
returns junk, with full confidence.
So the gazetteer build now rejects rows by rule — placeholder and
non-civilian offices, coordinates outside the DIGIPIN national bounding box —
and takes the median of a pincode's offices as its centroid, so one office
geocoded into the wrong district cannot drag the centroid kilometres off. It
prints what it dropped. "The data is real" is only worth saying if you can
also say "and here is what we threw out".
- A fixed 3 km radius is a metro assumption
Landmark retrieval fuses three signals: BM25 on names, vector similarity, and
geography — candidates near the pincode's centroid. We set the geographic
radius to 3 km, which felt generous.
It excluded the right answer for 29% of localities. Delhi pincodes are small;
rural pincodes are not. The radius now scales with the pincode's own extent,
measured from the gazetteer, and the retrieval diagnostics went from "the
graph is somehow not helping" to a median geocode error of 0 m when the
graph knows the place.
That number deserves its caveat, which we print next to it: the landmark graph
was warmed from the same directory the addresses came from. Zero metres says
the mechanism works when the place is known, not that every place is known.
- The learning curve is a step, not a slope
The claim we most wanted to make was the system gets better at your
neighbourhood the more it sees of it. We expected a gentle climb. We built the
measurement anyway: start with an empty landmark graph, feed six hundred
addresses across thirty-six localities one at a time, resolve each against the
graph as it stands, then "confirm the delivery" and let the graph learn.
(Learning curve chart: https://raw.githubusercontent.com/ShashankVaish/address-simplfy/shashank/docs/results/learning\_curve.svg )
With zero prior deliveries in a locality, 5.6% of addresses geocode from the
graph, and the median error is 1.2 km — a pincode centroid. After one
confirmed delivery: 80.6%, and 0 m. Then flat.
One delivery teaches the temple. The next address "behind the same temple" is
placed exactly. The remaining fifth are addresses that share no landmark with
any earlier one, and those still fall through to a geocoder. It is a more
useful result than the slope we expected, and it changed how we describe the
product: not "it learns over time", but "one delivery is enough".
The part that says no
The clarifier — a Strands agent on Amazon Nova Lite — writes one question, in
the script the customer wrote in, targeting the field that unlocks the most.
Before that question goes anywhere, Cedar decides whether we may contact this
customer at all: not above 80% confidence, not twice for one order, not
outside 09:00–20:00 local time, and never if they opted out.
Our first draft of the opt-out rule was scoped to the agent. A test — "even an
operator cannot contact an opted-out customer" — failed, because a human
operator was allowed through by a different permit. The forbid now names no
principal at all. A human reviewer approved the first draft; the test read the
actual semantics. That is the argument for policy tests over policy review.
A denial is never a silent drop. The case goes to a person, with the policy id
and the reason on the row.
What we would tell someone starting tomorrow
- Find the real data before you scrape. It usually exists, and it comes with a gazetteer.
- Build the measurement before the feature. The learning curve took an afternoon and changed the pitch.
- Print the caveat next to the number. A 0 m median with its caveat is more credible than a 40 m median without one.
- Give the guardrail a test, not a reviewer.
The code, the evaluation harness, and a journal of everything that went wrong
are at github.com/ShashankVaish/address-simplfy ( https://github.com/ShashankVaish/address-simplfy ).
The numbers, from the deployed stack
Dev split (150 addresses), measured against the live stack in ap-south-1: LLM alone
(B) geocodes at 969 m median with 30% of addresses unplaced; with landmark
retrieval (C–E), 0 m and 97% placed. The model's field F1 (0.79) is below the
regex floor (0.83) — locality recall is where it loses — so the deterministic
parse stays as the floor. Calibrated ECE on the full system: 0.24 raw → 0.03
cross-validated. p95 latency 2.8 s against a 1.2 s target, the cost of Claude
escalations. No confidence band reaches 95% precision yet; we report 0.71 at
the 0.80 threshold rather than claim the target.
Held-out test split, run exactly once at the end: the same shape. 491 m → 0 m, coverage
64% → 95%, field F1 0.73 at every configuration (harder than dev). One
surprise we are not hiding: BM25-only retrieval beat the full hybrid on
test — 58% auto-resolution at 0.78 precision against 26% at 0.74. The
ambiguity thresholds were tuned on dev and are too timid. That is the first
thing we would change on Monday.
Full tables — both splits, per-field scores, the reliability diagram and the targets we missed — are in docs/results/ablation.md ( https://github.com/ShashankVaish/address-simplfy/blob/shashank/docs/results/ablation.md ).
Built at First Commit, event 01 of the Bharat Builds Tour (WeMakeDevs × AWS), 17–20 September 2026. Stack: Amazon Bedrock (Nova Lite, Claude, Titan Embeddings), OpenSearch Serverless, Lambda on Graviton, API Gateway, DynamoDB, EventBridge, Amazon Location, Cognito, CloudWatch, Amplify Hosting, AWS SAM, Cedar, Strands Agents.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article