Step-by-step guide to building persistent memory for AI agents: storage strategies, ingestion pipelines, retrieval patterns, and the build vs. buy decision.