In a category where most AI astrology apps wrap a single LLM call in a daily horoscope template, Cosmic Story v2 does something structurally different: every artifact it generates runs through a four-factor composition step before the AI is even called. That step is what makes the output feel like it knows who the chapter is for, when, and in what shape.

This post walks through the four factors, names what each one is for, and shows how they merge into a single prompt.

The four factors

┌──────────────────────────────┐
│ 1. Person + bond context     │
│ 2. Astrological surface      │
│ 3. User signal               │
│ 4. Cadence shape             │
└──────────────────────────────┘
       ↓
  composed prompt
       ↓
  AI generation
       ↓
  post-process + encrypt
       ↓
  surface in app

Each factor brings orthogonal information. None is redundant with another. Drop one and the output regresses noticeably; add a fifth and the prompt becomes muddier without gaining signal.

Factor 1: person + bond context

Who is this artifact for? What's their relationship to the user? What do we know about how this bond has felt recently?

This factor includes:

  • The person's name and type-of-relationship label (partner, sister, friend, parent, mentor, etc.).
  • Aggregated texture from the user's recent activity about this person: how many check-ins included this person's "with-tag", how many journal entries mentioned them, how the resonance scores for this bond have moved.
  • A short summary of recent chapters about this person, so today's chapter has continuity with yesterday's.

This is the dominant signal. Astrology can add texture, but if the prompt doesn't anchor on a specific person and the texture of that bond, the output drifts toward generic.

Factor 2: astrological surface

This is what makes the output cosmic story rather than journal app. But — critically — it's a modifier, not a dictionary.

Calculated via Swiss Ephemeris (sweph), the same library that powers every serious astrological practitioner's tooling. The factor includes:

  • The user's natal chart.
  • Synastry between the user and the specific person (their relationship in the sky, basically).
  • Current transits — what real planets are doing right now relative to the user's chart and the synastry chart.

Output gets 1 to 3 aspect chips — small structured tags like "Moon trine Venus" or "Mercury retrograde square Sun" — that the chapter can lean on as a modifier. The chapter doesn't have to say "Mercury's at 14° Gemini square your natal Sun". It says something like "directness will be tricky to land today; one short sentence beats three".

The default voice is plain English. Jargon mode is opt-in for the astrology-native user — same prompt, just the post-processor flips the surface vocabulary to use technical terms.

Factor 3: user signal

What's happened in the app, for this user, recently? Specifically:

  • Recent check-ins: mood, energy, with-tag patterns.
  • Resonance scores for the relevant bond: where Communication, Intimacy, Growth, Conflict have moved this week.
  • Coach messages from this thread (if any) — context-only, not for the AI provider to read literally.

This is what makes the chapter feel like the engine remembers your week. Without this factor, today's chapter is identical regardless of how you've been showing up.

Factor 4: cadence shape

What kind of artifact should this be?

  • A daily chapter (the most common case).
  • A weekly Sunday recap letter.
  • A coach reply (Luminara mode).
  • A ritual nudge.
  • An inbox card (fresh-bond pulse, weather, refresh, etc.).

Cadence picks the right template, the right length budget (chapter ≈ 220 words; coach reply ≈ 120 words; ritual nudge ≈ 30 words), and the right tone modifiers. Without it, the engine would have to guess from contextual cues, which is fragile.

What gets sent to the AI provider

The composed prompt is not a raw concatenation of user data. The composition step:

  • Strips raw PII. Names are tokenised (PERSON_1, PERSON_2) before the prompt reaches the provider; the post-processor swaps tokens back to real names after generation.
  • Scrubs journal entries the user has marked private.
  • Adds a system prompt that includes anti-claim guardrails (no medical / fertility / accuracy claims; no comparative slander; no clinical-replacement language).
  • Picks the cadence template — chapter / recap / coach / ritual / nudge — each with its own structured output schema.

The full payload goes to the AI provider via the AI_GENERATION_ADAPTER symbol token. The adapter is swappable; today My Zodiac AI uses one provider, tomorrow it might be another, and the engine doesn't care.

After the AI: post-processing

Once the AI responds, four things happen:

  1. Crisis classifier — checks if the user's recent input or this output contains crisis language. If yes, surface local support resources prominently.
  2. Aspect-chip extractor — pulls 1 to 3 astrology chips from the output.
  3. Anti-claim filter — strips any phrasing that violates the 30+ term forbidden list (medical, accuracy, partner-control).
  4. AES-256 encryption — the chapter body is encrypted before being written to MongoDB.

Then the artifact is persisted (in soulwise_chapters), an EventEmitter2 event fires (CHAPTER_COMPLETED), and the inbox surfaces it.

Why this matters for the marketing page

Most AI astrology apps wrap a single LLM call. The four-factor engine is the structural reason Cosmic Story v2 outputs feel like they know who they're for and when. It's also why the engine can produce up to 35 distinct AI-generated pieces per active premium user per week without sounding repetitive — every artifact composes off a different combination of person + signal + cadence.

This is, structurally, the wedge: nobody else in the category is composing prompts this way. Co-Star wraps one prompt per user per day. The Pattern doesn't generate fresh content at all. Paired only models one bond.

Four factors, one pipeline, eight artifact kinds. That's the engine.

Try Our Free Tools

Get personalized insights based on your birth chart

Share this article