This is our try to see how can GPT-4 be utilized to generate working apps and to my surprise, it works quite well.
- For AI to create a fully working app, a developer needs to be involved in the process of app creation
- The app needs to be written step by step as a developer would write it and after each step, the developer in charge needs to review it to see how it's going
- The developer needs to be able to change the code at any moment and GPT Pilot needs to continue working with those changes (eg. add an API key or fix an issue if an AI gets stuck)
- The approach needs to be scalable so that AI can create a production ready app
- GPT Pilot needs to store the technical and the business context for all code that's written
- GPT Pilot needs to write automated tests for all code that's written so that it can debug any issues that arise while scaling the app
The idea is that AI won't be able to (at least in the near future) create apps from scratch without the developer being involved. That's why we created an interactive tool that generates code but also requires the developer to check each step so that they can understand what's going on and so that the AI can have a better overview of the entire codebase.
Obviously, it still can't create any production-ready app but the general concept of how this could work is there.
See examples of apps written by GPT Pilot here
- Clone the repo
cd gpt-pilot
python -m venv pilot-env
source pilot-env/bin/activate
pip install -r requirements.txt
cd pilot
mv .env.example .env
- Add your OpenAI API key and the database info to the
.env
file python main.py
After, this, you can just follow the instructions in the terminal.
All generated code will be stored in the folder workspace
inside the folder named after the app name you enter upon starting the pilot.
- continue working on an existing app
python main.py app_id=<ID_OF_THE_APP>
- continue working on an existing app from a specific step
python main.py app_id=<ID_OF_THE_APP> step=<STEP_FROM_CONST_COMMON>
- continue working on an existing app from a specific development step
python main.py app_id=<ID_OF_THE_APP> skip_until_dev_step=<DEV_STEP>
This is basically the same as step
but during the actual development process. If you want to play around with gpt-pilot, this is likely the flag you will often use
Here are a couple of example apps GPT Pilot created by itself:
- 💬 Prompt:
A simple chat app with real time communication
▶️ Video of the app creation process- 💻️ Github repo
- 💬 Prompt:
Build a simple markdown editor using HTML, CSS, and JavaScript. Allow users to input markdown text and display the formatted output in real-time.
▶️ Video of the app creation process- 💻️ Github repo
- 💬 Prompt:
Create a simple timer app using HTML, CSS, and JavaScript that allows users to set a countdown timer and receive an alert when the time is up.
▶️ Video of the app creation process- 💻️ Github repo
Here are the steps GPT Pilot takes to create an app:
- You enter the app name and the description
- Product Owner agent asks a couple of questions to understand the requirements better
- Product Owner agent writes user stories and asks you if they are all correct (this helps it create code later on)
- Architect agent writes up technologies that will be used for the app
- DevOps agent checks if all technologies are installed on the machine and installs them if they are not
- Tech Lead agent writes up development tasks that Developer will need to implement. This is an important part because, for each step, Tech Lead needs to specify how the user (real world developer) can review if the task is done (eg. open localhost:3000 and do something)
- Developer agent takes each task and writes up what needs to be done to implement it. The description is in human readable form.
- Finally, Code Monkey agent takes the Developer's description and the currently implement file and implements the changes into it. We realized this works much better than giving it to Developer right away to implement changes.
- Human developer is involved throughout the process - I don't think that AI can't (at least in the near future) create apps without a developer being involved. Also, I think it's hard for a developer to get into a big codebase and try debugging it. That's why my idea was for AI to develop the app step by step where each step is reviewed by the developer. If you want to change some code yourself, you can just change it and GPT Pilot will continue developing on top of those changes.
- Continuous development loops - The goal behind this project was to see how we can create recursive conversations with GPT so that it can debug any issue and implement any feature. For example, after the app is generated, you can always add more instructions about what you want to implement or debug. I wanted to see if this can be so flexible that, regardless of the app's size, it can just iterate and build bigger and bigger apps
- Auto debugging - when it detects an error, it debugs it by itself. I still haven't implemented writing automated tests which should make this fully autonomous but for now, you can input the error that's happening (eg. within a UI) and GPT Pilot will debug it from there. The plan is to make it write automated tests in Cypress as well so that it can test it by itself and debug without the developer's explanation.
🌟 As an open source tool, it would mean the world to us if you starred the GPT-pilot repo 🌟