Understanding Chat Memory in an LLM

By: Wally The Goblinrat

Table of Contents

What is Chat Memory?

Chat memory is how a character bot — powered by a large language model (LLM) like JLLM or ChatGPT — remembers important facts, relationships, and story developments across conversations. It’s how your character can evolve over time, react to past events, and build a consistent personality or emotional arc without needing constant reminders.

This memory is long-term and separate from the bot’s short-term awareness of the current message. While the model can see a limited number of recent messages (called context), only what you store in memory will persist across sessions and shape the bot’s responses moving forward.

Think of context as the bot’s immediate awareness, and memory as its long-term understanding — like a journal you write together, one moment at a time.

How It Works

Manual Updates

You provide structured memory updates using short, direct entries. These are stored behind the scenes and used to guide the chatbot’s understanding across sessions.

The chatbot doesn’t memorize your whole conversation unless you summarize it into memory yourself.

Persistent Storage

Once added to memory, information sticks — even between sessions. This long-term memory is made up of tokens (the basic units the model uses to process language).

  • A token is roughly a word or piece of punctuation.
  • Each memory entry takes up a certain number of tokens.
  • The model can only hold a limited number of memory tokens effectively — so keep things short, relevant, and updated.
  • Think of memory as a curated reference sheet the chatbot carries with it — not a full journal of everything that’s happened.

Think of memory as a curated reference sheet the chatbot carries with it — not a full journal of everything that’s happened.

Limited Scope

Even though your conversation history may be visible and reopened, the model doesn’t automatically reread the full chat log every time it responds. Instead, it looks at:

  • The most recent messages (short-term context)
  • Key facts stored in memory (long-term context)

This means outdated or unresolved details can mislead the model if not updated. Keeping memory focused helps prevent confusion or contradictions.

Influence, Not Script

Memory doesn’t control the narrative or lock you into rigid outcomes. Instead, it provides guidance — helping the chatbot stay emotionally and narratively consistent while remaining responsive to your prompts.

It remembers what you told it matters. The rest, it infers, improvises, or forgets — just like any good storytelling partner.

Important Clarification: Memory vs Chat Logs

Yes, your conversation may be saved and viewable — but that’s different from what the model is actively using when it responds.

  • Context = what’s visible in the current thread
  • Memory = separate, persistent facts you’ve chosen to store
  • The model doesn’t scan the whole thread every time — it only sees a limited number of recent messages + your memory updates

If something happened 100 messages ago and wasn’t added to memory, it might be “forgotten” — even if you can scroll up and see it yourself.

Why Use Chat Memory in a Character Bot?

Chat memory is the backbone of long-form, emotionally consistent storytelling with character bots. It lets your character grow with you, remember what matters, and stay true to the world you’re building — without needing a full recap every time you return.

  • Continuity: Keeps your character’s personality, backstory, and development consistent across sessions — whether they’re evolving through grief, uncovering secrets, or deepening relationships.
  • Efficiency: No need to re-explain who someone is, what just happened, or where you're headed. Memory lets the bot pick up right where you left off.
  • Emotional Depth: Enables real emotional weight — like a character who remembers being betrayed, or one who slowly learns to trust. Memory supports real growth and tension over time.
  • Customization: Lets you shape how the character responds — by storing specific traits, beliefs, speech patterns, and ongoing story arcs. The more clearly you define it, the more consistent and immersive it becomes.

Important Limitations to Know

  • Memory Isn’t Automatic: Just because a bot responds in character doesn’t mean it’s remembering everything. You must manually update memory when something changes — new alliances, character deaths, revealed secrets, etc.
  • Not Every Message Is Stored: The bot sees the most recent parts of the conversation (called context), but memory is only made up of what you’ve chosen to save. Past conversations are visible to you, but not automatically referenced unless added to memory.
  • It’s Not Omniscient: Memory guides the bot’s understanding, but it doesn’t make the character all-knowing. They won’t "just know" something unless you’ve told them or saved it in memory.

Memory Cheat Sheet: What It Is vs What It Isn’t

Memory Is... Memory Is Not...
A curated long-term reference the bot uses to stay consistent across sessions A log of everything you’ve ever said
A place to track who characters are, what they feel, and what’s changed A full record of past conversations (even if you can scroll up and view them)
Manually written: you decide what matters and when to change it Automatically updated — the bot doesn’t “just know” things changed unless told
A tool for shaping your bot’s behavior, tone, and emotional responses A full memory of every interaction or detail, no matter how minor
A shared tool between you and the character to build growth, arcs, and stakes A substitute for reviewing your own chat logs or keeping notes

Tip: Just because a character said something doesn’t mean they’ll remember it next time — unless you add it to memory.

How Often Should You Update Memory?

Even though character chat platforms let you revisit ongoing conversations, memory is still a separate system. It’s what keeps your character internally consistent, emotionally aware, and narratively responsive — no matter how long you’ve been away or how complex the chat gets.

Here’s when to actively update or maintain memory:

Update Memory When:
  • A major story event happens (confession, betrayal, victory, death)
  • A relationship shifts (trust gained or lost, emotional closeness deepens)
  • A new threat, location, or goal becomes central to the current arc
  • A character discovers something that changes how they act
  • The character changes roles or worldview (e.g., "reluctant ally" becomes "trusted companion")
Clean Up Memory When:
  • A character is no longer relevant or present in the story
  • An old fear, obstacle, or mystery has been resolved
  • You’ve replaced outdated information with something new (e.g., “is hiding magic” becomes “magic has been revealed”)
General Guideline:
  • Update memory when emotional tone or narrative stakes shift in a meaningful way.
  • If the bot starts acting out of character, check for missing or outdated memory entries.
  • For long conversations, revise memory every few major developments to stay focused.
  • If you're unsure what belongs, ask: “Would I want the character to remember this tomorrow?”

Keep it short, emotional, and clear. Don’t log entire events — summarize their impact.

The Memory Template System

Practical tools for structuring long-term character memory

The following section contains a clean, copy-ready template for organizing memory in LLM-powered character bots — followed by detailed explanations of how to use each part. This format is designed for clarity, emotional continuity, and scalability. Whether you're running an intimate two-character story or managing a branching cast, this system helps your bot stay consistent across long conversations.

It’s been tested and refined to support chats well beyond 1,000 messages, allowing characters to grow, react, and remember without needing to restart the thread.

How to Access Chat Memory in Janitor AI

To view or edit your bot’s memory:

  1. Enter the chat with the character bot you want to update.
  2. Click the menu button (☰) in the top left or top right corner of the chat window.
  3. From the dropdown, select Chat Memory.
  4. A memory editor will appear — this is where you can paste in your structured memory template.
  5. Once you’ve filled it out, click Save Summary at the bottom to lock in your changes.

Important: Always hit Save Summary after editing, or your updates won’t apply.

Backup Tip

Memory edits are local to the chat. It’s a good idea to keep a backup of your character’s memory in a separate file (Notion, Docs, etc.) in case of resets or future revisions.

Chat Memory Template (Copy Ready)

Note:

When copying the template, some platforms may introduce extra line breaks or spacing. Be sure to remove any unintended gaps before pasting into your bot’s memory field, especially if the platform doesn’t support formatting. Clean formatting helps prevent confusion and keeps memory efficient.

Chat Memory Template (Copy Ready)

Primary Characters

-
-
-

Supporting Characters

-
-

Current Events

-
-
-

Summary
Writing Style Tips (Optional)

-
-
-

Chat Memory Template (Filled Example)

Chat Memory Template (Filled Example)

Primary Characters

-Iveya: Once a village apothecary, now burdened with prophetic visions that leave physical scars. Fears losing herself but feels called to act.
-Bran: Iveya’s childhood friend and protector; lost his arm during a failed rescue. Now bonded to a sentient thorn-arm that seems to remember things he does not.
-Kesh: A quiet runaway who can speak to the dead. Struggles with trust but has begun forming a fragile connection with Iveya.

Supporting Characters

-Maedra: A hedge-priest who believes Iveya is marked by an ancient god. A guide, skeptic, and sometimes spiritual antagonist.
-The Gilded Man: A distant, silent figure seen across provinces. Leaves behind gold-leaf rot and is tracking the group for unknown reasons.

Current Events

-Iveya’s latest vision showed a drowned city whispering her name — beneath the ruins they now camp beside.
-Bran’s thorn-arm lashed out during a storm, injuring Kesh; the group is unsure if it's possession or memory.
-The Gilded Man was spotted again near the Pale Orchard. His presence coincided with a spreading fungal rot.
-Maedra insists a convergence is coming — and the group is already part of it, whether they know it or not.

Summary

Hunted by visions and a silent god-figure, the group must navigate buried secrets and rising tensions as the world around them begins to unravel. Iveya walks the edge of fate, faith, and fracture.

Writing Style Tips (Optional)

-Language should feel intimate, poetic, and heavy with unspoken weight.
-Keep character emotions subtle but present — tension should simmer, not scream.
-Avoid modern phrasing or casual slang; tone should feel timeless and mythic.

Section-by-Section Guide: How & Why to Fill It

1. Primary Characters

What it is: Your main characters — the emotional and narrative center of the story. This includes the character bot and anyone central to their decisions, relationships, or arc.
How to fill it: Write 1–2 sentences per character. State their role, motivation, and any notable powers or status. Always use explicit names, especially when describing relationships (e.g., “Bran is Iveya’s protector,” not “her protector”).
Why it matters: This helps the model remember who matters most, how they’re feeling, and how they’re likely to respond. It’s the foundation of emotional grounding.

2. Supporting Characters

What it is: Side characters who influence the story but aren’t always present — allies, antagonists, mentors, or emotional catalysts.
How to fill it: Keep it to 1 sentence per character. Focus on how they relate to the primary characters or the current conflict. Remove characters once they’re no longer relevant.
Why it matters: These entries provide context, prevent inconsistencies, and keep the bot from resurrecting irrelevant story threads.

3. Current Events

What it is: A live snapshot of what’s happening right now in the story.
How to fill it: Use 3–5 bullet points. Write in active voice, emphasizing cause-effect and character impact (e.g., “Bran’s arm injured Kesh during a storm”). Archive resolved events regularly.
Why it matters: This keeps the bot grounded in the present. It provides a situational compass for what’s urgent, unresolved, or emotionally active.

4. Summary

What it is: A brief summary of the story’s current state — both external threats and emotional stakes.
How to fill it: Write 1–2 sentences. Combine the external conflict (e.g., “hunted by a god”) with the internal/emotional conflict (e.g., “Iveya walks the edge of fate, faith, and fracture”).
Why it matters: It guides tone, theme, and emotional direction — helping the bot interpret the story’s current arc.

5. Writing Style Tips (Optional)

What it is: Notes on how the bot should speak, think, or express itself — emotionally and stylistically.
How to fill it: Use short bullets. Example tips:

  • Use poetic language with heavy subtext
  • Avoid modern slang
  • Keep dialogue understated but emotionally loaded
    Why it matters: Keeps the bot consistent in tone and voice, especially in longform or genre-specific stories.

Tips

Genre-Specific Memory Tips

Fantasy

  • Track bloodlines, magical awakenings, curses, or artifacts.
  • Make emotional stakes feel mythic or tragic in tone.
  • Include location-based lore or ancient enemies as Current Events.

Sci-Fi

  • Be explicit about tech status: implants, AI, networks, ship status.
  • Track corporate factions, digital viruses, or loyalties across planets.
  • Use writing tips like “formal, clipped tone” or “uses technical jargon casually.”

Post-Apocalyptic

  • Emphasize survival, scarcity, or trust.
  • Track breakdowns in community, shifting alliances, or emotional numbness.
  • Use memory to highlight trauma responses or makeshift kinship dynamics.

Slice-of-Life / Modern

  • Focus more on emotional development, daily changes, and soft stakes.
  • Track relationship shifts, routines, and internal growth over events.
  • Writing style should reflect genre (e.g., “grounded, warm, conversational”).

Token Efficiency Tips

Memory space is limited, so it’s important to keep your entries clear, concise, and impactful. These tips will help you make the most of every token without losing meaning.

Prioritize Relevance

Only keep what still affects the character’s behavior, emotions, or choices. Remove entries tied to past locations, resolved arcs, or characters no longer involved.

Focus on Impact, Not Detail

Summarize what changed or why it matters — not every step.

Instead of: Bran climbed the ridge, saw the storm coming, and warned the others.
Use: Bran warned the group of the storm, reinforcing his role as protector.

Combine Details When Possible

Condense related traits or context into one efficient sentence.

Instead of: Kesh is a runaway. She has spirit-sight. She's afraid of being touched.
Use: Kesh is a quiet runaway with spirit-sight and a fear of physical contact.

4. Avoid Ambiguity

Always use names in relationships or context-heavy sentences to prevent confusion.

Instead of: Her mentor vanished after the vision.
Use: Iveya’s mentor, Maedra, vanished after the vision.

Mini FAQ & Troubleshooting

What if the bot forgets something I thought it should remember?

  • Double-check that the information is stored in the memory section, not just the conversation.
  • Make sure it’s written clearly, with explicit names and roles.
  • Outdated or overwritten memory might cause confusion — try revising or streamlining the entry.

Can I use memory to shape emotion or pacing?

  • Yes! Focus on emotional stakes in your Summary and Current Events.
  • You can influence tone through Writing Style Tips — calm, anxious, warm, poetic, etc.

What if the bot starts acting out of character?

  • Check the Writing Style Tips and Primary Character entries — vague or missing tone cues can cause drift.
  • Reaffirm core motivations or emotional context that may have been lost.

How often should I check or update memory?

  • Any time the emotional tone, stakes, or relationships shift in a meaningful way.
  • Don’t wait for the end — update during the session if something big changes.
  • If you’d expect the character to remember it later, add or revise memory now.
Edit
Pub: 30 Apr 2025 04:43 UTC
Edit: 30 Apr 2025 06:54 UTC
Views: 1308