Show HN: Muscle-Mem, a behavior cache for AI agents
Published on: 2025-07-09 20:38:26
Muscle Memory
muscle-mem is a behavior cache for AI agents.
It is a Python SDK that records your agent'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.
The goal of muscle-mem is to get LLMs out of the hotpath for repetitive tasks, increasing speed, reducing variability, and eliminating token costs for the many cases that could have just been a script.
It's unexplored territory, so all feedback is welcome!
Dev Log
May 7, 2025 - First working demo
May 8, 2025 - Open sourced
How It Works
muscle-mem is not another agent framework.
You implement your agent however you want, and then plug it into muscle-mem 's engine.
When given a task, the engine will:
determine if the environment has been seen before (cache-hit), or if it's new (cache-miss) using Checks perform the task, either using the retrieved trajectory on cache-hit,
or pas
... Read full article.