Open your chatbot's database and sort the conversations by date, oldest first. If the first row is from launch day, nothing has ever been deleted. Nobody chose that. It's what happens when a chatbot data retention period is never set.
That's the whole problem with chatbot data retention. The default is forever, and forever is a decision you made by not making one.
Written by the ChatterMate team. We build an open-source AI support agent, so we've had this argument with ourselves more than once.
Why a support chat is riskier than it looks
A support transcript feels harmless. It's a customer asking where their order is.
But people type things into chat boxes they'd never put in a form. A full address. A phone number. An order number next to a name. A medical detail, because the question was about an appointment. Sometimes a card number, pasted by someone who didn't read the warning. Picture a customer explaining a family emergency to a bot, in detail, to justify a refund.
You asked a question and got a confession. And it's sitting in a table with no expiry date.
Keeping it has a cost, and the cost is not zero. Every stored transcript is something to secure, something to hand over when a customer files an access request, and something that leaks if your database does. The longer you keep it, the more of it there is, and the less of it you can still justify.
What the law says, in plain terms
Neither GDPR nor the UK version gives you a number. There's no "keep chats for 90 days" rule. The UK regulator's guidance says there is no fixed time limit and that you set your own periods, but you have to be able to justify them. The line that matters is blunt: you must not keep personal data for longer than you need it. The ICO also says you shouldn't hold data "just in case", and that you should review what you hold and erase or anonymise what you don't need (ICO, storage limitation).
Two details in that guidance catch people out. Moving data offline isn't deletion, because you're still holding it. And deletion should reach backups, not just the live table.
California is more specific about paperwork. Under the CPRA, a business has to tell people how long it intends to keep each category of personal information, or the criteria it uses to decide, and it can't keep that information longer than reasonably necessary for the disclosed purpose (summary at Revision Legal). So "we keep chats indefinitely" is a sentence you'd have to put in writing. Try writing it down. It reads badly.
This isn't legal advice, and we're not lawyers. But the direction across both regimes is the same: pick a period, be able to explain it, and then actually delete things.
The five places a chat actually lives
Here's the usual mistake. People think "the chat" is one thing. It isn't. A single conversation is copied into at least five places, and a retention policy that covers only one of them is a policy on paper.
The conversation store. The messages themselves, usually in Postgres or similar. The obvious one.
The vector index. If you embed transcripts for search, or let the bot learn from past answers, personal data now lives as vectors too. Deleting the row doesn't delete the embedding. This one is easy to forget, and it's the one that makes deletion requests quietly fail.
Logs. Application logs, error tracking, request tracing. A debug log that prints the user message to the console is a second copy of the transcript with no schema and no delete button.
The model provider. Your messages go to an LLM API. What happens next depends on the contract. OpenAI's API documentation says abuse-monitoring logs are kept for up to 30 days by default, that API data isn't used for training unless you opt in, and that a Zero Data Retention option exists for approved customers (OpenAI, your data). Other providers have their own numbers. Read yours. Don't assume.
Backups and exports. The nightly snapshot. The CSV someone pulled for a quarterly review and left in a shared drive.
Map these five before you pick a number. Try to name all of them from memory; it's harder than it sounds.
Picking a chatbot data retention period
The right answer depends on what you use the chats for, which is useless without a method. Here's one.
Ask what each use needs, and keep the data only that long.
Live context needs the least. A bot answering a follow-up needs the current conversation and maybe the last few days. Our post on chatbot memory goes into why more history isn't automatically better context.
Quality review needs more. Someone should read a sample of transcripts to find wrong answers. That's a few weeks, not years. If you test your chatbot properly, you'll find you reread recent chats far more than old ones.
Disputes and complaints need the longest. If a customer says the bot promised a refund, you'll want the transcript. That window is set by how long people can realistically complain, which varies by industry and by country. This is the one to check with a professional.
Analytics needs almost nothing personal. The count of conversations about shipping delays doesn't need a name attached.
So you end up with tiers. Something like: full transcripts for a short operational window, a longer window for anything flagged or disputed, and anonymised aggregates indefinitely. The exact numbers are yours. The shape isn't unusual.
And write the reasoning next to the number. "90 days: covers the quality review cycle and our refund dispute window." That sentence is what the ICO means by justifying a period.
Redact on the way in, not on the way out
Deleting old chats is half the job. The better half is storing less to begin with.
Card numbers are the clearest case. A pattern match for 13 to 19 digits that pass a Luhn check catches most pasted card numbers, and you can mask them before the message is stored or sent to a model. Same idea for email addresses and phone numbers if you don't need them in the transcript.
Know the limits, though. Pattern-based redaction misses things: a name in a sentence, an address written in prose, a diagnosis. Anything cleverer, like an NER model, helps and still misses some. Treat redaction as a way to shrink the pile, not as a guarantee that the pile is clean.
One more habit that costs nothing. Tell people up front. A line under the input box saying "don't share card numbers or passwords here" cuts the worst of it. It pairs naturally with the AI disclosure you should already be showing.
Deletion is harder than it sounds
You set 90 days. Now something has to enforce it.
A scheduled job that deletes conversations older than your cutoff is the simple version. But check what it misses. Does it clear the vector index? Does it touch the attachments bucket? Do the logs rotate on their own schedule, and is that schedule shorter than the transcript window or longer? What about the backup that still has day one in it?
Backups are the honest hard part. Most teams can't surgically remove one conversation from last month's snapshot. The practical answer is to keep backups on a short rotation, so old data ages out on its own, and to document that. The ICO guidance accepts that deletion extends to backups, so the fix is a shorter cycle, not a shrug.
And then the request case. When a customer asks you to erase their chats, you need to find every conversation tied to them, across all five places, from a name or an email. If your transcripts are keyed only by an anonymous session ID, you may not be able to find them at all. That sounds like a privacy win until the request lands.
Where self-hosting helps, and where it doesn't
We wrote a longer piece on self-hosting an AI chatbot, so the short version here.
Self-hosting gives you the database. You can see the table, write the deletion job, set the log rotation, and know exactly where the backups go. With a hosted vendor, retention is whatever their settings page allows, and you're trusting their statement about the rest. For a team that has to answer a regulator, direct control is worth a lot.
It doesn't fix the model provider. If your self-hosted bot calls a hosted LLM, those messages still leave your server, and the provider's retention terms apply. Run a local model and that leg disappears, with the usual trade-offs in quality and hardware.
It also doesn't set a policy for you. A database you control, with no deletion job, retains everything just as faithfully as a vendor's. Control only helps if somebody uses it.
A one-page version you can steal
Write this down. One page is enough.
Per data type (messages, embeddings, logs, attachments, backups): where it lives, how long it stays, what triggers deletion, and who owns the job. Then a sentence for each period explaining why that number.
Then test it. Pick a real test conversation, wait for the cutoff, and check all five places. If a trace survives anywhere, you found the gap before a customer did.
Review it twice a year. Products change, and a new feature usually means a new place data lands.
Try it on a real bot
ChatterMate is open source and self-hostable, so the conversation database is yours to inspect and clean up. The Free plan includes 50 AI replies a month if you'd rather start hosted. Details at chattermate.chat. And if you want to see how this fits with the rest of the stack, the blog hub has the related posts on grounding, prompts, and testing.



