Niste-chan's TAI Engine V1.4.7 Release (Free Advanced Script)

Niste-chan's TAI Engine V1.4.7 Release (Free Advanced Script)

136

939

Niste-chan's Trust + Affection + Intimacy (TAI) Relationship & Emotions Engine

WIP version: V1.4.8 Alpha | Stable version: V1.4.7 + V1.4.7 Lite

Drop this in and your bot instantly gains memory, emotions, jealousy, and realistic relationship progression.

What this does:

- Makes your bot remember you (memory)

- Adds emotions + mood swings

- Builds relationships over time (realistic relationships)

- Works automatically (no setup)

Setup: 30 seconds

A dynamic relationship simulation engine for Janitor Ai bots. Tracks affection, trust, intimacy and adaptive mood mechanics. including multi-character scenes with archetype-specific behaviors, confession systems (Later versions)

⚠️ Token Usage: 1000~ output tokens (V1.4.7) | Requires models with 16k+ context for best experience
JLLM users: Use V1.4.2, V1.4.3 or V1.4.7 Lite (highly recommended) for stable performance

Quick Start:

  1. Clone the script via lorebooks listed below, attach the script to the bot you want.

  2. Ensure your character has a clear name in their description (for example, "Name: Jack" | "Your friend, Aileen".

  3. And voilà, metrics will initialize automatically; no need to adjust anything, unless curious.

Works Well:

-(Gemini 3.1+) -(Claude 3.5+) -(Deepseek V3+) -(Kimi K2.5) -(Grok 4.1 Fast+) -(GLM 4.6+) -(Step 3.5 Flash) -(Trinity Large Preview) -(Minimax m2.5+), etc.

Version Notes:

Version Status Notes

V1.4.7 — Fully stable, full features.

V1.4.7 Lite (Heavily Recommended for JLLM) — V1.4.5 but for JLLM (Fully stable)

V1.4.6 — Basically 1.4.6 but with more features.

V1.4.5 Lite — V1.4.5 but for JLLM (Multi-char a bit unstable)

V1.4.5 — New archetypes, multi-character improvements, jealousy, etc.

V1.4.4 (Stable Latest Release) — Recommended for proxy users

V1.4.2–1.4.3 — Optimized for lower context windows

V1.4.0–1.4.1 — Broken, do not use

Features (Brief):

  • Core Metrics

    • Affection, Trust, Intimacy each tracked independently per character on a -100 to +100 scale. Gains are scaled by current metric value (diminishing returns at 30+, heavily reduced at 70+) and capped at ±20 per turn.

    • Mood runs 0-100 with neutral at 50. Decays toward neutral by 3 points per turn when no significant delta fires. Hard capped at ±20 delta per message. (V1.3.0+)

    Character & Name Detection

    • Strips script headers, comment blocks and engine keywords from personality/scenario before scanning to prevent false name matches. Falls back through multiple pattern types (name:, "she is called", "[Character= blocks", relationship declarations) before defaulting to {{char}}.

    • Multi-character scenes detected via dialogue patterns ("Name: text") and said-patterns ("Name said/replied"). Each detected character gets independently seeded metrics, archetypes and milestone states. (v1.4.2+)

    Seeding & Presets

    • On first load, each character is seeded from their card context. Relationship type (lover, best friend, stranger, enemy, family etc.) sets starting metrics. Biological family members get low intimacy floors and are flagged separately for the penalty system. SEED_VERSION bump forces a full reset. (v1.4.2+)

    Archetypes (9 total)

    • Each archetype has a modifier function that intercepts metric gains and reshapes them. Kuudere converts positive affection/trust/intimacy gains into negatives until warming level unlocks. Tsundere drops mood on affection gains (embarrassment). Bratty resists trust gains hard until threshold met. Yandere amplifies intimacy and randomizes trust fluctuation. Dandere slows all gains uniformly. Flirty amplifies affection and intimacy but resists trust early. Masochist and Sadist only activate their amplifiers once trust ≥ 45 and affection ≥ 25 — below that physical actions backfire. (v1.4.5+)

    Kuudere Warming System

    • Separate warming tracker per kuudere character. Checks every 50 messages whether affection ≥ 30 and trust ≥ 20. If met, warming level increments (max 3). Each level reduces the cold rejection multiplier by 25%, with level 3 allowing small affection gains to finally land positively. Romantic gifts are heavily penalized below warming level 2. (v1.4.5+)

    Intent Scanner

    • Scores input across 6 intent categories (affection, support, vulnerability, boundary, hostility, sexual) by counting pattern matches. Top scoring category becomes primaryIntent and influences mood delta (+1 for affection/support, -1 for hostility/boundary) and nudges metrics directly by 1 point. (v1.4.2+)

    Sarcasm Detection

    • Confidence-based system requiring a score ≥ 4 to fire. Weighted by negative sentiment (+3), dry punctuation (+2), prior negative message (+2), low mood (+2), recent negative message streak (+2), hostile intent (+3). Offset by playful tone (-4), good mood (-2), high affection (-1), affectionate intent (-3). When fired, forces moodDelta to a negative floor regardless of other signals. (v1.4.2+)

    Tone Signals

    • Scans raw (casing-preserved) input for: ALL CAPS clusters (≥2 words, -8 mood), trailing ellipsis (-4), repeated letters (positive like "aww" = +4, negative = -4), multiple exclamation marks (context-checked, ±5), multiple question marks (-3), laughter/casual markers (+5), softening language (+5). Negative deltas amplified by up to 1.5x if 2+ of the last 3 messages were negative. (v1.4.2+)

    Keyword Trigger System

    • ~20 trigger patterns covering affection, trust, intimacy and hostility. Each trigger has independent affection/trust/intimacy weights. Gains are scaled by current metric value before archetype modifiers are applied. A prefilter regex gates the loop so triggers only run when relevant keywords are present. Optional cooldown system prevents the same trigger firing twice within N turns. (v1.3.0+)

    Gift System

    • Detects give/hand/offer/buy patterns in both directions (user→char and char→user). Classifies gift into 5 types (sentimental, romantic, practical, neutral, thoughtless) by keyword matching against item and full input. Each archetype has a multiplier table per gift type — e.g. yandere gets 2.0x on sentimental, bratty gets 2.0x on thoughtless, kuudere gets 0.3x on romantic. Gifts given within 3 turns of the last gift are penalized 50% and increment a fatigue counter. (v1.4.5+)

    BDSM System

    • Detects slap/hit/punch/spank patterns directionally (user hits char vs char hits user). Masochist and Sadist archetypes get positive metric and mood outcomes only when trust ≥ 45 and affection ≥ 25. Below threshold, all physical actions produce negative outcomes. Bratty accepts discipline with reduced positive gains at high relationship, rejects hard at low. All other archetypes treat physical actions as hostile regardless. (v1.4.5+)

    Jealousy System

    • Three condition types scored independently: relationship terms (boyfriend, date, going out etc.), warm adjectives about third parties, positive shared activities. Character must have affection ≥ 40 to trigger. Intensity scales 4/7/10 base by condition count, plus bonus from affection above 40. Each archetype has a unique jealousy response — yandere spikes hard on all metrics, dandere withdraws into intimacy loss, flirty converts jealousy into intimacy gain but trust loss, biological family responds with protective concern rather than possessiveness. Active jealousy persists 2-4 turns based on condition count. Capped at 2 characters jealous simultaneously, prioritized by combined relationship strength. (v1.4.2+)

    Confession System

    • Triggered by love confession patterns from either user or character. Opens a resolution window (default 3 turns) during which acceptance or rejection patterns are scanned. Acceptance locks metrics at minimum 60/60/60 and upgrades relationship tier to lover permanently. Rejection applies small metric penalties and injects a bruised-air scenario note. Unresolved window injects a reminder each turn. Lover tier permanently overrides friend/bestfriend framing in all injections. (v1.4.2+)

    Milestone System

    • Affection, trust and intimacy each have 4 milestone states (none, mid, high, neg) with thresholds at 30, 70 and -50. On state change, a narrative sentence is injected into scenario describing the internal shift. Milestones are tracked per character and persist across turns. (v1.4.2+)

    Threshold Injections

    • At affection ≥ 70/30/≤-50, trust ≥ 70/≤-40 and intimacy ≥ 70/40, specific behavior and personality directives are injected into both personality and scenario fields. Old injections are stripped and replaced each turn to prevent accumulation. Lover tier injection overrides relationship framing permanently post-confession. (v1.4.2+)

    Memory Layer

    • Lightweight fact store (max 8 facts) tracking user name, likes and dislikes via pattern matching. Facts are upserted by key so only the most recent value persists. Injected into scenario as a memory cue each turn. (v1.4.2+)

    Contradiction Detection

    • Tracks user-stated facts across 4 categories (pet, job, age, location). If a new statement conflicts with a stored value, trust is penalized -8, affection -3, mood -5 and a suspicion note is injected into scenario. (v1.4.5+)

    Biological Family Penalty

    • Characters flagged as biological family (parent, sibling, grandparent, child, cousin, aunt/uncle) have intimacy floors at 0 and are tracked with _biologicalFamily: true. Sexual content patterns detected in the same scene trigger -15 affection, -20 trust, -25 intimacy penalties and a warning injection into scenario. (v1.4.5+)

    Duplicate & Spam Guards

    • Optional dedupe guard prevents the same message being processed twice (compares last message text and count). Optional trigger cooldown system blocks the same trigger pattern re-firing within a configurable window. Both are off by default and toggled via flags at the top of the script. (v1.3.0+)

    Multi-Character Ambient Processing

    • Secondary characters in a scene receive ambient metric shifts based on the primary character's mood delta (±1 affection if delta ≥ 5). Negative inputs decay all detected characters simultaneously. Each character maintains fully independent metrics, archetypes, milestone states, gift history and jealousy

      state. (v1.4.2+)

      Card Conflict Resolver (v1.4.6) Scans character cards for contradictory relationship signals (e.g., "enemy" vs "childhood friend") and assigns a weighted score to each category. The highest-scoring category seeds the initial metrics. If scores are within a 2-point margin, the engine logs a "Contradiction Warning" and prioritizes the more "stable" relationship. Biological family flags (Parent, Sibling, etc.) act as a hard override, bypassing the scoring system entirely to ensure safety and logic consistency.

      Dynamic Archetype Shifting (v1.4.6) Introduces "Conditional Archetypes" that can override the primary personality under specific stress or milestone triggers. A Kuudere who reaches Warming Level 3 and Intimacy 70 may temporarily adopt Dandere modifiers during vulnerable scenes. Conversely, high hostility and low trust can shift a Flirty archetype into a Bratty or Sadist profile. These shifts are injected into the personality string as temporary behavioral directives.

      The Heartbreak System (v1.4.6) Detects "Third-Party Romantic Flags" where the user mentions a partner, spouse, or rival. If Affection is ≥ 30, the engine triggers an archetype-specific crisis:

      • Yandere: "Possessive Rage" (Mood -20, Trust -15, Intimacy +10 spike).

      • Tsundere: "Aggressive Denial" (Mood -15, Affection -10, sarcasm probability +50%).

      • Dandere: "Silent Withdrawal" (Intimacy -20, all metric gains frozen for 3 turns).

      • Kuudere: "Emotional Shutdown" (Reverts to Warming Level 0 immediately).

      Weighted RNG Confession Engine (v1.4.6) Replaces static confession triggers with a probabilistic "Will" check. The chance for a character to confess is calculated by: (Affection * 0.45) + (Trust * 0.35) + (Intimacy * 0.20).

      • Modifiers: +15% for Yandere, -20% for Tsundere, -50% for "Super Shy" Danderes.

      • Window: If the RNG hits, a 3-turn "Confession Window" opens. If the user provides a supportive or romantic prompt during this window, the character's confession logic is injected into the next response.

      Metric Decay & Stagnation (v1.4.6) To simulate realistic relationship "cooling," high metrics (Affection/Trust > 80) now experience a -1 point decay every 15 messages if no positive triggers or "Significant Deltas" (±5) have occurred. This encourages active maintenance of established relationships and prevents "stat-parking" at maximum values.

      Multi-Character Context Deduplication (v1.4.6) An advanced safety guard that prevents the engine from processing the same message twice during high-latency AI generations. It stores a hash of the _lastMsg and _msgCount. If the script is re-run on the same message, it aborts immediately to prevent double-penalties or doubled-gains, ensuring the integrity of the -100/+100 scale.

      Persona Engine Variable Injection (v1.4.6) The engine now outputs a "State String" that can be read by external AI persona engines. This string includes a condensed summary of current status: [T:45|A:60|I:10|M:72|Arch:Tsundere|Warm:N/A|Lvl:Friend]. This allows the LLM to adjust its prose style (e.g., using shorter, snappier sentences for high Mood/Bratty or long, flowery prose for high Intimacy/Yandere) without manual user intervention.

Usage & Credits:

Free to use: Public bots, private bots, forks—anything you like. If you share a modified version or use this in a public bot, credit would be appreciated.

Credits:

Script author: @rin_takanashi (Niste-chan)

Discord: @bedddddddddddddddddddd, @urdaliycomrade0772

Original character (Eva): @bigbody

Additional contributions: shazzz.j, angyortz_ (Emotional support), Claude Sonnet 4.6 (Debugging, Cleaning, Syntax, Advanced/Tedious Regex, Guard System)

Previous Versions:

V1.0.0–1.2.0 are no longer available. Current support focuses on V1.4.x and above.

Notes: Please don't accuse of "this is ai written", first of all, why are you hating on AI usage on an AI site? Second of all, its human written (archetype systems, jealousy systems, confession systems, etc) and ai enhanced (guard system, advanced regex usage, debugging), don't get them mixed up.

V1.4.7 is out!!! use V1.4.7 Lite if JLLM!

Feedback welcome — helps improve the script and future releases.

  • Limitless
proxy allowed

Published chats

0

comments

Leave a comment or feedback for the creator ❤️