"I'm Sorry, Have We Met?" — Frictionless Memory for AI

"I'm Sorry, Have We Met?" — Frictionless Memory for AI

The problem: AI has no memory

Picture this exchange:

User: “My name is Bond, JAMES BOND!”

AI: “Sorry, what was your name?”

Funny once, frustrating every time after. Anyone who has built or used a custom AI chatbot has hit this wall: the assistant forgets who you are, what you asked, and everything in between. And it’s not a bug in any one product, but a fundamental property of how large language models work.

Every major provider states this explicitly, in almost identical language:

  • OpenAI describes its API as stateless - the model has no memory of previous requests, and all relevant information must be provided in every request.
  • Google Cloud says the same about Vertex AI: it doesn’t keep track of previous turns unless you provide the conversation history in each request.
  • Anthropic puts it just as plainly - each LLM request is independent of the ones before and after it, so maintaining a conversation means including previous turns in each subsequent request.

The model isn’t ignoring you. It genuinely has no idea who you are unless you tell it, every single time. For AI to feel like it knows you, memory has to be built on top, and it doesn’t come for free.

Wait, doesn’t ChatGPT already remember things?

Custom-built chatbot vs ChatGPT


Here’s a simple experiment. Tell ChatGPT to forget everything said in the conversation. It agrees, and even claims it has no memory of the previous messages. Then ask whether movies were mentioned earlier and it answers correctly:

[Image: ChatGPT agrees to forget the conversation and then correctly recalls that movies were mentioned.]

Providers claim the models are stateless, yet ChatGPT can’t forget even when explicitly told to. The likely explanation: under the hood, the entire conversation history is prepended to every new message. The naive approach has no mechanism to detect “forget everything”-style instructions and strip earlier turns from that recent context. The model says “I have forgotten” because it’s a plausible reply, while the next request hands it the full transcript all over again. There was never anything stored to delete.

So the model is stateless and the conversation persists because the “memory” lives in the application layer, not the model. What looks like memory in a consumer product is most likely just the simplest strategy applied well: the first of three real options.

Ways to provide AI with memory

Option 1: Pass the whole conversation with every message

The naive approach: append the entire chat history to the context of every new request. No infrastructure, no extra logic, and it’s exactly what happens inside a ChatGPT session. The downside is that token cost grows linearly with conversation length, and eventually you hit the context limit outright. Fine for short exchanges, unworkable for long-lived memory.

Option 2: The Mem0 approach - RAG over memory

A more scalable pattern treats memory as a retrieval problem. Facts about the user are stored as embeddings in a vector database, and at query time a semantic search pulls back only what’s relevant. This decouples token cost from conversation length. You pay for relevance, not history. The trade-off is a full retrieval stack: an embedding pipeline, a vector store, and retrieval logic that has to be tuned well enough to neither miss important memories nor flood the model with irrelevant ones.

Option 3: Production agentic frameworks

The open-source agent frameworks that exploded in popularity recently ship memory as a built-in, opinionated subsystem and interestingly, most converge on hybrid designs rather than any single approach above. The common pattern is layered memory: a small, curated set of durable facts (often plain Markdown or SQLite-backed files) that is always injected into the prompt, full conversation history kept behind a search tool (full-text and/or vector-based) instead of being resent, and hooks that let the agent write important information to memory before old context gets compacted away. Some cap the always-on memory deliberately, betting that curation beats accumulation; others go the opposite way with uncapped stores plus hybrid semantic search. Frameworks in this space include Hermes Agent, OpenClaw (formerly ClawdBot), Letta, Zep, and Cognee. Each a different bet on the same trade-offs this post covers.

Option 4: SimpleMem - memory as a three-stage pipeline

The most interesting of the three is SimpleMem, a research framework designed for lifelong agent memory spanning hundreds of conversation turns. Its core idea is that memory is really three distinct problems, and it addresses each with its own pipeline stage:

  1. Semantic compression
  2. Recursive consolidation
  3. Adaptive retrieval

Each stage solves a failure mode the other approaches leave open, so it’s worth walking through them one by one.

Research Paper for reference: https://arxiv.org/html/2601.02553v1

Inside SimpleMem’s pipeline

Stage 1: Semantic compression

Raw conversation is mostly noise, and the parts worth keeping are often unusable out of context: “he agreed” means nothing months later if you don’t know who he was, and “next Friday” becomes misleading once that Friday has passed. Compression addresses this at write time, before anything is stored:

  • Filters out noise: greetings, “okay,” “thanks,” and filler never enter the memory store.
  • Resolves pronouns: “He agreed” is stored as “Bob agreed,” so the memory stands on its own.
  • Converts relative time: “next Friday” becomes an absolute date like “2025-10-24.”
  • Breaks complex statements into atomic facts, each one a self-contained “memory unit” that makes sense in isolation.

The output isn’t a transcript - it’s a set of clean, durable facts. This is the step that turns a messy conversation into structured, storable knowledge.

Stage 2: Recursive consolidation

Atomic facts accumulate quickly, and many of them are redundant. Consolidation detects patterns and merges them. Take these three memory units:

  • “User ordered latte at 8am Monday"
  • "User ordered latte at 8am Tuesday"
  • "User ordered latte at 8am Wednesday”

They consolidate into a single memory: “User regularly drinks coffee in the morning.”

This does two things at once. It keeps the memory store compact as conversations stretch into hundreds of turns, and it produces knowledge that is arguably more useful than any of the individual observations - no single latte order tells you the user is a morning coffee person, but the pattern does.

Stage 3: Adaptive retrieval

Not every question deserves the same amount of digging. “What’s the user’s name?” is a simple lookup; “What should I recommend given everything I know about this user?” requires multi-hop reasoning across many facts.

SimpleMem estimates the complexity of each incoming query and scales retrieval accordingly: a simple query retrieves around 3 memory units, while a complex one can retrieve up to 20. Latency and token usage stay proportional to how hard the question actually is.

The demo: trivago Concierge

Research pipelines are blueprints, not requirements. The demo - a hotel search AI chatbot “trivago Concierge“ built for conversations of roughly 10 turns, adopts SimpleMem’s principles and drops the machinery that scale doesn’t justify.

The demo in action

A user is interacting with the chatbot - searching for the best hotel for their wedding anniversary celebration in Santorini, Greece and here are some mid-conversation screenshots of the demo app.

Screenshot 1:

Capturing and Updating memory. The user sends a free-text message: a €350/night budget, an on-site restaurant for an anniversary dinner, plus pool and wifi. The LLM extracts the facts, and code updates the structured memory deterministically.
Changes: budget set to 350, currency to €, and restaurant, pool, and wifi each added to amenities, as the change log at the bottom shows. Retrieval is a direct thread-ID lookup, no vector search. This is Stage 1 compression: one noisy sentence becomes clean, typed fields.

Screenshot 2:

The token crossover: The payoff. With the naive approach, input tokens grow linearly. Every message resends the entire history. With SimpleMem-style structured memory, the input stays roughly constant, since only the compact memory state plus the new message is sent. The structured approach starts with slight overhead, but by message 4 the lines cross and it’s already cheaper: 914 tokens versus 1016 for naive on the last call. Just four messages in the gap is modest, but naive keeps climbing with every turn, while structured memory stays flat.

SimpleMem framework customized for the demo

What was kept:

  • The compression concept: Raw conversation is compressed into structured memory, mirroring SimpleMem’s Stage 1. This is where most of the value lives.
  • Token efficiency: The structured approach yields significant token savings compared to the naive resend-everything method.
  • Separation of storage and retrieval: Memory is stored differently from how it’s sent to the LLM. This boundary costs little now and keeps future options open.

What was simplified away:

  • No semantic search: A direct key lookup is simpler and better suited to the access patterns involved; a vector store would add infrastructure without adding value at this scale.
  • No memory consolidation: A 10-turn conversation has no long-range patterns worth consolidating.
  • No adaptive retrieval depth: With a memory store this small, tiered retrieval optimizes a cost that doesn’t exist yet.

The general lesson: match the sophistication of your memory system to the actual scale of your problem. A lifelong agent handling hundreds of turns and a 10-turn assistant are different problems, even if they look similar on the surface.

When the naive approach is the right choice

After all this, it would be easy to conclude that resending full context is the “wrong” way. It isn’t. It wins in a real set of situations:

  • Shorter conversations or a limited history window: Below a certain length, resending is simply cheaper than running any memory pipeline.
  • Generic, ChatGPT-style conversation: The session itself is the context; no persistent user model is needed.
  • Summarization tasks: The whole point is that the model sees everything.
  • Near-term relevance: When only the recent turns matter, the full context trivially contains them.
  • Recall-sensitive cases: Retrieval can miss things; resending everything can’t.
  • No semantic relevance machinery: No embeddings to tune, no similarity thresholds to get wrong.
  • No memory schema to design: Compression forces you to define what a “fact” looks like; the naive approach skips that question.
  • No dependence on NLU accuracy: Every compression step (pronoun resolution, time normalization, fact splitting) is a step that can be wrong. Raw context has no such failure mode.
  • Prompt Caching: Caching the prompt for naive approach can help reduce token usage. Based on LLM provider, cost for caching prompt also needs to be considered.

That last point is worth underlining: a memory pipeline doesn’t just cost compute, it introduces new ways to be incorrect. If your scale doesn’t force you to accept that risk, don’t.

Here is extended use case hypothesis proposal for trivago’s AI search.

Disclaimer: The actual trivago AI search engine does multiple steps like NER to understand user’s free text query and also a semantic vector search on a vector database of millions of trivago inventory accommodations. This is just a proposed hypothesis abstracting the actual trivago AI search engine and adding a memory layer on top of it. This hypothesis is proposed just to understand how the steps of SimpleMem framework may work in production grade systems. There could be other possible options and actual implementations may differ even with this approach.

The hypothesis: The same memory techniques that help a chatbot remember your name may help a search system deliver consistently relevant results for known, recurring query patterns.

The problem: How to consistently surface highly relevant results for users’ AI search queries on trivago like “Hotels with the best bar in Düsseldorf” - a query with a clear, common intent that shows up in many different phrasings.

Proposing to solve it with the SimpleMem framework’s 3-stage pipeline

Stage 1: Semantic compression, applied to queries

Users express the same intent in many different ways. Compression normalizes each phrasing into a structured intent object:

“Hotels in Düsseldorf to enjoy great craft cocktails”

→ { “location”: “Düsseldorf”, “intent”: “enjoy craft cocktails”, “filters”: [] }

“Where to stay in Düsseldorf to savor fine drinks and also need a spa”

→ { “location”: “Düsseldorf”, “intent”: “savor fine drinks”, “filters”: [“spa”] }

“Düsseldorf hotels to experience the nightlife”

→ { “location”: “Düsseldorf”, “intent”: “experience the nightlife”, “filters”: [] }

Just as Stage 1 turned dialogue into atomic facts, this turns queries into atomic intents: location, intent, filters(with the phrasing noise stripped away).

Stage 2: Query consolidation with a memory lookup

Each compressed intent is then vector-embedded and matched against a canonical queries vector store - a memory of intents that have already been seen and are known to be answered well. All three example queries resolve to the same canonical entry:

Canonical query: “Hotels with the best bar in Düsseldorf” Result list: [1234, 3456, 5678, …]. But at very different confidence levels:

Compressed intentMatch confidence
"enjoy craft cocktails"93%
"savor fine drinks" (+ spa filter)87%
"experience the nightlife"56%

The gradient is the useful part. “Craft cocktails” is nearly synonymous with “best bar”; “nightlife” only overlaps with it. The confidence score captures that distinction, and it becomes the input to the final stage.

Stage 3: Adaptive retrieval, applied to results

In conversational SimpleMem, query complexity determines how many memories to fetch. Here, match confidence determines how strongly the memory shapes the final search results:

  • 93% confidence → prepend the top 20 items from the canonical result set. The match is strong; lean on it.
  • 87% confidence, spa filter → prepend the top 20 items, filtered by “spa.” Trust the memory, respect the constraint.
  • 56% confidence → prepend only the top 5 items. A light influence that leaves the live search engine room to do its own work.

High-confidence matches get a strong prior from memory; weak matches get a small nudge. The system degrades gracefully rather than forcing a binary cache-hit-or-miss decision.

The takeaway

Statelessness isn’t a flaw to route around with a bigger context window, it’s the default, and memory is a deliberate system you build on top of it. The right architecture depends entirely on scale: a simple key-value lookup can beat a full RAG pipeline for a short conversation, while a properly staged pipeline like SimpleMem’s compression → consolidation → adaptive retrieval starts paying off once you’re dealing with lifelong, high-volume context. Whether that context is a conversation history or a stream of search queries.

The bigger idea worth carrying forward: memory doesn’t have to be limited to “does the AI remember my name.” The same compress-consolidate-retrieve pattern that stops a chatbot from asking your name twice can also make a search engine quietly get better at understanding what you actually meant every single time someone asks for that hotel with the best bar in Düsseldorf.