Userscript to save your CharacterAI chats.
The CharacterAI website has finally been updated to fix the wasteful serialization of conversation histories. Unfortunately, that change has broken this userscript.
Due to time constraints I am no longer maintaining this repository, and instead recommend that you look for other tools to export your CAI conversations. One such tool I've been suggested is a browser extension called "CAI Tools". I have not tested it myself and as such cannot vouch for it - but if you need a replacement for this userscript, I suggest searching for it and giving it a shot.
This userscript allows you to download your saved messages with any bot you've ever talked to, given you can reach their chat history page. If you're a bot creator, it also allows you to separately download your bot's definitions.
Install a userscript manager.
Install the userscript from here.
Now, while you're talking to a character, click on "View Saved Chats" to go to their histories page:
After a few seconds, a Download link should pop up next to the "Your past conversations with so-and-so" header:
Clicking on the link will download a .json file containing the bot's basic info (name, description, greeting) and all the interactions you've ever had with it.
If you're a bot creator, you can also head over into the Character Editor to download a bot's definitions:
If you've never used the "Save and Start New Chat" feature, you won't have the "View Saved Chats" option shown in the first screenshot.
That's fine, it just means you'll need to manually access the histories page by replacing the /chat path with /histories in the URL. For example, if you're at:
https://beta.character.ai/chat?char={{BOT_ID_HERE}}
Just rewrite the URL so it reads:
https://beta.character.ai/histories?char={{BOT_ID_HERE}}
And you'll reach the page that should show the Download link.
The script attempts to anonymize the dumped data (it scrubs known sensitive fields and attempts to replace any instances of your name within messages), but if you're paranoid, you should open the downloaded JSON and search for your username/email/display name just to make sure.
Download link wouldn't show up for a given bot if you had a conversation with it where all of the messages were deleted.Download link was not showing up on some bots that had trailing whitespace in their names (e.g. 2B ).If the Download link doesn't show up after a few seconds and you're on the proper page, check the DevTools console for errors.
Usually, failures are caused by some browser extension or configuration that stops the userscript from loading its external dependencies properly. However, there are two other known failure modes that seem to be somewhat common:
No open issues yet, or sync has not completed.