‹ BackHN Continuity

Thread

Agents don't need memory, they need documentation

363 points · 259 comments · kmeh

  1. bushido · · focus · HN ↗
    Something I started doing recently was writing out principles instead of memories.

    Essentially patterns the agents need to always think in. I also implemented a versioning system to the principles that need to be quoted in any comments which are there in the code. That way, when my principles evolve, so does the code.

    I did package it up in a way that I can share it with friends [0]. System still evolving, but the last two-ish months that I've used it has served me really, really well, And it's been even better with the latest models.

    I've had surprisingly good adherence from agents on this technique.

    [0] <a href="https:&#x2F;&#x2F;principledriven.dev&#x2F;" rel="nofollow">https:&#x2F;&#x2F;principledriven.dev&#x2F;

    1. mzhaase · · focus · HN ↗
      I&#x27;ve done that too, called it Decisions. Was happy for a while, but then the agent started to make decisions longer and longer, putting &quot;x, not y&quot; in there. It started to write them without asking. Suddenly in code review it would say &quot;violates D-236&quot;. Some rule it made up that I never approved. Then I made very clear that it should never touch those files. Still does. Now it&#x27;s just context bloat.
      1. bushido · · focus · HN ↗
        I can&#x27;t imagine ever getting to 236. My largest codebase has 22 principles. And I&#x27;m already struggling to add a 23rd. I have some candidates, but I&#x27;m on the edge of where it get&#x27;s complex. With a lot of effort, I could maybe see this getting up to 30.

        If it helps, here&#x27;s how you think about it, principles are not decisions, they&#x27;re mental models and frameworks to allow making decisions. In my case, they&#x27;re there to allow agents to make decisions without asking me. But the decisions cannot be recorded - the code serves that purpose. What can be recorded is why the commend for the block of code needs to cite what principle was used in the current shape, which is why there is a citation of the principle.

        When the principle evolves, so does every decision, at the very least, every decision gets re-litigated to see if it needs to evolve.

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.