R3: Intelligent Memory & Caching for AI Applications