Designing lifecycle policies for AgentCore memory
aws ·
The article explains how to manage memory lifecycle for AI agents on Amazon Bedrock AgentCore to prevent outdated or redundant memories from degrading performance. It categorizes agent memory into episodic, semantic, and procedural types, each with different retention needs. The proposed solution runs a nightly workflow using AWS Step Functions and Amazon Bedrock, implementing three policies: TTL-based expiration for old records, a relevance decay scoring formula that considers recency, access frequency, and creation time, and LLM-based consolidation to merge related low-scoring memories into one fact. Access tracking is handled via AWS CloudTrail because AgentCore memory does not natively expose last-access timestamps. The article provides configurable parameters like pruneDays and weights, with recommended starting values for different agent archetypes. It also includes code examples and a GitHub repository for an AWS CDK implementation.
aws