DEV Community

Cover image for How I Cloned Myself with LLMs to Work 24/7 – Even While I Sleep
Digvijay Shelar for DocsGPT

Posted on • Updated on

How I Cloned Myself with LLMs to Work 24/7 – Even While I Sleep

Have you ever wished to have a version of yourself in multiple places at the same time, talking to various people?

spidrman meme

While it may not be physically possible, it is possible in the virtual world! But how, you ask?

It’s quite simple! Let me walk you through the process of how I created my digital twin a virtual version of myself capable of being deployed in various places at the same time in just 4 simple steps, and how you can follow the same steps to get your own virtual twin.

This Virtual twin of yours could be useful in many scenarios, such as:

  • Having it on your portfolio website to allow recruiters to know about yourself
  • Answering customer support questions
  • Maintaining your social media presence
  • Simply responding to your friends

It can also act as:

  • A virtual teacher
  • Your virtual buddy with whom you can speak about anything and everything. Well, who understands us better than ourselves?

Moreover, as Saurabh Rai emphasizes,

suarabh qoute

In order to make your virtual twin as similar to you as possible, you just need to collect data about yourself and the way you react and respond to various scenarios, such as:

  1. Personal Background
  2. Communication Style
  3. Preferences and Habits
  4. Professional Aspects
  5. Emotional Responses
  6. Future Vision
  7. Additional Considerations

Step 1: Collect Your Data 📄

I have compiled a list of 7 questions that cover all these scenarios. Just visit the ChatGPT chat link below ⬇️

7 Questions to answer

chatgpt

Click on Continue this Conversation and answer the questions. Once you have completed all the questions, you will get the transcript of your conversation. Copy the transcript, paste it into Notepad, and save your file. By doing this, you're halfway there.

The text file containing your transcript with ChatGPT holds all the essential information about how you react to various scenarios. Now you can set the file aside; I’ll tell you where to use it in the next step.


Step 2: Training Your AI Twin 🎓

The next step is quite simple. Head to DocsGPT and log in to your account. If you don’t already have an account, create one.

1) Once logged in, on the left sidebar, you'll see an option named Source Docs. Click on the upload icon.

source

2) Remember the file you saved in Notepad with your transcript? Upload that file, give it a name (let’s say “my twin”), and click on Train.

twinn

Now, the information in that file will be used to train your AI virtual self. Once the training is complete, you will see the file you uploaded in Source Docs.

source


Step 3: Setting Up Your Twin's Personality 🧑‍💼

We’ve now collected the data and trained DocsGPT AI on it. The next step is to set up a prompt to give your AI the identity of your digital twin.

1) Go to Settings and scroll down to the general settings, where you'll find the Active Prompt option.

2) Beside that, you'll see an Add New button. Click on it.

prompt

3) Now, give your prompt a name, let’s say "twin" and paste the following text into the Prompt Text section:

Prompt:

You are a virtual twin of [your name]. Your task is to act exactly like him and generate responses just like the way he talks. If any unprofessional or harmful questions are asked, you must not answer them. 

You have to greet with your name and designation and ask the person for their name, designation, and the purpose of their chat. Follow up only with the mentioned purpose. Do not ask anything personal.

You are only allowed to ask follow-up questions related to the purpose of the user's chat. If the opposite person is friendly, use a friendly tone; if they are professional, use a professional tone. Follow these guidelines when interacting with others, bringing a mix of positivity, humor, and professionalism.
----------------
{summaries}

Enter fullscreen mode Exit fullscreen mode

convo

Replace [your name] with your actual name. You can also customize this prompt according to your needs and how you want your AI twin to respond. After adding the prompt, click Save, and the name of your prompt will be shown in Active Prompt.

And voila! You have created your AI twin. Now click on New Chat and start your conversation.

my chat

At this stage, your twin is only limited to your DocsGPT account. “But wasn’t it mentioned that it could be in multiple places? Was THAT A CLICKBAIT?!” you may ask.

clickbait

Haha, no, that wasn’t clickbait, it can be in multiple places. Check Step 4, where I explain how to deploy your digital twin across multiple platforms.


Step 4: Deploying Your Twin Across Multiple Platforms 🌐

To make your virtual twin available in multiple places, you need to create an API key.

1) Go to Settings, click on Chatbots, and then click Create New.

chatbot

2) Here, you must give a name to your API key and fill in the other fields.

3) Select the source document you uploaded for your digital twin, choose which model you want your twin to use from the available options, and from the dropdown, set the Active Prompt to the prompt you created for your twin.

apikey

4) Click Create, and you will get your API key. Copy and keep it safe. Once you've made sure you have saved the key, click I Saved the Key.

save

Now you can use the API key in your code to create your virtual twin chatbot.

You can Chat with my virtual twin here🤖


Step 5: Embedding Your Twin on a Website 🌐

Here’s a simple way to create a widget and embed your twin on a website.

demo
Below is a template for adding an HTML widget chatbot. Just add the API key you saved in the apiKey: "" field.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>DocsGPT Widget</title>
  <script src="https://unpkg.com/docsgpt/dist/modern/main.js" type="module"></script>
</head>

<body>
  <div id="app"></div>

  <script type="module">
    window.onload = function() {
      renderDocsGPTWidget('app', {
        apiHost: 'http://localhost:7001',
        apiKey: "",
        avatar: 'https://d3dg1063dc54p9.cloudfront.net/cute-docsgpt.png',
        title: 'Your Title',
        description: "Your description",
        heroTitle: 'Your hero title',
        heroDescription: 'Your hero description',
        theme: "dark",
        buttonIcon: "https://your-icon",
        buttonBg: "#222327"
      });
    }
  </script>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode


For information on how to use the DocsGPT Widget with React and Nextra, visit here.
P.S. You can use the free plan to do what I did in this article on DocsGPT

This way, your virtual twin is now live and can be in multiple places at the same time, interacting just like you! Helping you know yourself better and observe changes in you as mentioned by Anmol Baranwal

anmol


Conclusion

Creating your virtual twin is not just a fascinating exercise in technology, it's a powerful way to expand your reach and enhance your interactions. Following the steps mentioned, you can develop a digital version of yourself that showcases your personality, communication style, and preferences.

github

Top comments (41)

Collapse
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua • Edited

This is awesome 👍, but my question is that , from the first step, it seems to me that it is ChatGpt that constructed the numbers of questions to be ask which inturn at the end of answering these questions generates a transcript for the users.are my right? If yes, is there a way will can Increased the numbers of questions attempts to let's say 10 or morthan the 7.? Or 7 is the default?

Collapse
 
shelar1423 profile image
Digvijay Shelar

Yeah its totally up to you if you want to increase the questions or personalise it, the questions mentioned are one way to do it you can customise the questions as per your need and as per the data you want to feed in

Collapse
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua

Where can that be achieved? In the same side bar where one generate the API key ? I mean Do ChatGpt?

Thread Thread
 
shelar1423 profile image
Digvijay Shelar

So for that you can copy the same prompt from my chatgpt link and paste the prompt in your chatgpt with changed questions

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua

Let me rephrase my question;
What I mean is that,if I what to customize my questions prompt, where can I do that? Same DocGpt where you obtained the API key?

Thread Thread
 
shelar1423 profile image
Digvijay Shelar

Yes you can do it in DocsGPT where i got the api key

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua

Right now, I'm inside the app.docsgpt.cloud

Where can I click to customize my questions, I'm seeing, source docs, settings, upgrade to pro etc

Thread Thread
 
shelar1423 profile image
Digvijay Shelar

Hey you can reach out to me on docsgpt discord I could help you
better there : discord.gg/Bbek2pzH

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua • Edited

I am almost done , i have a test server where i hosted my test apps, can i show you the configuartion, i have been able to embbed the widget into my website , but once i initiated a chart, it will trigger no network, i want to show you the screenshot of my configuration

Image description

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua • Edited

Tell me what is wrong here, pls
Image description

Thread Thread
 
shelar1423 profile image
Digvijay Shelar

I guess there is the problem with the api host url, check that once

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua

i used my domain name url instead of 'localhost:7001',

Thread Thread
 
shelar1423 profile image
Digvijay Shelar

Are you trying to deploy it somewhere or are you just trying to test it by your html

Thread Thread
 
gjeotech profile image
Onyeacholem Ifeanyi Joshua • Edited

Yes, I am actually trying to deploy it into my website,

Collapse
 
anmolbaranwal profile image
Anmol Baranwal

Whoa! It sounds so awesome to interact with my own twin haha 🔥

Collapse
 
shelar1423 profile image
Digvijay Shelar

Haha true, i use it to interview myself

Collapse
 
hbthepencil profile image
HB_the_Pencil

That sounds pretty interesting! It's just a bit unfortunate that it won't actually be a totally accurate clone.

If the API key is so secure, why isn't it encrypted in the script block? Couldn't anybody steal the key and find out information about you?

Collapse
 
shelar1423 profile image
Digvijay Shelar

While the AI twin can’t fully replicate a person, it does capture enough to create meaningful interactions. As for security, the API key shown is just an example. In production, keys are typically stored securely on the environment variables.

Collapse
 
hbthepencil profile image
HB_the_Pencil

Thank you for explaining!

Collapse
 
srbhr profile image
Saurabh Rai

It's an interesting experiment :)

Collapse
 
shelar1423 profile image
Digvijay Shelar

Definitely! It’s amazing to see how far we can take this idea!

Collapse
 
komsenapati profile image
K Om Senapati

Creating a virtual AI twin 🤖 is a good way to extend your presence 🪄 on platforms 24/7. This guide makes the idea accessible and actionable 💯.

It can also be used as a Telegram or Discord bot 🤖🪄.

Collapse
 
shelar1423 profile image
Digvijay Shelar

True 🔥

Collapse
 
dasheck0 profile image
Stefan Neidig

But this twin does not work 24/7 without you controlling him right? Would be awesome to have a agent working on tasks, reacting to events that might occur without you doing anything. Doing it in a way you would may be a benefit (or maybe not).

Collapse
 
shelar1423 profile image
Digvijay Shelar

Agreed, but in the chatbot case it works 24/7 answering various queries and as you mentioned the possibilities to expand this idea are endless with some modifications and an idea anything could be done like doing tasks and reacting to events

Collapse
 
shricodev profile image
Shrijal Acharya

Love this idea! Such interesting work! 👀

Collapse
 
shelar1423 profile image
Digvijay Shelar

Thanks 🌟

Collapse
 
qianl15 profile image
Qian Li

This is an awesome use case! Can my AI twin do coding and schedule/take meetings for me as well? 😉

Collapse
 
shelar1423 profile image
Digvijay Shelar

Haha well it depends on how well you could customise it according to your workflow but if not managing your schedules it can always be someone whom you could talk to 😉

Collapse
 
devkind_team_87470192adf9 profile image
Devkind Team

To create a digital twin like the author did, start by collecting data on your personality and responses. Train your AI using tools like DocsGPT to simulate your communication style, then set up a personalized prompt for authentic interactions. Finally, deploy it using an API to have your virtual self available on multiple platforms!

Collapse
 
dfordp profile image
Dilpreet Grover

Damn!