Show HN: Muscle-Mem, a behavior cache for AI agents
a year ago
- #AI agents
- #tool-caching
- #Python SDK
- Muscle-mem is a Python SDK for AI agents that records and replays tool-calling patterns to solve tasks deterministically.
- It aims to reduce LLM usage for repetitive tasks, improving speed, reducing variability, and cutting token costs.
- Muscle-mem is not an agent framework but a tool to integrate with existing agents for safe tool reuse.
- The system uses Checks for cache validation to determine if an environment is safe for action.
- A demo and open-source release are planned for May 7 and 8, 2025, respectively.
- The SDK includes an Engine class to manage task execution and cache, and a @engine.tool decorator to record tool invocations.
- Checks are used to validate cache hits by capturing and comparing environment features before or after tool calls.
- An example demonstrates using timestamps and a one-second expiration for cache validation with the hello tool.
- Feedback is encouraged via the Muscle Mem Discord and GitHub repository.