# The RAG Stack Behind Every Prediction

Inside Supastro's RAG engine: a deterministic chart core, hybrid retrieval over classical texts, authority reranking, evidence fusion, and verification.

Author: Sandesh · Published: 2026-07-19 · Updated: 2026-10-01 · Section: Founder Notes · Category: Behind the Build · Reading time: 8 min · Publisher: Supastro (Quantum Karma), Bangalore, India

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](https://supastro.com/founder-notes/how-deterministic-astrology-engines-work). Here is the why, the how, and the when.

> **The one-line version**
>
> A raw model autocompletes. Supastro retrieves the rule, computes the math, synthesises the language, and verifies the result before you ever see it. Ground truth in, prose out — never the reverse.

---

## 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.

| Dimension | Typical AI astrology app | The Supastro engine |
| --- | --- | --- |
| Source of claims | Generated from the model's memory | Retrieved from named classical texts |
| The chart math | Guessed, and re-guessed each time | Computed once, deterministically, then cached |
| Citations | Fabricated or absent | Traced to a source, ranked by authority |
| Consistency | Drifts between sessions | Same birth, same chart, forever |
| Confidence | Always certain | Calibrated, and honest when it is unsure |
| Your history | Ignored | Enforced — it cannot contradict your timeline |

> **A different machine**
>
> A chatbox hands you an answer. Supastro hands you the answer, the rule it rests on, the chart math that activates it, and how sure it is. That is not a prettier prompt. It is a different machine.

## 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.

| Layer | Stage | What happens |
| --- | --- | --- |
| 0 | Chart core | Compute the exact chart — deterministic, cached |
| 1 | Corpus | Classical texts, chunked and embedded |
| 2 | Hybrid retrieval | Semantic + keyword search, fused |
| 3 | Authority weighting | Rank by source tier, resolve conflicts |
| 4 | Reranker | Re-read the shortlist for this exact question |
| 5 | Evidence fusion | Inject live timing, strength, and your events |
| 6 | Verification | A council and guardrails cross-examine the draft |
| 7 | Observability | Measure 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](https://supastro.com/founder-notes/how-ai-reasons-across-dashas-and-transits) 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](https://supastro.com/founder-notes/how-ai-reasons-across-dashas-and-transits) that scores future windows into concrete months instead of vague decades, an Ashtakavarga [strength grid](https://supastro.com/founder-notes/why-planetary-strength-matters-in-ai-astrology), 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](https://supastro.com/founder-notes/why-llms-hallucinate-astrology) 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.

> **Why the layers are separate**
>
> Each layer is independently testable, so we can improve one without breaking the others. That modularity is the same discipline behind the whole [Supastro architecture](https://supastro.com/founder-notes/how-supastro-is-built).

## 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

| Guarantee | What it means for you |
| --- | --- |
| Computed, not guessed | Timing is a dated window with the math behind it |
| Cited, not fabricated | Claims trace to a named text, ranked by authority |
| Consistent, not drifting | Deterministic fingerprinting keeps your chart stable |
| Verified, not asserted | Cross-divisional corroboration and a verifier calibrate confidence |
| Non-contradictory | Event 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](https://supastro.com), 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](https://supastro.com/founder-notes/how-deterministic-astrology-engines-work) 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](https://supastro.com/founder-notes/what-is-computational-vedic-intelligence).

### Go deeper into the build

- [How Supastro Is Built](https://supastro.com/founder-notes/how-supastro-is-built) — The five-layer architecture
- [What Is Computational Vedic Intelligence?](https://supastro.com/founder-notes/what-is-computational-vedic-intelligence) — The idea this engine serves
- [How AI Reasons Across Dashas and Transits](https://supastro.com/founder-notes/how-ai-reasons-across-dashas-and-transits) — The timing layer, up close
- [Why LLMs Hallucinate Astrology](https://supastro.com/founder-notes/why-llms-hallucinate-astrology) — What Layer 6 defends against
- [See the engine in the app](https://supastro.com/dashboard) — Ask it something that matters

**Ask Supastro something that matters** Build your chart and get a reading that shows the rule, the math, and the confidence behind every claim. [Open Supastro](https://supastro.com/dashboard)

---

Canonical: https://supastro.com/founder-notes/the-rag-stack-behind-every-prediction · Supastro is an AI astrology platform for Vedic astrology (Jyotish), built as Vedic Super Intelligence (SI), by Quantum Karma, Bangalore, India. Chart positions are computed from NASA JPL ephemeris data on the Lahiri (Chitrapaksha) ayanamsa. 40 instruments are free to use.