In multi-process or distributed environments, AgentGuard enables cross-process cost tracking and budget sharing through Redis. Users need to configure the Redis URL during initialization, for example:redis: 'redis://localhost:6379'
. When enabled, all processes connected to the same Redis instance will share the total budget, avoiding situations where a single process overspends and the others are unable to sense it.
Redis is an optional configuration item and is only required in multi-process environments. For standalone development or single-process projects, there is no need to configure Redis; AgentGuard tracks costs in local memory by default.
This answer comes from the articleAgentGuard: A Tool for Monitoring AI Agent Costs in Real Time and Preventing OverspendingThe