Zenfinity

Zenfinity — Conversational Astrology Platform

StarSage is the Vedic-astrology AI at Zenfinity, a pre-seed AI wellness platform. In-depth astrological conversations from agents grounded in nakshatra, dasha and live planetary data, served from fine-tuned open-weight models rather than a frontier API.

Role
Chief Technology Officer
Period
Mar 2024–Sep 2025

Screens from the running system

  • StarSage — the live product at starsage.co, showing the conversational astrology interface.

01 Problem What was actually hard

As CTO I owned the technical roadmap and delivery for the pre-seed venture, leading a team of 12 across AI, backend and data, and built the company AI core behind both products — StarSage for Vedic astrology and InnerCoach for psychology-based coaching. StarSage had to hold a genuinely astrological conversation, not a generic chat. That means every answer is conditioned on a computed natal chart (rashi, nakshatra, lagna, current dasha) and phrased in the vocabulary a practitioner would use. The hard constraint was unit economics: a consultation had to return in under two seconds at a price point that works on Indian mobile payments, which ruled out paying frontier-API rates per turn.

02 Data Sourcing and preparation

Wired NASA JPL ephemeris data into the request path so planetary positions are computed live from birth date, time and location rather than looked up from a static table. Collected 8,000 consultation transcripts from practising astrologers (with permission) and mined them for few-shot exemplars keyed by chart signature. Built an evaluation set of consultations scored by practising astrologers on relevance and cultural accuracy, and used it as the acceptance gate for every model change.

03 Models Evaluated, kept, cut

7 evaluated 5 kept 2 cut

Kept 5

  • Llama 3.1 8B Instruct

    Primary generator; strong in-context learning over chart data and few-shot exemplars

  • Mistral 7B Instruct

    Lighter alternative on the same prompt contract; used under peak load

  • LoRA / PEFT adapters

    Domain adaptation on ~3M trainable parameters instead of retraining 8B weights

  • int8 quantization

    Cut median latency from ~4.5s to ~1.8s with no measurable scoring loss

  • Sentence Transformers (MiniLM)

    Retrieves semantically similar past consultations as RAG context

Cut 2

  • GPT-4 Turbo

    ₹6.50 per consultation against ₹0.08 self-hosted; also a hard vendor dependency

  • Unquantized Llama 3

    4–5s per turn — outside the conversational budget

04 Architecture How it fits together

Birth data is turned into a natal chart by a Python ephemeris routine, then that chart becomes structured prompt context. A Sentence Transformers query pulls three semantically similar past consultations out of Chroma for grounding, the fine-tuned Llama 3.1 generates the reading, and identical charts are served from a short-TTL Redis cache. External astrological APIs are attached to the agent as tools so chart data stays authoritative instead of hallucinated. Fine-tuning ran on Hugging Face and TensorFlow toolchains; hosted inference was benchmarked on Fireworks.ai and OpenAI endpoints before the self-hosted path won on cost.

Architecture flow: Birth data then Ephemeris compute then Semantic retrieval then Llama 3.1 8B, int8 then Redis cache then Reading returned 01 Birth data date, time, place 02 Ephemeris compute rashi, nakshatra, lagna, dasha 03 Semantic retrieval 3 similar past consultations (Chroma) Astrology tool APIs 04 Llama 3.1 8B, int8 chart context + few-shot exemplars 05 Redis cache identical chart, instant replay 06 Reading returned

05 Production Deployment and operation

Owned backend and database development alongside the AI core, sustaining 99.9% uptime at sub-2s median response under concurrent load while growing the active user base from 1,100 to 12,000 and cutting LLM inference cost by roughly 40% through model optimisation, quantization and caching. Ran on AWS EC2 with auto-scaling groups: PostgreSQL for profiles, Chroma for embeddings, Redis for the inference cache, CloudWatch plus a custom output scorer that classifies each response for relevance and cultural fit. Astrologers review a weekly sample and their scores feed the next adapter revision.

06 Deep dive The long version, in full

Problem

Astrology in India is deeply cultural—it shapes major life decisions (career, marriage, health). Yet making personalized astrological guidance accessible globally requires bridging ancient wisdom (nakshatra cycles, dasha periods, ashtakvarga) with modern technology.

The technical challenge: LLM inference at scale without breaking unit economics. Each consultation needed to:

  • Compute the user’s natal chart (planetary positions at birth)
  • Reference cultural context (dasha timing, compatibility with Indian calendar)
  • Generate personalized guidance within 2 seconds
  • Cost <₹0.10 per consultation (mobile payment-friendly pricing)

Running GPT-4 at ₹6.50 per consultation was economically unviable. We needed a lightweight, open-weight model that could be fine-tuned for astrology and run on our own infrastructure.

Data Preparation

We integrated NASA JPL’s ephemeris database to compute precise planetary positions. Every consultation started with natal chart computation:

  • User’s birth date/time/location
  • Calculate Sun (rashi), Moon (nakshatra), Ascendant (lagna)
  • Compute dasha period (current age cycle)
  • Generate ashtakvarga scores (strength of planets)

We collected 8,000 consultation transcripts from human astrologers (with permission) and extracted few-shot examples: “User is Libra Sun, Ashlesha nakshatra, in Saturn dasha. Response:”

An evaluation set of 2,000 consultations was reviewed by practicing astrologers for relevance, cultural accuracy, and guidance quality. This became our ground truth.

Models Evaluated

Model Result Note
Llama 3.1 8B Kept Fast inference; culturally aware; strong in-context learning
Mistral 7B Kept Slightly faster alternative; similar quality
Sentence Transformers Kept Retrieve past consultations for RAG context
Quantization (int8/int4) Kept 40% latency reduction, imperceptible quality loss
LoRA Fine-tuning Kept Domain adaptation; 3M parameters instead of 8B
GPT-4 Turbo Cut Cost ₹6.50/consultation unsustainable at scale
Unquantized Llama 3 Cut 4–5s latency; replaced by int8 quantization

Architecture

The consultation pipeline:

[Birth Data] -> Ephemeris Compute (natal chart)
  v
Semantic Search (find 3 similar past consultations)
  v
LLM Prompt (Llama 3.1, quantized int8)
  <- [Chart context] + [Few-shot examples] + [RAG results]
  v
Cache in Redis (same chart = instant future lookups)
  v
[Guidance Response]

The LLM prompt includes:

  • Natal chart (Sun/Moon/Ascendant signs, dasha period)
  • RAG context (3 semantically similar past consultations via Sentence Transformers)
  • Few-shot examples (human-written samples for cultural grounding)

Inference runs on GPU (AWS g4dn) with CPU fallback for peaks. Quantization (int8) reduced model size from 32GB to 8GB and cut latency from 4.5s to 1.8s without perceptible output degradation.

Production & Scale

Started with 1,100 beta users in Mar 2024; reached 12,000 by Sep 2025.

Key optimizations:

  1. Quantization: int8 Llama 3.1 is 40% faster than unquantized
  2. LoRA fine-tuning: 3M trainable parameters adapted the model to astrology without full retraining
  3. Redis caching: Identical birth charts (repeat users) get instant responses
  4. RAG: Semantic search provides cultural grounding and consistency

Cost structure: ₹0.08 per consultation (LLM + GPU + storage). Sustainable at volume.

Reliability: 99.9% uptime maintained via health checks, auto-scaling, and graceful fallback. Average inference latency: 1.6s median, <2.2s P95.

Human feedback loop: Astrologer review of LLM outputs (weekly samples) continuously improves relevance scores. We track “astrologer satisfaction” as a key metric.

Result: a self-hosted stack that holds a genuinely astrological conversation at roughly one-eightieth of the per-consultation cost of the frontier API it replaced, with practising astrologers — not an automated metric — as the acceptance gate on quality.

active users
1,100 -> 12,000 (~11×)
uptime
99.9% at sub-2s median response