3. Retrieve only the most relevant past messages
Retrieval is often better than brute-force memory. Instead of sending every old message back into the prompt, search the conversation history for the most relevant snippets. This works well when the system can rank past turns by topic, recency, and importance.