Aavya LabTech
Aavya LabTech

Aadikarta Astro

Back to Use Cases
Marketplace & Consumer TechAI/MLReal-Time BillingWebSocket

Aadikarta — AI-Powered Astrology Consultation Platform

Live expert marketplaces fail on three things: billing that can be gamed, sessions that handle drops unfairly, and matching that sends the wrong expert to the wrong user. We engineered all three. Aadikarta has a tamper-proof server-authoritative billing engine, a 7-state session FSM that handles every edge case from network loss to mid-session recharge, and an ML-powered matching layer that improves with every consultation.

7-state
FSM — Every Edge Case Covered
3
Billing Models: Per-Minute, Fixed, Hybrid
10+
AI/ML Features Across 4 Layers
₹0
Billing Disputes in UAT Testing

The Challenge

Building a live expert consultation marketplace is harder than it looks. The client needed per-minute billing that couldn't be gamed from the client side, session state that survived network drops fairly for both parties, astrologer matching better than “who's online”, and a personalisation layer that kept seekers coming back. Off-the-shelf chat solutions couldn't handle billing edge cases. Booking plugins couldn't do real-time per-minute deduction. The AI layer was a greenfield build. Everything had to be custom, engineered from first principles, and auditable for disputes.

Per-minute billing that is server-authoritative and manipulation-proof
Session state that handles network drops, app crashes, and astrologer disconnects fairly
ML matching on more than just availability — specialty, language, past performance
AI personalisation layer: concern classification, Kundli analysis, consultation summaries
Churn and retention signals to keep the marketplace growing
GST compliance, payout management, and full audit trails for the India market

Before vs. After

The engineering decisions that separated a basic chat app from a defensible marketplace product.

Without Aadikarta's Architecture
  • No billing engine — session pricing ad hoc, dispute-prone
  • No session state handling — drops caused user trust issues
  • Random or manual astrologer assignment
  • Generic sun-sign horoscopes — zero personalisation
  • No post-session value — seekers had no record of advice given
  • No churn signals — platform blind to users about to leave
With Aadikarta
  • Server-authoritative per-minute + package billing — zero disputes in UAT
  • 7-state FSM with grace periods, mid-session recharge, and pro-rated refunds
  • ML matching on specialty, language, past ratings, and current availability
  • Personalised horoscopes generated from each seeker's actual birth data
  • GPT-4 consultation summary PDF — high-value, delivered automatically
  • ML churn model with push notification triggers before users disengage

Core Platform Architecture

The foundation of Aadikarta is an enterprise-grade real-time chat and billing engine — designed to be tamper-proof, auditable, and resilient to every failure mode a live session can encounter.

Real-Time Live Chat

WebSocket-based chat with FSM session lifecycle. Timer starts on astrologer's first message — not on request. Every state transition is server-authoritative and logged.

Server-Side Billing Engine

Wallet-based per-minute deduction, fixed-time packages, and hybrid model support. All billing is tamper-proof. Mid-session recharge and resume flow supported.

Smart Timer Control

Timer pauses on network failure, app crash, and astrologer disconnection (configurable grace periods). Auto-ends on wallet zero. Pro-rated refunds on early disconnect.

Compliance & Audit

Full audit logs for every billing event and session state. GST/invoice readiness for India. Astrologer payout calculation with deduction and dispute tracking.

Chat Session Lifecycle (FSM)

Every session transitions through a strict finite state machine. State changes are server-authoritative — the client can never force a transition. This prevents billing fraud, handles edge cases fairly for both parties, and produces a complete audit trail for every session.

1
REQUESTEDUser requests chat — minimum balance check runs before astrologer is notified
2
ACCEPTEDAstrologer accepts — session reserved, billing timer not yet started
3
ACTIVETimer starts on astrologer's FIRST message — not before
4
PAUSEDNetwork failure or disconnect detected — grace period countdown begins
5
RESUMEDReconnected within grace window — billing continues from paused timestamp
6
ENDEDWallet zero / package exhausted / mutual end — final billing settled
7
REFUNDEDPro-rated refund issued on early astrologer disconnect or dispute resolution

AI & ML Feature Layer

The AI layer creates a flywheel of better matches, higher satisfaction, and lower churn — a defensible moat that a basic marketplace cannot replicate without significant ML investment.

Personalisation & Matching

Smart Astrologer Matching

ML model ranks astrologers per seeker based on specialty match, past ratings with similar seekers, language preference, and consultation success rate — like Uber's driver matching, applied to expertise.

Concern Classification

NLP classifier auto-tags topics from the seeker's first message ('my marriage is struggling' → Marriage, 'job loss' → Career) to feed the matching algorithm in real time before a word is exchanged.

AI-Assisted Consultations

Kundli Auto-Analysis

Birth date/time/place → structured Jyotish interpretation (lagna, moon sign, dashas, planetary period) delivered as a pre-consultation brief. Saves astrologers 5–10 minutes per session.

AI Off-Hours Chatbot

LLM-powered bot handles basic queries when no astrologer is online and upsells to booked appointments — keeping users on-platform instead of leaving for a competitor.

Consultation Summary Generator

Post-session GPT-4 summary of key advice, action items, and follow-up date — delivered to the seeker as a downloadable PDF. High perceived value at approximately $0.02 per session.

Prediction & Retention

Churn Prediction

Model trained on days-since-last-visit, wallet balance, consultation frequency, and rating given. Flags at-risk users and triggers personalised push notifications or discount offers.

Next Consultation Propensity

Predicts when a specific user is likely to consult again based on their individual behaviour patterns, then sends a nudge just before that window.

Personalised Daily Horoscope

Uses birth data from SeekerProfile to generate daily/weekly forecasts via planetary transit rules + LLM natural language — replacing generic sun-sign content with something specific to each user.

Quality & Admin Intelligence

Review Sentiment Analysis

NLP on text reviews extracts structured themes ('rushed', 'accurate', 'calming') surfaced as tags on astrologer profiles — more trustworthy signal than a raw star rating alone.

Fraud & Anomaly Detection

Flags suspicious patterns: sessions ending in 30 seconds, wallet self-transfers, fake review rings. Rule-based + Isolation Forest on transaction and consultation data.

Revenue Forecasting

Prophet/ARIMA time-series model on daily transaction data forecasts next month's GMV — surfaced as one chart on the admin dashboard for payout planning.

Technology Stack

Backend & Real-Time

PythonFastAPIWebSocketsCeleryRedisPostgreSQLFSM Engine

AI & ML

OpenAI GPT-4spaCy NLPscikit-learnProphetpgvectorIsolation Forest

Frontend & Infra

React NativeNext.jsRazorpayAWSS3Firebase PushMiroTalk

What We Delivered

Every module below was scoped, built, and tested as part of a single engagement.

WebSocket chat with FSM session lifecycle engine
Server-side billing engine (per-minute, fixed, hybrid)
Wallet management with mid-session recharge + GST invoicing
ML astrologer matching model
NLP concern classifier (first-message auto-tagging)
Kundli auto-analysis module
GPT-4 consultation summary generator (PDF delivery)
Churn prediction and next-consultation propensity models
Fraud detection (Isolation Forest on transaction patterns)
Revenue forecasting dashboard (Prophet/ARIMA)
React Native mobile app + Next.js admin panel
Razorpay integration with astrologer payout management

Frequently Asked Questions

How does per-minute billing work in a live chat marketplace?+

Per-minute billing uses a server-side timer that starts only when the service provider sends their first message — not when the session is requested or accepted. The billing engine deducts from the user's wallet each minute, sends low-balance warnings, and auto-ends the session when the wallet reaches zero. All billing is server-authoritative to prevent client-side manipulation.

How does AI astrologer matching work?+

AI astrologer matching uses an ML model to rank astrologers per seeker based on specialty alignment with their stated concern, historical rating patterns with similar seekers, language preference, consultation success rate, and current availability. The first message typed by the seeker is classified by an NLP model to auto-tag the concern and feed the ranking algorithm in real time.

What happens if a user loses connectivity mid-session?+

The billing timer pauses automatically on network failure, app crash, or astrologer disconnection, with a configurable grace period. If the user reconnects within the grace window, the session resumes and billing continues from where it paused. If the astrologer drops the session without user action, a pro-rated refund is issued to the wallet. All state transitions are logged server-side for audit and dispute handling.

Building a Live Expert Marketplace?

Tutoring, legal advice, financial coaching, astrology — any domain where experts meet seekers in real time faces the same billing and matching challenges. Aavya LabTech can architect the core platform, billing engine, and AI personalisation layer you need to build a defensible product.

Book a Free Consultation