ChatGPT stands as one of the world's most popular AI tools. Many rely on ChatGPT for conversations, responding to queries, generating creative writing, and aiding in coding tasks. However, its limitation lies in the inability to store personal data long-term, a constraint observed since September 2021. Here, we unveil how to build ChatGPT with your own personalized data.
Step 1: Installing and Downloading Pre-built Software and Scripts
This guide caters to Windows 10 or Windows 11 users. To provide ChatGPT with customized data, users are advised to install Python3, Git, the latest Microsoft C++, and the ChatGPT retrieval script from GitHub. Ensure all previously installed software is updated to prevent potential issues.
Install the following software via the provided links:
Python: https://www.python.org/downloads/
Essential Tools for Your Development Journey
Get Git Here: https://git-scm.com/downloads
Important Note on Python 3 and Microsoft C++ Installation
When installing Python 3, ensure to check the option 'Add python.exe to PATH' before hitting Install Now. This allows easy access to Python from anywhere on your computer.
Once Microsoft C++ is installed, proceed with Microsoft Visual Studio Build Tools. Select 'Desktop development with C++' and then hit Install with all tools automatically selected on the right-hand sidebar.
Next, download ChatGPT-retrieval from the following link: https://github.com/techleadhd/chatgpt-retrieval
Simple Steps to Download the Script
Step 2: Setting Up Local Environment
To set up the local environment, navigate to the chatgpt-retrieval-main directory where you've downloaded the files. Simply open the chatgpt-retrieval-main folder and right-click to select Open in Terminal.
Once the terminal opens, copy and paste the following command:
pip install langchain openai chromadb tiktoken unstructured
After creating the virtual environment, users only need to input their OpenAI API key to access the service. You can generate an API key on the following website: https://platform.openai.com/account/api-keys
Once you've copied your API key, return to the chatgpt-retrieval-main directory and use Notepad to access the constants. Use your API key to replace the placeholder.
Step 3: Adding Custom Data
Adding custom data is straightforward. Simply place any custom text data into the data directory within chatgpt-retrieval-main. Text data can be in PDF, TXT, or DOC format.
Step 4: Querying ChatGPT via Terminal
The Python script enables users to query custom data added to the data directory and the Internet. This means you can access the ChatGPT backend, and all data will be locally stored in the data directory.
To use the script, run the python script chatgpt.p and add queries or questions as arguments.
python chatgpt.py 'YOUR QUESTION'
Note that your question must be enclosed in double quotation marks.
Check if you've successfully provided data to ChatGPT by asking some personal questions related to the Personal Sched.txt file.
Then, verify if you've provided the latest information to ChatGPT.
Here's how to build ChatGPT based on personal data you need to grasp. Save it for reference and application. Don't forget to follow Mytour to quickly update the most useful information.