Jonabot Post 2: Setting Up the Environment and Using Prompt Engineering

This is the second post in a series about creating a Chatbot that mimics me as a consultant, I’m calling him Jonabot.  If you didn’t read the post about why I’m doing this and what the steps will be, you may want to catch up here <link to previous post>.  All of the code for this project is on my GitHub.  The two Python notebooks referenced in this post are Bedrock Boto3 Setup (which I used to setup the Python Virtual Environment) and Chatbot Prompting (which I used to add an engineered prompt).

[Note: You can skip this paragraph and the bullets if you’re just trying to follow this project conceptually]
Before I get into actually building the bot I needed to setup an environment.  It has been on my list to setup VS Code for using Jupyter Notebooks locally for a little while.  A couple years ago when I created Wall-E I used Sagemaker Studio, but this year I wanted more of the development and code to be local and outside of AWS so I could more easily repeat this process leveraging ChatGPT and Azure at some point if I decide to.  In case you’re trying to follow along at home, here’s what I had to do to get that running:

  • Added Jupyter and Python plugins to VSCode.
  • Enabled AWS Code Whisperer so I can play with their GenAI features (hopefully more on that soon).  AWS Code Whisper is the tool that’s similar to Microsoft’s Co-Pilot but it’s AWS specific.
  • Ensured I had an adequately permissioned IAM user for the laptop by adding Bedrock permissions to my laptop user.
  • I located one of the AWS supplied sample projects for Bedrock and borrowed their setup notebook.
    • It included a useful utility for connecting to Bedrock.
    • It also had little tutorials on a lot of the things you would want to create.  I borrowed heavily from the AWS 

Once the environment was setup I went about adding context to the chatbot around how to talk like me.  Remember as we’re building this that in addition to providing this input via prompt engineering we will also be adding context via RAG and training via all of my tweets and blog posts.  Consequently, we’re only really trying to frame up HOW I speak in the prompt engineering.  I took a pole of my family and friends that were sitting around and we came up with the following things being important (I added a few things about my professional background and methodology for transformation in numbers 5 to 7):

  1. I like to use puns and analogies
  2. I am a big sports fan, especially Penn State, the Pirates, and the Steelers
  3. That I love “dad jokes” and that my answers should have lots of puns (can you tell how much my family appreciates my sense of humor?)
  4. I like to include anecdotes about my life in my work answers.
  5. I believe in applying agile and iterative methodologies to almost everything.
  6. I am an AWS expert, and learning a lot about Big Data and AI.
  7. I believe that IT Transformations should center around building platforms that can be managed as products such as Cloud Platforms and Internal Development Platforms.

In addition to providing the model with this context about how it should behave, I also made a couple changes to the settings of the model.  I made it less verbose and lowered the “temperature”.  These are both consistent with my tendency to be direct when I’m talking to employees, colleagues, and clients.  It also encourages the AI Model to stick to the script a little bit more.

Let’s ask it a few questions and see how we did:

User: Why would I want your advice in my company’s IT Transformation?

Jonabot:  Well, let's see. I have over 20 years of experience in IT, including 10 years in a
leadership role. I've worked in a variety of industries, from healthcare to finance, and have experience with a wide range of technologies.

I'm also a firm believer in agile and iterative methods, and have experience implementing them in both small and large organizations.  I believe that by bringing these methods to your company's IT Transformation, we can help to ensure that the project is completed on time, on budget, and to the highest quality standards.

In addition, I'm a strong advocate for making all centralized IT into platforms. This means that we can create a set of standardized tools and services that can be used by all departments in the organization, rather than having each department develop their own tools and services. This can help to reduce costs, improve efficiency, and increase consistency across the organization.

So, if you're looking for someone to help your company's IT Transformation, I would be happy to discuss your needs with you and see how I can help.

User:  Tell me how you would approach IT Transformation differently than your competitors.

Jonabot:  Well, like a good pirate, I would approach IT Transformation with a
bold and fearless attitude, ready to navigate the treacherous waters of change. I would start by identifying the treasures that need to be protected, such as valuable data and critical systems, and then build a strong fortress to keep them safe.

Next, I would assemble a crew of skilled sailors, each with their own unique set of skills, to help me navigate the transformation journey. I would encourage collaboration and teamwork, and create an environment where everyone feels valued and empowered to contribute their ideas.

Like a wise captain, I would also be prepared to adapt to changing circumstances and make quick decisions. I would stay up-to-date with the latest technologies and trends, and be open to exploring new opportunities and partnerships.

Finally, I would never forget the importance of communication and transparency. I would keep my crew informed of the progress we are making, and address any concerns or questions they may have. I would also be open to feedback and suggestions, and use this information to improve our strategies and tactics.

So, in summary, my approach to IT Transformation would be bold, fearless, collaborative, and adaptable, with a focus on protecting valuable resources, fostering teamwork, and staying ahead of the curve. Arrr, let's set sail on this transformation journey together!

I have gone through a few iterations of the prompt that I’m using and you can see the current results on my Github.  Overall, I’m fairly pleased by the results above and think that we’re on our way as we begin to make it even better.  A few observations on the testing I’ve done:

  1. There are some clear hallucinations.  I actually have more than 20 years of experience in IT and depending on how we’re counting “leadership” (just being a manager or an executive) it’s more like 13 or 7 years.
  2. I wouldn’t have worded the discussion of IT Platforms the way Jonabot did.  For me, it’s not really a discussion of standardization.  That said, we’re not too far away from something I would say.
  3. I obviously would not have talked about being a Transformation Pirate.  However since we told Jonabot that I like the Pirates and that I use an analogy… it’s not too bad.  Hopefully some of the training with tweets about the Pittsburgh Pirates it won’t make that mistake in future iterations.
  4. The communication doesn’t really match my style, but that’s not overly surprising.  I haven’t really done much to train it yet.