Founder Notes
Founder Notes · 19 July 2026 · 8 min read
Behind the Build

The RAG Stack Behind Every Prediction

Most AI astrology apps autocomplete a horoscope. Supastro does the opposite: an eight-layer RAG pipeline welded to a deterministic chart core that retrieves the rule, computes the math, and verifies the answer before you ever see it.

By Sandesh
8 min read
The RAG Stack Behind Every Prediction

Every “AI astrology” app in 2026 is, under the hood, the same thing: one language model, one text box, and a prompt that says “answer like an astrologer.” The model then does what language models do — it autocompletes. Fluent, confident, and completely ungrounded. It will invent a Dasha, misplace a house lord, hallucinate a verse, and cite a scripture that does not say what it claims. It sounds like wisdom. It is statistically plausible text.

At Supastro we refused to ship a confident guesser. So we built something closer to a reasoning engine with a library card and a calculator — a Retrieval Augmented Generation (RAG) pipeline welded to a deterministic astronomical core. Here is the why, the how, and the when.


Why RAG at all

A raw language model has two failure modes that are fatal for astrology: it hallucinates (invents rules) and it cannot do math (Dashas, degrees, divisional mappings). RAG fixes the first — every interpretive claim is retrieved from real classical text, not generated from vibes. A deterministic chart engine fixes the second. The model's only job is the thing it is actually good at: synthesising language over evidence it did not invent.

The quickest way to see the difference is side by side.

DimensionTypical AI astrology appThe Supastro engine
Source of claimsGenerated from the model's memoryRetrieved from named classical texts
The chart mathGuessed, and re-guessed each timeComputed once, deterministically, then cached
CitationsFabricated or absentTraced to a source, ranked by authority
ConsistencyDrifts between sessionsSame birth, same chart, forever
ConfidenceAlways certainCalibrated, and honest when it is unsure
Your historyIgnoredEnforced — it cannot contradict your timeline

How it works — the pipeline

Picture a single question flowing through eight layers, zero through seven. Here is the whole flow at a glance before we walk it.

LayerStageWhat happens
0Chart coreCompute the exact chart — deterministic, cached
1CorpusClassical texts, chunked and embedded
2Hybrid retrievalSemantic + keyword search, fused
3Authority weightingRank by source tier, resolve conflicts
4RerankerRe-read the shortlist for this exact question
5Evidence fusionInject live timing, strength, and your events
6VerificationA council and guardrails cross-examine the draft
7ObservabilityMeasure retrieval quality on every change

Layer 0 · Deterministic chart core

Before a word is generated, we compute your chart from an ephemeris-grade sidereal (Lahiri) engine: all sixteen divisional charts (D1–D60), the full Vimshottari Dasha tree resolved to five levels (Mahā → Antar → Pratyantar → Sookshma → Prāṇa), Ashtakavarga (BAV/SAV) bindus per house, Arudha padas, avasthās, and computed special points — Indu Lagna, Bhrigu Bindu, the Yogi point.

This is math, not opinion. And it is idempotent: your birth data is snapped and hashed into a cryptographic fingerprint, so the same birth always resolves to the same cached chart — same input, same answer, forever. Most apps let the model re-guess the math every time and drift. We do not.

Layer 1 · The corpus

The foundational canon — Brihat Parāśara Horā Śāstra, Jaimini Sūtras, Phaladeepika, Saravali and allied classical treatises — is segmented into passage-level chunks and encoded as high-dimensional vector embeddings in a vector index.

Layer 2 · Hybrid retrieval

Your question is embedded and searched two ways in parallel: semantically (dense-vector similarity catches meaning, so “delays in marriage” finds the 7th-lord rule even without the word “delay”) and lexically (full-text keyword search with OR-expansion catches exact terms: a named yoga, a Sanskrit word, a specific combination). The two ranked lists are merged with Reciprocal Rank Fusion. Broad understanding and sharp recall, together.

Layer 3 · Authority weighting and conflict resolution

Not all sources are equal. Every chunk carries an authority tier — canonical, classical, curated, experimental — applied as a rerank weight. When two texts disagree (they often do), the engine is bound by a precedence rule: defer to the higher-authority source, and where a point is genuinely unsettled, say so rather than fake certainty. Topic-scoped filtering keeps unrelated material out of a focused reading.

Layer 4 · The reranker (the second read)

Retrieval finds relevant passages; it does not find the single most useful answer to this exact question. So a cross-encoder-style reranker re-reads the shortlist with your question held in mind and re-scores each passage on direct relevance. De-duplication and a per-source diversity cap then stop any one text from flooding the context. Librarian, not search engine.

Layer 5 · Evidence fusion

The retrieved rules are fused with precomputed evidence blocks injected straight into context: a Live Dasha Override (current periods to the second), a Timing Oracle that scores future windows into concrete months instead of vague decades, an Ashtakavarga strength grid, Varga Corroboration that cross-checks a promise across the governing divisional chart and emits a convergence verdict, and Event Memory — your confirmed life events, with a post-generation validator that blocks any prediction contradicting your real timeline.

Layer 6 · Verification and safety

For deep questions, a multi-agent council (a chief reasoner and a verifier) cross-examines the synthesis. A three-layer guardrail — a fast pattern screen, a classifier gate, and a locked, injection-resistant system contract — keeps the reading on scope, and an intent signal keeps the tone right, with a hard-wired crisis net for distress. This is the layer that kills hallucination before it reaches you.

Layer 7 · Observability

We do not ship on faith. Retrieval is instrumented (hit rate, top-similarity, latency), and a golden-set evaluation harness scores the pipeline on hit@k and Mean Reciprocal Rank on every change — so an “improvement” that quietly degrades retrieval gets caught before you ever see it.

A question, start to finish

Make it concrete. Say you ask, “When will my career finally move?” Here is that one question travelling through the stack:

  1. Layer 0 computes your chart and resolves your active Dasha periods to the day.
  2. Layers 1–4 retrieve what the classical texts actually say about the houses and lords that govern career — ranked by authority, then reread for your exact question.
  3. Layer 5 fuses those rules with your live timing windows, your planetary strengths, and your confirmed life events.
  4. Layer 6 has a verifier cross-examine the draft, and the timeline validator blocks anything that fights your history.

What reaches you is a dated window, the rule it rests on, and a confidence level — not a vibe with a year attached.

When it fires

All of Layers 1–6 execute per question, in parallel with the chart build, before the first token is streamed — retrieval and computation race side by side, so grounding costs almost nothing in latency. And it is not only reactive: a background sentinel re-computes your live chart on a schedule, detects real period shifts and slow-planet transits, and reaches out once per genuine event. The engine can speak before you ask.

What that buys you

GuaranteeWhat it means for you
Computed, not guessedTiming is a dated window with the math behind it
Cited, not fabricatedClaims trace to a named text, ranked by authority
Consistent, not driftingDeterministic fingerprinting keeps your chart stable
Verified, not assertedCross-divisional corroboration and a verifier calibrate confidence
Non-contradictoryEvent Memory refuses to fight your own history
We don't prompt a model. We interrogate the canon and cross-examine the answer before it reaches you.

FAQ

What is RAG, in plain terms?

Retrieval Augmented Generation means the system looks up real source material and reasons over it, instead of answering from memory. In Supastro, every interpretive claim is retrieved from a named classical text before a word is written.

Does the language model calculate my chart?

No. The chart — positions, divisional charts, the Dasha tree, strengths — is computed by a deterministic engine and cached. The model only synthesises language over facts it is handed.

How do you stop it citing texts that don't say what it claims?

Retrieval pulls the actual passages, an authority tier ranks them, a reranker re-reads them for your question, and a verifier cross-examines the draft. A claim that is not supported does not survive.

Why does the same question give a consistent answer?

Your birth data is hashed into a fingerprint and the chart is cached, so the math never re-drifts. The retrieval and verification layers are structured, not improvised, so the engine does not reinvent your chart between sessions.

Is this Vedic astrology or something new?

The canon is classical Vedic astrology. What is new is the machinery around it — computing the chart exactly, grounding every claim in the texts, and verifying the result. We call the overall approach Computational Vedic Intelligence.