DEV Community

Jonathan Berg
Jonathan Berg

Posted on

Save the method, not just the result

I have spent most of this year thinking about what coding agents should remember. Almost all of the attention goes to things. The component you finally got right. The fix you never want to derive again. Those are worth keeping, and I have written about them here before. But a good run produces something else that is usually thrown away: the method that got to the result.

Watch a strong model do a task well once. Sorting a messy batch of documents against a company's own rules. Reviewing a diff the way a careful senior engineer would. The answer matters for a day. The way the model got to the answer is what you will need again next week, and in most setups it evaporates. The next time the task shows up, you rerun the expensive model and hope it reasons the same way twice.

That is a strange way to treat the most valuable part of the run.

A result ages, a method keeps working

Say an agent works out a careful procedure for checking supplier invoices against your rules. Which fields to read first. Which mismatches matter and which are noise. When to stop and hand the decision to a person. If all you keep is the classified batch, the next batch starts from zero. If you keep the procedure, the next batch starts from a flow that already proved itself.

This is the same shift I wrote about when I argued your agent should start from your library. Components moved the starting line from nothing to something. Methods move it further. A component is what you built. A method is how you work.

Written methods let weaker models do stronger work

There is a second effect, and it might be the bigger one. Once the procedure exists as text, you no longer need the strongest model for every repeat. The hard thinking happened once. A cheaper model can follow the flow.

You do not have to take that on faith. Run the cheaper model against cases where you already know the right answer and keep the runs where it passes. The question stops being which model is best in general and becomes which model has proven it can follow this method on your work. That is a question you can answer with evidence instead of vibes.

Every run is evidence

When a saved method gets reused, each run teaches you something. Which model ran it. Whether it passed. Whether a person confirmed the result or it was checked against known answers. Over time the library stops being a pile of text and becomes a record of what actually works, with the receipts attached.

Versions matter here too. A method will get edited as the work changes, and you want to see when an edit helped and when it quietly broke a run that used to pass. Memory without history is just the latest opinion.

This is the idea behind Playbooks, which I added to Sirro last week. Do the task once with the best model you have, save the method, and let the library show you the cheapest model that still passes on your own examples.

Components made my agents start from what I built. Methods make them start from how I work. The best run your agent had this month should still be working for you next year.

Top comments (0)