Once every memory has a score, the agent takes the top few for the current decision. Those memories are placed in the prompt, so only the most useful ones use the context window.
Implement top_k_memories(memories, k), returning the k best memory names.
Sort the pairs by score descending, then take the names of the first k.
No results yet
Run your code to check it against the examples, or submit to run every test.