I

I built a GPT-4 bot which builds software incrementally

Hacker News

I built a GPT-4 bot which builds software incrementally

The ability to synthesize a relatively short snipped of code was already demonstrated. But I thought it would be interesting to test whether GPT-4 can replace a programmer completely. To do that, AI needs to plan its actions and work on code incrementally, one piece at a time. The challenge is the context size: the entire code base + plan does not fit into the context. My approach: Add only relevant parts of the code base to the context. Specifically, AI generation engine implements two distinct phases: planning and coding. In the planning phase, GPT-4 receives a tree of tasks and a summary of code base (list of files and their descriptions). It replies with updated tasks (i.e. it is able to create sub-tasks as needed), the task it wants to work on in the next step and a list of relevant code fragments for that task. In the coding phase, it receives the task description (as a tree, in YAML) and relevant code fragments. It replies with new generated or updated files, code fragments, and status: Was the task done? Do we need to break it into subtasks? In both cases bot can also show it's "observations" before the output, as I believe it helps with planning code generation/planning. Results: Currently I have only tested extremely basic scenarios. It needs a lot of work to be usable in practice. But I'd say it seems to work more-or-less as expected. Example 1: "Write a reddit-like backend in Kotlin, using Ktor. Start by planning and creating subtasks." This was the entire task which bot received, no other data. Results: Link to output: https://gist.github.com/killerstorm/dd6e26dc80064b7fc731d583f8d740c1#file-ktor_reddit-txt-L9 In short, it formulated reasonably-sounding subtasks and started generating code, e.g. made a Post model. It was aborted at that step due to GPT-4 API failure, it's not reliable yet. Example 2: "Write a reddit clone in TypeScript. Start by planning and creating subtasks." Link to output: https://gist.github.com/killerstorm/e3c50bea3ca3463c8b2d947dcfd80b84 You can see more work here, but I expect that it's less interesting. Challenges: I'd say it can work pretty well in file-at-once mode. Making _fragments_ of the file is more challenging because it's not a well-defined concept. FWIW GPT-4 largely ignored what I wrote about file fragments and made entire files at once, which was the right decision. I will post link to script in the comment to this post.

Share card

Actual performance

5points
4comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: model, new, context · Missing: mac, agents, macos
89%89% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Strong signals: started, ios · Missing: supports, reddit linkedin, podcasting
76%76% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: io · Missing: https docs, excited, just released
41%41% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: ios · Missing: mobile apps, personal, entrepreneurs
39%39% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
29%29% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
14%14% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

I
I built a TLDR bot with GPT-3 in Replit52%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

I built a TLDR bot with GPT-3 in Replit

Hacker News2
Ch
Chat bot powered by GPT-353%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Chat bot powered by GPT-3

Hacker News70
Confi AI
Confi AI75%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

The GPT bot for Slack and Confluence

Product Hunt+123Slack
He
Heliocrafts – The AI That Builds Real Software27%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Heliocrafts – The AI That Builds Real Software

Hacker News1
We
We built a bot platform on Lambda but aren't persuing it, interested?50%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

We built a bot platform on Lambda but aren't persuing it, interested?

Hacker News3
GP
GPT-2 Twitter Bot39%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GPT-2 Twitter Bot

Hacker News1
GP
GPT Bot for API Security48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GPT Bot for API Security

Hacker News2
Ge
Generate JSX with this GPT I built38%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Generate JSX with this GPT I built

Hacker News1
Ji
Jidoteki – Offload VM builds45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Jidoteki – Offload VM builds

Hacker News2
Bo
Bot analytics built with Meteor60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Bot analytics built with Meteor

Hacker News4