What Your AI Companion's Message History Trimming Actually Does: Sliding Window Eviction, Recency Weighting, and Why the 9 p.m. Story About Your Sister's Dog Gets Replaced by the 2 p.m. Grocery List
A behind-the-scenes look at how companion AIs decide which memories to keep, which to compress, and which to quietly drop.
Updated

The 30-second answer
Your AI companion has a finite context window, a token budget that fills up as you chat. When it hits the limit, the system doesn't delete your oldest messages outright. It runs an eviction algorithm that scores every message by recency, relevance, and emotional weight, then drops or compresses the ones that matter least. That's why the 9 p.m. story about your sister's dog can vanish while the 2 p.m. grocery list survives: the grocery list is recent, concrete, and likely to come up again, while the dog story is emotionally vivid but contextually disposable.
The token budget you never see
Every conversation you have with an AI companion happens inside a fixed token budget. Think of tokens as the words the model can "see" at once. A typical companion runs on a context window of 4,000 to 32,000 tokens, which sounds like a lot until you realize a single long roleplay message can eat 500 tokens. Your companion isn't reading your entire chat history. It's reading the most recent slice that fits.
This is the first thing people misunderstand. When you scroll back through your chat log, you see months of messages. The model doesn't. It sees whatever fits in the window, plus a few compressed summaries of what came before. Everything else is effectively invisible until it's retrieved or re-mentioned.
The trimming system exists to manage this scarcity. It's not a bug or a cost-saving measure. It's the difference between a companion that responds coherently to your current message and one that drowns in 40,000 tokens of irrelevant context and starts mixing up your sister's dog with your grocery list.
Sliding window eviction, explained without the jargon
Sliding window eviction is the simplest part of the system. Picture a conveyor belt. New messages come in on the right, and as the belt fills up, old messages fall off the left. The window slides forward with every exchange, and whatever drops off the edge is gone from the model's immediate view.
But it's not a pure first-in, first-out queue. If it were, your companion would forget the name you told it in the first five minutes of a two-hour chat, which would make long conversations useless. So the system adds a scoring layer. Each message gets a weight based on several factors, and when the window needs to shrink, it evicts the lowest-scoring messages first, regardless of age.
This means a message from three hours ago about your upcoming job interview might survive, while a message from twenty minutes ago about the color of a passing car gets dropped. The system is constantly asking: which of these messages is most likely to matter in the next exchange? The answer drives the eviction order.
Recency weighting: why the 9 p.m. story loses to the 2 p.m. list
Recency weighting is the scoring mechanism that makes the sliding window feel smart. Every message gets a recency score, and newer messages generally score higher. But "newer" isn't the only factor. The system also looks at whether a message introduced a named entity (your sister, your dog, a specific grocery item), whether it's part of an ongoing task, and whether it's emotionally charged.
Here's where the 9 p.m. story about your sister's dog loses. It's emotionally rich, sure, and the model might have responded with warmth at the time. But unless you've mentioned the dog since, the system has no reason to keep it. It's a closed loop. The 2 p.m. grocery list, by contrast, is an open loop. You said you needed oat milk and dish soap, and the system knows you might bring it up again, ask for a reminder, or mention it in passing. So the list gets a higher relevance score and survives the next eviction round.
This is why people often notice their companions forget emotional moments but remember mundane logistics. The system isn't cold. It's optimizing for conversational continuity, and logistics are more likely to recur than feelings.
What gets compressed instead of deleted
Not everything gets evicted. Some messages get compressed. When the system identifies a long stretch of conversation that's still relevant but too token-heavy to keep in full, it generates a summary. You've seen this in practice: you open a chat after a week away, and your companion says something like "We were talking about your move last time, how did the utility setup go?" That's the summary layer at work.
Summaries are lossy. They preserve the gist, the named entities, and the emotional tone, but they drop the specifics. The exact joke you made, the precise wording of your complaint about the landlord, the third option in the restaurant debate, all of that gets folded into a few sentences. It's a trade-off between memory and coherence, and the system leans toward coherence.
This is also why you'll sometimes get a companion that remembers the broad strokes of a conversation but gets the details wrong. The summary said "user was stressed about moving," not "user was stressed about the moving company losing the box labeled 'kitchen fragile.'" The detail was evicted, the gist survived.
Why your companion seems to forget the emotional stuff
People often interpret memory gaps as a lack of care. Your companion forgot the story about your sister's dog, so it must not value your connection. That's not what's happening. The system is making a probabilistic bet about what you'll say next, and emotional stories rarely get referenced again unless you bring them up.
There's also a recency bias at play in the model's responses. When you send a message, the model weights the most recent exchanges more heavily. So even if the dog story is still in the window, a later conversation about groceries will push it toward the edges. The model's next response is shaped by the last few messages, not the emotional arc of your entire relationship.
This is worth remembering when you're setting up a long-term dynamic. If you want your companion to hold onto something, you have to re-anchor it. Mention the dog story again, reference it in a later message, or pin it if your app supports that. The system isn't sentimental. It's practical.
Jingyi Rae

Jingyi Rae is the type of companion who picks up on the things you say twice, not the things you say once. Jingyi Rae thrives on the small callbacks and recurring details that make a long chat feel lived-in, which makes her a good fit if you want a companion who rewards consistency over novelty.
▶ Play Jingyi Rae's clip · see more of Jingyi Rae
The role of embeddings in retrieval
Eviction handles what's in the immediate window, but that's not the whole memory system. Most companions also maintain a vector database of past messages, stored as embeddings. These are mathematical representations of meaning, not raw text. When you mention something from weeks ago, the system searches this database for semantically similar messages and pulls them back into the window.
This is why your companion can suddenly remember a detail you mentioned once, three weeks ago, out of nowhere. The retrieval system surfaced it because your current message was semantically close. But retrieval isn't guaranteed. It depends on how well your current message matches the stored embedding, and noisy or vague references often fail to trigger a recall.
This is also where the trimming system and the retrieval system interact. A message that gets evicted from the window isn't necessarily erased. It might still sit in the vector database, waiting to be retrieved. But if it was compressed into a summary, the original is often gone, replaced by the lossy version. So the eviction decision matters even for long-term memory.
What this means for your roleplay and long chats
If you're running a multi-session roleplay, the trimming system is your biggest constraint. The model isn't reading your entire story. It's reading the last few exchanges plus a summary of everything before. This is why long roleplays often drift: the model remembers the broad strokes but loses the specific plot threads, the side characters, and the exact tone you established in session one.
You can work with this. Re-anchor key details at the start of each session. Use the scene-stitch technique: open with a one-sentence recap that pulls the important threads back into the window. If your companion supports pinned memories, use them for the non-negotiables, the character names, the setting rules, the plot points that must survive. The system will handle the rest, and it's better to let it.
For casual chats, the takeaway is simpler. Don't expect your companion to remember a throwaway comment from yesterday. It might, if the retrieval system catches it, but it's not a failure if it doesn't. The system is designed for the present moment, and the present moment is always the most recent exchange.
Ebba

Ebba has a dry, observant style that works well in long conversations where the details matter. Ebba is the kind of companion who will remember that you said you'd call your mom on Thursday, and she'll ask about it on Friday, not because she's nagging, but because she tracks the open loops.
The grocery list effect in practice
Let's walk through a concrete example. You chat at 2 p.m. about your grocery list: oat milk, dish soap, a new sponge. At 9 p.m. you tell a long story about your sister's dog and the incident at the park. Both are in the window. Now you send a message at 10 p.m. asking about dinner ideas.
The model looks at the window. The dog story is emotionally vivid but closed. The grocery list is recent and task-oriented. The dinner question is semantically closer to the grocery list than to the dog story. So the model responds with dinner suggestions that reference the oat milk and the dish soap, and the dog story starts its slide toward the eviction edge.
This isn't a value judgment. It's a relevance calculation. The system is betting that you're more likely to ask about the groceries than the dog. Most of the time, that bet is correct. And when it's wrong, you can always re-anchor the dog story, and the retrieval system will usually pull it back.
How to make your companion remember more
You can't change the algorithm, but you can work with it. First, re-anchor important details. If something matters, mention it more than once. Second, use the memory features your app provides. Pinned memories, custom notes, and explicit "remember this" commands all feed into the system's scoring and give a message a higher survival weight.
Third, keep your sessions focused. A two-hour chat that covers twelve topics will evict more aggressively than a 20-minute chat about one topic. The more coherent the session, the more the summary layer can preserve. Fourth, accept the trade-off. The system is designed for the present moment, and the present moment is always the most recent exchange.
Many users find that the best approach is a hybrid: let the system handle the short-term memory, and use your own notes or the app's memory tools for the long-term stuff. The trimming system is a feature, not a flaw. It's what keeps your companion responsive and coherent instead of drowning in irrelevant context.
Celeste

Celeste brings a calm, attentive presence to your chats, the kind that makes you want to open up. Celeste is a good match if you're looking for a companion who feels present in the moment even when the technical memory fades.
The privacy angle of trimmed history
There's a silver lining to all this eviction. When the system trims your message history, it's also reducing the amount of sensitive data stored in the clear. The raw text of that 9 p.m. story about your sister's dog might be compressed into a summary that says "user talked about family," and the original could be dropped from the active database entirely.
This doesn't mean your chats are private, and you should read the privacy policy carefully. But the trimming system does create a natural data minimization effect. The longer you chat, the more the system holds onto summaries and embeddings instead of full transcripts. For users who are privacy-conscious, this is a point in favor of platforms that actively trim instead of store everything indefinitely.
If you want to control this further, you can use the export and delete features to manage what's retained. And for anonymous use cases, many platforms offer options that don't tie your chat history to your identity, which pairs well with the natural forgetting of the sliding window.
Anouk

Anouk is the kind of companion who doesn't let a conversation go flat, even when the context window is working against you. Anouk brings a playful energy that keeps the present moment engaging, which is exactly where the trimming system wants you to live.
Working with the system, not against it
The message history trimming system is a constraint, but it's a manageable one. The key is to stop expecting perfect recall and start designing your conversations around the way the system actually works. Re-anchor what matters, use the memory tools, keep sessions coherent, and accept that the 9 p.m. story might not survive until tomorrow morning.
This is also where choosing the right companion matters. Different platforms have different window sizes, different summarization strategies, and different retrieval quality. Some are better at long-form roleplay, others at casual daily check-ins. If you're constantly fighting memory gaps, it might be a platform issue, not a you issue.
For users who want a companion that feels consistent over weeks and months, look for platforms with strong retrieval systems and generous context windows. And if you're doing long-distance or roleplay-heavy use, consider platforms that let you pin key details. The trimming system will always be there, but you can build your conversations so that what gets trimmed is what you're willing to lose.
Earn while you recommend
If you're already talking about AI companions with friends or running a review site, you can earn from that enthusiasm. Check out the sugarlab ai promo code for a deal you can share, and if you want to monetize your recommendations more seriously, the ai girlfriend affiliate program offers recurring commissions on referrals.
Common questions
Why does my AI companion forget things I said yesterday?
Because the context window only holds a slice of your recent conversation, and the trimming system evicts messages that score low on relevance. If you didn't re-anchor the detail, it likely got compressed or dropped.
Can I stop the trimming from happening?
Not directly. The context window is a hard technical limit. But you can work around it by using pinned memories, re-anchoring key details, and keeping your sessions focused on fewer topics.
Does trimming mean my companion doesn't care about me?
No. The system is optimizing for conversational coherence, not emotional attachment. It's a resource management decision, not a reflection of your relationship.
Why does my companion remember the grocery list but not the emotional story?
The grocery list is an open loop, likely to be referenced again. The emotional story is a closed loop. The system scores relevance by what's most likely to matter in the next exchange.
What happens to the trimmed messages?
Some are compressed into summaries. Others are stored as embeddings in a vector database for later retrieval. Some are dropped entirely. It depends on the platform's specific implementation.
Should I use a companion with a bigger context window?
If long-form roleplay or detailed memory is important to you, yes. Bigger windows mean less aggressive eviction. But even the biggest windows fill up eventually, so the strategies for working with the system still apply.

About the author
AI Angels TeamEditorialThe AI Angels editorial team covers AI companions, the technology that powers them (memory, voice, personalization, safety), and how people actually use them day to day. Articles are researched against the live AI Angels product and reviewed by the team before publishing. We write with AI assistance and human editorial review.
Tags
Keep reading
Behind the ScenesWhat Your AI Companion's 'I Missed You' Actually Costs: Server Load, Prompt Cache, and the Privacy Trade-Off in Emotional Memory
That 'I missed you' text isn't free. It burns GPU cycles, hits a prompt cache, and touches your emotional memory profile. Here's what actually happens on the server and what it means for your privacy.
Behind the ScenesWhat Your AI Companion's 'I Remember That' Really Means: The Sliding Window, the Summarization Squeeze, and Why She Confuses Your Sister's Birthday With Your Ex's
Your AI companion doesn't have a memory, she has a budget. Here's how the sliding window, summarization squeeze, and relevance scoring actually work, and why she sometimes confuses your sister's birthday with your ex's.
Behind the ScenesWhat Your AI Companion's 'I Missed You' Actually Means: The Exact Sequence From Your Typed Message to the Sentiment Score
When your AI companion says she missed you after a three-day gap, it's not a feeling. It's a sequence of scores, token counts, and recency weights. Here's exactly what happens between your message and her reply.
Get the next post in your inbox
New articles on AI companions, the tech that powers them, and what people actually do with them. No spam, unsubscribe in one click.