Memory

Entry Weight Decay

Open Astra runs a scheduled job at 4:15 AM daily that decays the weight of older daily memory entries. Entries that fall below a weight of 0.2 are filtered from context assembly, keeping the agent's working memory fresh and relevant.

Schedule

The job runs on the cron schedule 15 4 * * *. It targets daily memory entries older than 7 days.

Decay Algorithm

sql
-- Applied to entries older than 7 days
CASE
  WHEN weight IS NULL
    THEN GREATEST(0.0, 1.0 - (CURRENT_DATE - date - 7) * 0.12)
  ELSE
    GREATEST(0.0, weight - 0.12)
END

Parameters

ParameterValueDescription
Cron schedule15 4 * * *4:15 AM every day
Grace period7 daysEntries newer than this are untouched
Decay rate0.12 per dayApplied daily beyond the grace period
Filter threshold0.2Entries below this weight are excluded from context
Initial weight1.0Default for new entries

Entry Weight Field

Each DailyMemoryEntry carries an optional weight field (default 1.0). You can inspect or set it directly:

json
{
  "timestamp": 1708881234000,
  "category": "decision",
  "content": "Decided to use pgvector for semantic search",
  "weight": 0.88
}

Weight decay is one-directional — entries only lose weight over time. To permanently preserve an important entry, pin it via the knowledge graph instead of relying on daily memory.