Building with ChatGPT - Part 2 - Coding with ChatGPT
In this part, we are building a ChatGPT powered app with ChatGPT... and then get distracted by everything AI on Twitter (BabyAGI, AutoGPT and Langchain).
Welcome to part 2 of building with ChatGPT, where I try to build a ChatGPT powered app... with the help of ChatGPT. If you've missed part 1 of this personal blog series, go check it out here:
TL;DR? Here's a short recap:
- We want to build an app that is powered by ChatGPT.
- The idea is that solo startup founders can ask different experts - like marketing experts or technology experts - for advice for their startup.
- The app essentially is a frontend for ChatGPT, in which the user can talk to different AI experts that have been initialised with well-written prompts and have been given contextual information about the startup.
Using ChatGPT for Coding
At first I wanted to code the app in Python, but I realised about after half an hour that it would be more interesting to create the application using a programming language that I am not familar with and having ChatGPT help me to learn how effective ChatGPT is at coding. What I wanted to get from ChatGPT was fully working node.js code that I could just use inside of a software development environment.
Here's the initial prompt I sent:
Please create a node.js and react application. Broadly speaking, the app should integrate with OpenAI's ChatGPT and provide the user with a way to interact with a few different ChatGPT "personas" (similar to how you would interact with different people in a chat application). I want the application to consist of these windows: 1) A sidebar, containing the different personas that the user can click on to start a "chat" with that persona 2) A main area, containing the chat history and a way for the user to send input Please optimise the app for desktop usage.
What I got back was helpful, but not what I was looking for: ChatGPT told me that it can't build fully functioning graphical applications and instead gave me very broad instructions and a list of resources for me to look at to create a node.js application.

But I really don't want to learn node.js... so let's try another prompt. This time I'm specifiying that I want server-side code since the first response indicated that ChatGPT had problems with the graphical user interface. I resend the previous prompt with one added line:
Please provide all the server-side code.
And we're now getting some code back! Unfortunately ChatGPT has a character limit when it comes to responses, so it just stopped in the middle. I wrote
please continue
and ChatGPT continued giving me code, but it messed up the formatting a little bit (which doesn't really matter that much, more of an annoyance).

What is more interesting is that ChatGPT now doesn't just provide the server-side code, but also the graphical user interface! That just goes to show that sometimes you need to send in multiple similar prompt if you're not getting the response you expected.
After I copy-pasted all the code that was provided into my Visual Code project I wanted to to start the app that ChatGPT developed. But since I know next to nothing about web development, I had to ask ChatGPT:
how do I start the server

And 🥁... it does not work. I had to fix one small error with how the created code called the OpenAI API (I assume that this is because ChatGPT has no knowledge beyond 2021 and that the API was changed after that). Still, this is quite remarkable - even though this is just a bare-bones app without much actual functionality.
Next I wanted to use ChatGPT to get the app fully functional, but instead I got distrcated by everything that was happening on Twitter in the AI world.
BabyAGI, AutoGPT and Langchain
AI has moved at lighting speed in recent weeks. Multiple new AI tools are being released every day and it seems like every week there's something more revolutionary created by someone. Probably the three most important projects are BabyAGI, AutoGPT and Langchain.
BabyAGI
BabyAGI is a task-driven autonomous agent. The main concept behind these agents is that they run in a loop - creating tasks based on the results of the previous instructions. Here's a quick & simplified sketch of what that looks like at a high level:

BabyAGI itself is a Python script that is usable with Docker. Here's two interesting examples that show what people have used it for:
Over the weekend I finished the to-do list that does itself.
— Garrett Scott 🕳 (@thegarrettscott) April 11, 2023
Everytime you add a task, a GPT-4 agent is spawned to complete it. It already has the context it needs on you and your company, and has access to your apps.
It’s called the Do Anything Machine (Link in thread) pic.twitter.com/4Mn7cf67va
Just added search to my BabyAGI chat plugin using Google API, and it feels like a superpower! 🔎
— Pietro Schirano (@skirano) April 18, 2023
Here GPT effortlessly finds the best speakers on the market, displays links to buy, and even creates a website to store them.
Without asking. 🤯
How thoughtful is that? pic.twitter.com/4AUSSaQOAF
AutoGPT
AutoGPT is very similar to BabyAGI, with the main difference being that AutoGPT can also interact with the "world" - it can for example connect to the internet & use Google (giving it access to up-to-date information) or execute Python code.
Here's someone who used AutoGPT to get the best 5 waterproof shoes - with AutoGPT going as far as checking for fake reviews by itself:
Whoa.. still not convinced of AI Agents? This might change your mind...
— Sully (@SullyOmarr) April 9, 2023
I pretended to be a fake shoe company and gave AutoGPT a simple objective:
- Do market research for waterproof shoes
- Get the top 5 competitors and give me a report of their pros & cons
Here's how it went: pic.twitter.com/mFttG4PXrk
Langchain
LangChain is a framework for developing AI applications. It's objectives are to enable data-aware and agentic apps, meaning:
- Apps that are data aware - eg letting ChatGPT answer questions about your companies internal Notion pages.
- Apps that interact with the environment - eg allowing ChatGPT to interact with weather APIs on the internet.
Langchain also abstracts different parts of the "AI stack" by for example allowing you to quickly replace OpenAI's LLM with HuggingFace's. Both BabyAGI and AutoGPT are built using Langchain.
Here's some more things that people have used Langchain for:
Here's a little weekend experiment.
— props (@props) April 21, 2023
What if it were super easy to audit smart contracts for security vulnerabilities? @calvinhoenes built a prototype security agent using @LangChainAI & @OpenAI.
What smart contracts should we test next?
How it works 👇 #ChatGPT pic.twitter.com/YDiwFBsezy
🤖 Built an @openai #GPT4 bot with @LangChainAI to manage our insurance policies.
— Nico Müller (@nicomuellerAT) April 21, 2023
It's a game-changer with its natural language interface - no more policy jargon struggles!
Bonus: Multilingual support means my wife can ask questions in German or even Thai! 🌍#ChatGPT… pic.twitter.com/fEsXdF3hwj
If you'd like to know more about BabyAGI, AutoGPT and Langchain, go and check out our reading recommendation:
@sophiamyang article on Autonomous AI Agents is our #AI reading recommendation of the day. Amongst other things it introduces #BabyAGI and #AutoGPT and also gives a quick tech-intro about agent architecture. Great for catching up!https://t.co/L5LB9XHNqN
— Endeavours Way (@EndeavoursWay) April 20, 2023
Next week we'll do a a quick experiment with Langchain to see if we can make use of it in our app!
