muscle mem
Basic Information
muscle-mem is a Python SDK that provides a behavior cache for AI agents by recording and deterministically replaying sequences of tool calls when tasks repeat. It wraps an existing agent with an Engine that intercepts tool invocations, stores trajectories into a cache, and replays them on cache hits while falling back to the original agent on cache misses or invalid cases. The project is intended for developers who implement agents in any style and want to avoid unnecessary LLM calls for repetitive work, improving speed, consistency, and reducing token costs. The README emphasizes cache validation via Check objects, instrumentation of tools using decorators, optional context injection for stateful objects, a top-level parameter system for dynamic arguments, and that the API is v0 and installable via pip.