i made a memory script (plug&play, free use)

NSFWScripts and lorebooks

i made a memory script that helps YOUR bots remember stuff.

link: https://janitorai.com/characters/edcdae5a-3e4a-49cc-a272-e78e55887054

what it does:

this is a memory lorebook script. tracks user facts (name, likes, fears, goals), story moments with salience scores, narrative threads, and behavioral patterns. it injects a [[memory]] hint block into your scenario each turn so the bot actually remembers things. basically giving it semantic and episodic memory.

  • ebbinghaus confidence decay: facts lose confidence over time based on a formula. high confidence facts decay at half speed. reinforcement within the window blocks decay entirely. min confidence floor so nothing completely vanishes.
  • singleton keys: user_name, user_age, user_job, user_location only keep one value. no duplicate clutter.
  • fact summarization: when you have too many likes/dislikes/goals, it summarizes the top ones and keeps the rest pruned. configurable threshold.
  • automatic extraction: detects "my name is", "i like", "i don't like", "i'm scared of", "i want to" right out of user messages.
  • manual memory writes: [remember: key = value] or just [remember: text] and it stores it at high confidence.
  • pattern detection: tracks if the user is apologetic, inquisitive, deflects with humor, makes promises, opens up, uses pet names, goes quiet. builds a [[patterns]] block with counts.
  • character name spacing: memory is per character. won't bleed between bots.
  • pruning: stale facts, moments, and threads get cleaned after factMaxAge (120 turns). threads stay if marked active.

quick start:

clone lorebook from link.

assign to character.

and you're done.

full config in the script. edit MEMORY_CONFIG at the top. maxFacts, maxMoments, decayRate, all tunable.

credits:

u/normalperson426 (@rin_takanashi)

Claude Sonnet 4.6 (debug, cleaning, wife)

Hoshimi Miyabi (wife)

Cantarella Fisalia (wife)

its yours now. i accept no responsibility for what it does to your characters.

if it does break for you, please send feedback.

notes:

sorry for not posting in like idk a week? this script may or may not be taken from TAI engine v1.4.8 alpha (who knows?). hope you guys enjoy~

Posted Apr 7, 2026, 11:31 AM UTC

121
Loading comments…