Skip to main content
Agent memory on Compose is a three-step loop that runs around every turn. It gives an agent relevant context before it responds, stores the conversation after it responds, and optionally extracts durable facts that survive across sessions.

The memory loop

  1. Before a turn — recall. Pull relevant context from past turns and stored facts, packed into a single prompt string you inject into the agent’s system prompt.
  2. After a turn — persist. Record the user message and assistant reply so the next recall has something to draw from.
  3. Optionally — remember facts. Extract durable facts (preferences, identities, long-lived state) that should outlive any single thread.
The full loop in one snippet:

Scope

Memory is scoped per agent + user pair. The same user talking to two different agents gets two separate memory stores. The threadId adds short-term isolation within that pair — working context and transcripts stay thread-local — while durable facts cross thread boundaries so the agent remembers stable information across sessions.

What’s available

Next