Developer uses rules engine, not LLM, to prevent hallucinations in astrology app
A software developer building a BaZi (Chinese Four-Pillars astrology) app found that LLMs left unconstrained would silently invent chart elements and astrological rules with false confidence. To fix this, the developer adopted a strict architecture where a deterministic TypeScript rules engine computes all chart facts, and the LLM is only permitted to phrase those pre-computed facts — never generate them. When a user's birth hour is unknown, the engine calculates all 12 possible charts and passes only facts consistent across every candidate to the model, explicitly marking the gap rather than letting the model fill it. Generated responses are then run through a validator that detects invented chart elements and flags fatalistic language patterns before any output is stored. The developer argues this separation of 'what is said' from 'how it is said' is a portable engineering principle applicable to any LLM product where fabrication is unacceptable.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in