milanSathi
An in-house AI-powered astrology engine that replaced a paid third-party API on Jeevansathi.
- ~$45,000/year saved
- 100% parity with the vendor on everything tested
Why replace the vendor
- Every kundli and match was a paid call, so cost grew with traffic.
- The vendor rate-limited us under load.
- If the vendor went down, our astrology features went down with it.
- Users' birth details were sent to a third party.
- Any error in the vendor's scoring flowed straight into our match scores.
- Some features we needed were blocked by the vendor's plan.
How it was built
- Start from astronomy, not from the vendor
- Planet positions come from Swiss Ephemeris, the same astronomical data the industry uses, with the Lahiri ayanamsa that India's calendar standard uses. Anything that is pure astronomy is computed from first principles.
- Match the vendor only where the vendor is right
- Traditional tables (koota scores, classifications) were cross-checked against classical sources and against the vendor. Where they disagreed, the classical method wins and the vendor's behaviour stays available behind a switch.
- Be honest about what kind of answer each value is
- Every value is labelled Type-1 (provable astronomy), Type-2 (classical standard) or Type-3 (varies by tradition). Users and reviewers can see which numbers are facts and which are conventions.
- Make the switch boring
- A score endpoint returns exactly the shape the vendor returned, so a caller changes only a URL. In the main profile service it went live behind an experiment flag, with automatic fallback to the vendor on failure.
Proof before switching
Proved correctness against the vendor before switching traffic.
- 284/284 Ashtakoota combinations + 55 real pairs
- 729/729 Dashakoota cells
- 81/81 planet positions
- Vimshottari dasha matched to the minute
Where the old scoring disagreed with classical sources, the engine follows the classical method by default and can reproduce the old behaviour behind a switch.
The AI layer
Shipped four grounded LLM features on the engine: a personality reading, a couple's compatibility story, chart-based icebreakers and an AI astrologer chat, all with graceful fallback.
Going live
Rolled it into the main profile service behind an experiment flag, with no change for existing callers and an automatic fallback to the vendor on failure.
Also: thread-safety proven on 20k concurrent calls.
This page covers the problem, the approach and the outcomes. The code and internal systems stay with Jeevansathi.