Continuity preserves relevant state and information across interaction turns, sessions, or workflow steps, making it available to the right actor at the right time. Without it, each step must reconstruct prior understanding, and later decisions can contradict earlier ones. section 11.2 section 1.4
In an agentic software lifecycle, continuity connects requirements to planning, plans to implementation, tests and review comments to corrections, and deployment or incident signals to future changes. The recipient may be a developer, an agent, or a coordinated group of agents. section 11.2
Keeping a travel plan coherent
A travel agent carries the selected flight, budget, preferred neighborhood, and refundable-accommodation requirement into hotel comparison and itinerary planning. These preserved decisions constrain later choices rather than forcing the user to repeat them. section 1.4
Memory supports continuity at different timescales:
- Across turns, a session can retain the last N user turns verbatim and prepend a running summary of older interactions. A curation policy decides what survives for the next agent run. section 5.5.3
- Across coding sessions, curated project memory can retain build commands, repository conventions, architecture decisions, recurring failures, and deployment lessons. It should not become a transcript of every session; exclude temporary errors, secrets, personal data, and unverified guesses. section 11.3.5
Table 11.4 Memory options for coding agents
| Memory path | Typical use | Main tradeoff |
Built-in agent memory |
Tool-native mechanisms, such as Claude Code auto memory or GitHub Copilot Memory, store repository-specific lessons and preferences. |
Convenient and integrated, but tied to the agent’s storage, retrieval, and governance model. |
General memory layer |
Tools such as mem0, MemPalace, and OpenViking persist team preferences, service relationships, debugging patterns, and cross-project conventions. See Appendix A.10. |
More portable across agents, but adds another operational component to secure, audit, and maintain. |
Coding-agent-specific memory tools |
Tools such as Agent Memory[11], Supermemory[12], and Cursor Memory Bank[13] preserve coding session state and development notes. |
Tuned for software workflows, but each tool has its own storage format, recall behavior, and setup model. |
Compare built-in, general-purpose, and coding-specific memory options, including their integration and operational trade-offs. section 11.3.5
Listing 5.4 Illustrative Python excerpt showing a custom session that curates short-term memory before each agent run
from agents import Agent, Runner
from agents.memory.session import SessionABC
from collections import deque
from typing import List
class SummarizingSession(SessionABC): #1
def _materialize(self):
trimmed = self._trim_to_last_turns(list(self._items)) #2
if self._summary:
summary_msg = { #3
"type": "message",
"role": "assistant",
"content": f"Running summary:\n{self._summary}",
}
return [summary_msg] + trimmed
return trimmed
async def _refresh_summary_locked(self): #4
prompt = f"Update the summary with older history:\n{drop_text}"
result = await Runner.run(summarizer, prompt)
self._summary = (result.final_output or "").strip()
agent = Agent(name="Support", model="gpt-5",
instructions="Troubleshoot step-by-step.")
session = SummarizingSession("support_demo", max_turns=6) #5
result = await Runner.run(agent, user_input, session=session) #6
Inspect an illustrative OpenAI Agents SDK session that materializes recent turns with a running summary. section 5.5.3
