Skip to main content
After the agent finishes responding, persist the turn so the next recall can draw on it. This stores the transcript, updates working memory, and indexes the turn for semantic retrieval. Fact extraction is queued separately and shows up in later recall calls.

Record a turn

Parameters

Fire-and-forget

recordTurn() never blocks the agent response. Call it after you’ve already streamed the reply to your user — the storage work happens asynchronously. If it fails, the agent’s answer is unaffected; you simply lose this turn’s contribution to future recall.

When to call it

Call it once per turn, after the stream completes. If you skip persistence, the agent still responds normally, but recall on the next turn won’t include this exchange. For long-running agents, persisting every turn is what creates the feeling of a continuous conversation.
  • Recall — read context back before the next turn
  • Facts — extract durable facts that outlive the thread
  • Memory — the full three-step loop