A PR-review agent needs to track which files it has already reviewed within a single PR session, and also needs to recall recurring code quality patterns observed across hundreds of previous PRs to improve future reviews. Which combination of memory types is most appropriate?
Select an answer to reveal the explanation.
Short Explanation
It's like using a scratch pad for today's to-do list and a notebook for lessons learned over your career. You match memory type to data lifetime: session-specific tracking goes to task-scoped memory, and cross-session knowledge goes to durable long-term storage.
Full Explanation
This question tests the ability to match memory type to data lifecycle. The reviewed-file list is purely session-scoped: it is only relevant during the current PR review and should be discarded afterward. Task-scoped (ephemeral) memory is correct for this because it's fast, cheap, and automatically cleaned up. The cross-PR quality patterns, however, must persist across many sessions and grow richer over time, making durable long-term storage the right fit. The correct combination applies this two-tier approach: task-scoped memory for the current session's reviewed-file tracking, and durable long-term memory for cross-PR quality patterns. On the exam, match memory type to data lifetime: session-specific tracking goes to task-scoped memory, and cross-session knowledge goes to durable long-term storage.
Using semantic search memory for both is incorrect because a vector store excels at semantic similarity search over unstructured text, but tracking which files the agent has already reviewed in this session is a simple set-membership check, not a semantic retrieval problem. Using vector embeddings for a within-session checklist is over-engineered and adds unnecessary latency and cost.
Using a relational database for both is incorrect because a relational database is a durable store, not an ephemeral one. Using it for session-scoped reviewed-file tracking means the agent must explicitly clean up records after each PR, which adds complexity. While it could work for long-term patterns, it does not address the session-scoped requirement efficiently.
Using in-context memory for both is incorrect because in-context memory, meaning the model's context window, is the most ephemeral memory type. It is lost when the session ends, making it unsuitable for cross-PR pattern retention. It also has strict size limits that would be exceeded when accumulating patterns across hundreds of previous PRs.