AI Astrology Chat
Chat answers grounded in 2,900 chunks of classical Vedic astrology texts, not a model's guess.
What it does
A birth chart, then a grounded conversation about it
Enter birth details — date, time, place — and get a computed chart: houses, planetary placements, dasha periods, a few classical conditions like exaltation and combustion. From there it's a text chat, answered with passages retrieved from a real corpus of classical texts rather than an LLM improvising, plus a daily Panchang almanac and PDF Kundali/matchmaking reports.
Architecture
Three services behind a strict boundary
Web (Next.js)
The entire user-facing app — auth, chart form, chat UI, reports. Never imports core-engine directly.
core-engine (Hono service) · third-party
Calls a third-party astrology API for planetary positions, then applies classical rules on top — house mapping, dasha trees, combustion, Sade Sati.
abhaya-shield
A regex + AI safety classifier every chat message passes through first — can hard-interrupt or redirect a reply before the LLM ever sees the message.
wisdom-rag
pgvector retrieval over 2,912 chunks from three classical texts, embedded with OpenAI text-embedding-3-small. Two-stage: chart-scoped rule lookup, then whole-corpus semantic search.
voice-orchestrator
Owns this whole per-message chain — calls abhaya-shield and wisdom-rag itself, then builds the prompt from retrieved passages + chart tags (never raw coordinates). Routes to Groq's Llama 3.3 by default, escalates to Claude Sonnet for paid or high-stakes replies.
Chat reply
Answer plus the source passages it was grounded in.
The module boundary is real, not just folder structure: core-engine runs as its own deployed HTTP service, and everything else is only allowed to see it through shared types — enforced by the fact that it's a network call, not an import.
Scoped to the chat pipeline: the Panchang almanac has its own cached lookup on top of core-engine, and the Kundali/matchmaking PDF reports are a heavier, payment-gated pipeline of their own — up to seven divisional-chart calls, several sequential LLM-narrated sections, then a dedicated PDF renderer. Different enough from chat that they'd need their own diagram.
Being precise about the two AI claims
What's real, and what's not built yet
The retrieval pipeline is the genuinely strong part — a real 2,912-chunk corpus, embedded and stored in Postgres via pgvector, retrieved in two stages and injected into the prompt as cited passages. That's a working RAG system, not a label.
Two things worth stating plainly. Planetary positions come from a paid third-party astrology API, not a local ephemeris — the classical rules layered on top are original engineering, but the underlying astronomical data is fetched, not computed. And despite a module internally named "the Voice," there's no speech input or output anywhere in the codebase — it's the name for the layer controlling the AI's conversational tone, not an audio feature.