{"by":"edunteman","descendants":51,"id":43988381,"kids":[43991197,43989752,43988789,43992832,43990420,43989430,43988590,43989033,43989862,43989464,43991632,43994379,43991958,43989416,43990883,43989296,43989110,43988980,43992034,43989382,43990185,43992435,43994344],"score":226,"text":"Hi HN! Erik here from Pig.dev, and today I&#x27;d like to share a new project we&#x27;ve just open sourced:<p>Muscle Mem is an SDK that records your agent&#x27;s tool-calling patterns as it solves tasks, and will deterministically replay those learned trajectories whenever the task is encountered again, falling back to agent mode if edge cases are detected. Like a JIT compiler, for behaviors.<p>At Pig, we built computer-use agents for automating legacy Windows applications (healthcare, lending, manufacturing, etc).<p>A recurring theme we ran into was that businesses <i>already</i> had RPA (pure-software scripts), and it worked for them in most cases. The pull to agents as an RPA alternative was <i>not</i> to have an infinitely flexible &quot;AI Employees&quot; as tech Twitter&#x2F;X may want you to think, but simply because their RPA breaks under occasional edge-cases and agents can gracefully handle those cases.<p>Using a pure-agent approach proved to be highly wasteful. Window&#x27;s accessibility APIs are poor, so you&#x27;re generally stuck using pure-vision agents, which can run around $40&#x2F;hr in token costs and take 5x longer than a human to perform a workflow. At this point, you&#x27;re better off hiring a human.<p>The goal of Muscle-Mem is to get LLMs out of the hot path of repetitive automations, intelligently swapping between script-based execution for repeat cases, and agent-based automations for discovery and self-healing.<p>While inspired by computer-use environments, Muscle Mem is designed to generalize to any automation performing discrete tasks in dynamic environments. It took a great deal of thought to figure out an API that generalizes, which I cover more deeply in this blog:\n<a href=\"https:&#x2F;&#x2F;erikdunteman.com&#x2F;blog&#x2F;muscle-mem&#x2F;\" rel=\"nofollow\">https:&#x2F;&#x2F;erikdunteman.com&#x2F;blog&#x2F;muscle-mem&#x2F;</a><p>Check out the repo, consider giving it a star, or dive deeper into the above blog. I look forward to your feedback!","time":1747251506,"title":"Show HN: Muscle-Mem, a behavior cache for AI agents","type":"story","url":"https://github.com/pig-dot-dev/muscle-mem"}