where \(q\) is the query, for example, the task that the agent should address or the context in which the agent is situated. \(M\) is the set of all memories. \(s^{rec}(\cdot)\), \(s^{rel}(\cdot)\) and \(s^{imp}(\cdot)\) are the scoring functions for measuring the recency, relevance, and importance of the memory \(m\). These scoring functions can be implemented using various methods, for example, \(s^{rel}(q,m)\) can be realized based on LSH, ANNOY, HNSW, FAISS and so on. It should be noted that \(s^{imp}\) only reflects the characters of the memory itself, thus it is unrelated to the query \(q\). \(\alpha\), \(\beta\) and \(\gamma\) are balancing parameters. By assigning them with different values, one can obtain various memory reading strategies. For example, by setting \(\alpha=\gamma=0\), many studies [16, 30, 38, 42] only consider the relevance score \(s^{rel}\) for memory reading. By assigning \(\alpha=\beta=\gamma=1.0\), [20] equally weights all the above three metrics to extract information from memory.