How AI Memory Systems Work: Context Windows, RAG, and Vector Databases