This script is designed to convert your chat history from OpenAI's ChatGPT into a format that can be easily imported into Roam Research. It's perfect for those who want to keep a copy of their ChatGPT conversations in their personal knowledge management system.
-
Export your ChatGPT history following the instructions provided in this OpenAI Help Article. You'll receive a JSON file that contains your conversations with ChatGPT.
-
Save your JSON file in the same directory as this script.
-
Edit the script to set the
user_name
variable to your name. This will be used to identify your responses in the conversation. -
Run the script using a Python interpreter. Ensure that you have the necessary permissions to read and write files in the directory where the script is located.
python chatGPTtoRoam.py
- If the script runs successfully, it will generate a new file named
roamimport.json
. This file contains your ChatGPT conversations formatted for Roam Research import.
- Import the
roamimport.json
file into Roam Research. Please follow the official Roam Research documentation on how to import files into your database.
- After importing, you will see each of your conversations as a separate page, with the questions and responses formatted as nested bullet points.
The first link in the Roam Research page will take you back to the original conversation on the ChatGPT platform. You can use this link to continue the conversation in ChatGPT.
- chats with the same name append to the same page - not sure I'll fix that. I should be making the names of my chats useful anyway.
Before using this script, I strongly recommend the following precautions to protect your data:
-
Backup your data: Always have a recent backup of your data. This ensures that you can restore your information if something goes wrong.
-
Test in a safe environment: Before applying any conversion or import script on your main database or graph, test the process with a small subset of your data or in an empty Roam graph. This will allow you to verify the results without affecting your main data.
-
Disclaimer: This script is provided as is, and you use it at your own risk. I'm not responsible for any data loss or damage that may be caused by the use of this script. Please understand the script and the changes it will make before running it.