Joy & Curiosity #80

Interesting & joyful things from the previous week

Open on Substack · Markdown

Do you know how it should work? Does the agent? Or does the codebase?

Lately I’ve been thinking a lot about why sometimes using an agent leads to great results and other times it doesn’t. My current theory: it depends on what knowledge about the task at hand is encoded where.

If all the knowledge required to solve the task to your satisfaction is available either in your prompt, or in the codebase, or in the training data of the model, then things go fine.

Things go badly if there’s a gap. That is, if you wrongly assume the agent will know how to do something but it won’t because that knowledge is neither in the codebase nor in the training data.

If I ask the agent to fix a bug that has a very obvious solution, say: a button’s hover state doesn’t activate on hover, then everything you need to know to fix it is available. The problem is in the prompt, the code should explain what the button is, and what a hover state is is in the training data.

But what if there’s a bug and you don’t know even how to explain what the bug is or what the desired state is? Not good.

Or what if you tell the agent to build you a feature and you assume it does so by going over here and adding that and then going over there and adding this, but the codebase allows fifteen other ways, and the training data doesn’t say those fifteen other ways are bad? Not good.

Sometimes the codebase and its documentation contains that information through types or tests or conventions. Other times the training data tells the agent that there’s only one way to add a new endpoint in Rails or Next.js or SvelteKit. But if it’s neither in the codebase nor in the training data, then you have to put it in the prompt.

Theory is too big a word for these thoughts, yes, but I’ve been asking myself “where is the knowledge?” a lot when working with Amp this week and found it useful, so there you go, maybe you get something out of it too.

Note from the producer: no newsletter next week. One weekend of vacation.