New bot, who dis?
Katya creates a mental health bot using OpenAI and shares the steps she took.
Welcome to Katya Cares, a fresh Substack space! Here, we explore new technologies, remote work culture, art, psychology, and joy.
In this post, I discuss re-learning how to code and mastering the OpenAI API to create a mental health tool. This post is less about "What is AI?" and more about exploring "How Katya created an AI tool?". If you are interested in the specifics of how I built the bot, jump to the middle!
Katya is Angsty
The year is 2022. Ah, yes - that was a long time ago. Let me remind you.
Tech layoffs are everywhere. Those with jobs are required to work in the office. Russia invades Ukraine and Katya cries for the victims. AI this. AI that. AI what? AI why?
Katya is promoted to Director of Product at Octane AI, a small e-commerce company. Note the AI.
From 2020 to 2022, Katya works hard at her dream job from home, while also keeping her community Covid-free. She starts a Happy Reads book club, draws every day, and takes walks - sometimes hot, sometimes medium.
By the end of 2022, Katya is angsty. Her routine keeps her healthy, but it's no longer enough. Life is short, and she wants more.
Angst can be a great motivator to learn something new, so I'm not shy to share it. Maybe you can relate to the shift of energy happening now. It's the perfect time to learn something new.
Katya isn’t scared (of coding)
Anyone with access to a computer and the internet can learn how to code, build a website, and launch an app. I don't find this to be scary. Maybe you do. And that's OK; we all have different fears. It's important to recognize what scares you and what you find easy.
This is my list of fears:
The person coughing to my left
The person sneezing to my right
Losing financial independence
WW3
And these are a few things I find easy:
Laughing at myself
Learning anything you can Google, watch on youtube or ask for help about
People have tried to scare me away from working in tech. Men have often said that coding is hard and I need a Computer Science degree to be considered smart and technical. But I don't believe it. Moving to a different country and learning a new language and culture is hard. Thousands of people I know have done it. Studying Computer Science or math for enjoyment and career growth? Ehhhhh what is so hard about that? It just takes time.
If society hadn't told me tech was for men, I'd still be a PM in tech and ask, "Where are all the women?"
Katya decides to be more technical, again
It is helpful context that I created my first website in elementary school. I was scared that I would lose my first American friends when I went to middle school far away, and so, with the wallet and patience of my dad, I made a little website directory of my 5th grade class. I took photos of everyone and wrote little blurbs about them and publicly put their address and contact information (oops). Then Zuckerberg bought my website and my dad became filthy rich. Just kidding. Then, we only used my website for a month and Myspace became a thing. Womp womp. I stayed poor but made new friends.
The point is - I have been using technology to relieve angsty feelings since day one. Tech is just a tool! You use it to achieve goals and relieve angsty feelings. You can learn tools!
I also took computer science classes in college because I found it to be interesting. I took machine learning classes online. But then years passed.
By 2022, I barely coded because my job didn't really need me to. I had more than enough work to do without it. I didn't feel angsty.
And then, at the end of 2022, it finally hit me that AI was going to take over the world, in a way that crypto failed to. I never became a crypto expert, even though I told myself I would learn a million times, but with AI, I simply couldn't fall behind. Artificial Intelligence is going to power more and more of our technology and will impact almost all jobs. More on all of this later.
I need to know everything there is to know. Not only do I work in tech and need to stay employable, but also, more importantly, I'm scared for what AI means for our future. My non-tech friends started acting scared and asking questions that I didn't have answers to.
I need to know how to use and speak on the latest AI tools. I need to know how to make my own tools that help my community, to counteract the tools out there that might hurt us. I need to know the ethics of AI and participate in making ethical products.
I need to be more technical. And I started on that journey.
Katya’s Journey to Creating Tool Using OpenAI
Here, I will dive deep into how I went from having no ideas, not even a code editor on my new computer, to releasing a new tool.
1. Goals & Motivators
When learning a new big skill, I always start by writing down my goals and motivators to remind myself why I'm doing it and to stay on track when I feel stuck. My goals may change but my motivators usually don't.
For instance, I wrote: "My goal is to stay knowledgeable about the latest and greatest tech for my career, which currently is AI."
Under this, I wrote smaller, achievable goals like: "Learn more about generative AI, code more in 2023 than I did in the last two years, make my own apps again, and read about AI daily".
My motivators include: fear of falling behind as a product leader, fear that computers will take over, and fear that the wrong people are making decisions without input from people like me.
2. Strategy & plan
I learn best by first reading a bit about a subject, and then diving in and attempting it myself with a goal in mind. That's my strategy.
To stay motivated when learning a programming language, I need to have an idea of what I'll use it for.
Since I wanted to learn about AI, I chose a specific API and worked towards creating a website with it. Here's my plan:
Select an API
Read the API documentation for a few days
Complete any tutorials available
Research existing websites built with the API
Pick an idea that is relatively easy to implement and hasn't been done yet
Start working on my own project
I had no idea what tools I would need at the start. You will see later that I simply followed tutorials and examples, without having to make many decisions myself. Highly recommend.
3. OpenAI API
OpenAI is the research company that created ChatGPT, the chatbot everyone is talking about.
AI is an umbrella term. Most companies use AI already. What's making waves is OpenAI's ChatGPT and Dalle tools, which are generative AI tools. This means they create something for you, like an answer or a drawing, based on the info you give. We humans love that—we put a little in and get something just for us!
OpenAI isn't the only company using AI to train models. I chose OpenAI because I had early access to its API through work, and it was straightforward to read. Too many choices can stop you from starting anything.
I read through the API in full. My goal wasn't to understand every detail, just to read.
4. OpenAI’s playground
Next, I explored the Playground. It was easy and lots of fun. I followed many of the examples available. I asked it questions about life, movies, coding, and even asked it to rewrite what I had written.
The learning curve is simple: you provide a prompt describing what you want, and it provides a completion that it thinks is the answer. You can increase the temperature to make the output more daring and random.
By pressing "View code," you can see the code powering the Playground, helping you understand how you can use it for your own coding projects.
5. Idea - Reframe My Thoughts
I was bored with reading and playing, so I decided to start building something. I needed an idea.
Ideas are plentiful, and if you ever need one for an app, I'm here to help! It's a skill that becomes easier with practice; writing out ideas often and reading other people's ideas is a great habit to get into.
I wanted to use OpenAI to create useful, simple tools that I could use in my day-to-day life. Something that wasn't evil. So I decided to make a small tool to help me get out of negative thought loops.
The concept was simple; you tell the robot the negative thought you can't stop thinking about. It helps reframe it into a more positive thought. By taking this action, you don't just loop in your head, and you can feel relief. Maybe you even stop looping.
I understand that therapists are available for this, and I studied psychology and neuroscience, considering being a neuropsychologist. But, they aren't always available, and they're not free.
Sometimes, I don't need a whole person taking precious time to help me. I just need a reminder that I can think differently, when my brain is struggling on its own. An online tool can help with this.
So I started building a tool to help Reframe My Thoughts. For myself. It would help me in life and it was simple enough for me to learn how to code it myself. Win win!
6. Building Reframe My Thoughts
It took me around a week to build my super simple tool and website. I'm sure a "real programmer" could do it in a few hours, but it might take a newbie a few more weeks to get it done. But anyone can make this and make it better - we're just here to learn.
This is how I built the first version of my tool:
I followed OpenAI's quick start tutorial
I downloaded Visual Studio Code, embarrassed that I was missing a code editor on my new computer. VSC is where I write my code before deployment, just like Notion is for my blog posts.
I installed Node.js since OpenAI asked me to, and used it to finish OpenAI's tutorial
Aside from Node.js, I wrote my tool in JavaScript (backend) and HTML (frontend), and used the OpenAI API to power the bot
I sent a screenshot of my progress - a simple website that helps name pets - to the CEO of my company, because I'm a kissass and he's nice to me.
A side note: It's beneficial to be surrounded by people who believe in you. Coworkers and even CEOs are no exception. I'm fortunate to work with a CEO like Matt Schlicht, who has faith in me and offers encouragement.
I wrote out what I needed for my idea:
Somewhere to host my website
Design for the website. For Reframe My Thoughts, I wanted a very simple design - just a box where you can ask the bot to reframe a thought and it provides a response.
Prompt engineering to tell OpenAI what to send to my users
I watched YouTube videos on how to use OpenAI API and found out many people, including my mentors, use Google's Firebase
I signed up for Firebase, which handles hosting, database, and more
I read the Firebase documentation to get familiar with it
I followed Firebase's steps to create a new project (name it and answer questions)
I decided to learn Bootstrap for the website design, so I got Bootstrap (a free HTML, CSS, JS library) and created a basic HTML file, copy-pasting some of Bootstrap's styling (e.g. buttons)
Time for prompt engineering! I played around with OpenAI's code until I got it to do what I wanted - to reframe negative thoughts using CBT techniques. Tweak, firebase deploy, tweak, firebase deploy.
I copied what I learned in the OpenAI Quickstart tutorial to use the API for my own website
Everything was set - website on Firebase, design, API working! All for free!
And then, of course, I decided to actually release this thing.
7. Releasing Reframe My Thoughts
Check out https://reframemythoughts.com/ ! Tada! So simple!
I use this tool daily. Whenever I start to worry about something, I type it in and it helps me to reframe my thoughts.
For example, I complain to it when I wake up in a bad mood from a bad night’s sleep.
The great thing is it always gives a different answer, so you can press “submit” until you feel better.
For example, I also got this response: “I am noticing that I am feeling sad this morning because I wasn’t able to get myself to fall asleep on time. While I can’t change what happened, I can remind myself that this is just a temporary feeling and that I have the power to take action to make this day better. “
Pressing “submit” is much healthier than looping in your own head and feeling stuck.
This is the first version of the tool. I'm already working on the next version. I'm using Firebase for the database and JS/HTML for login functionality. I watched a lot of videos on YouTube to figure out how to do it. This is much harder than the first 13 steps.
When I get stuck, I ask ChatGPT “WHY ISN'T THIS CODE WORKING?” It helps! I used to search Stack Overflow and Google for coding questions, but now I just yell at ChatGPT. It isn't trained on the latest technology, so for example, it sometimes gives me the wrong code for the latest Firebase version. Still, ChatGPT helps me get out of a mental block when I'm stuck.
I also talked out coding dilemmas with my father. ChatGPT does not replace fathers ✍️.
I did something unexpected too. I bought the domain name https://reframemythoughts.com/ for around 15 bucks a year. I did it through Google Domains and connected it to Firebase. It took a few days for Firebase to verify the domain was secure. Now I have a custom website that might show up in search results.
Even if only 15 people use it to help relieve anxious thoughts, I think the custom domain was worth the price.
Have you seen my new bot?
Try it out - it's free!
I purchased it, so I'll keep sharing the link: https://reframemythoughts.com/ Thrilling!
If you give it a try, please let me know in the comments (or by mail)! Did it work for you? Any feedback? Should I continue developing it?
Should I create more mental health tools?
I am passionate about mental health and, although there are a few AI-based mental health apps available, there simply aren't enough. It's not even listed in OpenAI's examples.
Next Steps on my “Being More Technical” Journey
Improve this bot a little based on your feedback!
Maybe create a few more ideas I wrote down at the very very beginning..
I have another AI tool I want to learn next.. will write about it soon.
What Else?
I'm tweeting about my process https://twitter.com/katyacares, which is like a part-time job that I'm doing for free - yay!
I'm also learning Substack and this is my first week using it. I’ll share Substack learnings with you. For now, please give me feedback and recommend Substacks for me to read!
Additionally, I'm reading my first book on AI and ethics called The Equality Machine by the smart woman Orly Lobel.
Ending with Joy
I want to end with a story from this week about the importance of cherishing joyful moments. This is my blog and I can end it however I want and you might even read it. Wow.
I was sitting in a café with a friend on Sunday, feeling cozy. I was doodling my friend while we caught up and discussed some sad topics; several people we knew had passed away recently. Steph suddenly paused and said, “Wait, are you drawing me? I feel honored and grateful.” I felt joy that my doodling brought her joy, and she felt joy that it made me happy. It was a nice moment. The photo may not be great, but I wanted to share it anyway!
That photo is so big and unedited. I have mocha on my lips. Apologies.
Noticing daily joyful moments and capturing them is so important. Joyking is so important. See first post where I defined it. Joyking reenergizes you and you need that energy to learn. If I didn’t have my little joyful moments, I wouldn’t have this post!
Anyway, Did You even Read & Do You even Care?
I think so! Thank you for reading my first real post!
Subscribe, like, and let me know what you think! I’d love to know if you’re learning something alongside me. Let’s learn and share and care together!
Great post! How are you forcing the answer to focus on the mindset instead of suggesting a solution?
Take this as an example https://imgur.com/wQBrKN3