Memory Operations and Credits

GrayMatter operational discipline is simple: quality first, then spend.
Core signals
- Context utilization (
usedPct) - Waste (
wastePct) - Memory hit rate (
hitRate) - Cost metrics (
burnRate, retrieval/write/assembly cost)
Action ladder
- Compact when waste rises and hit rate is flat.
- Reindex when retrieval quality declines despite healthy context headroom.
- Prune when stale memory dominates active relevance.
- Expand only when productive context demand is sustained.
Economic control
- Track ledger balance on
/credits/:accountId?. - Use
/buy-creditsbefore high-throughput operations. - Keep external integrations idempotent for payment/usage writes.