---
updatedAt: 2026-06-10T06:51:58.000Z
agentTools:
  projectIndex: https://docs.d-id.com/llms.txt
---

# Overview

How agents remember end-user preferences and facts across conversations

Memories let a Realtime agent carry forward small, durable facts about each end-user — preferences, goals, constraints — from one conversation to the next. After a chat ends, an LLM extracts relevant information and stores it. The next time that user starts a session, the agent is primed with their context.

## How It Works

```mermaid
---
config:
  theme: redux
  look: neo
---
flowchart LR
CE([fa:fa-comment Chat ends]) --> Q([fa:fa-bolt Extract])
    Q --> M([fa:fa-database Memory])
    M --> R([fa:fa-up-down Rerank])
    R --> NS([fa:fa-thought-bubble Next session])
```

Extraction is async — it runs after the session closes and has no impact on latency. The extracted facts are injected into the agent's system prompt at the start of the next session.

## Key Concepts

<Cards>
  <Card title="Scope" icon="fa-users">
    `user` (default): one memory per end-user, shared across all agents. `agent`: one memory per end-user × agent pair.
  </Card>

  <Card title="Storage" icon="fa-database">
    Up to 10 items per user, each up to 150 characters. Auto-deleted after 90 days of inactivity.
  </Card>

  <Card title="Extraction" icon="fa-filter">
    Runs async after chat ends. Only durable facts are stored — preferences, goals, constraints. Requires at least 4 messages.
  </Card>

  <Card title="Reranking" icon="fa-arrow-up-wide-short">
    When the 10-item limit is hit, items are evicted by priority and recency. High-priority, recently updated facts survive longest.
  </Card>
</Cards>

## Next Steps

Ready to try it? Follow the [Quickstart](memories-quickstart) to enable memory on an agent.

## FAQ

<CoolAccordionBox>
  <CoolAccordion title="When does extraction run?">
    <p>After the chat session ends, not during it. The extractor runs asynchronously and has no impact on session latency.</p>
  </CoolAccordion>

  <CoolAccordion title="What kinds of facts get stored?">
    <p>Standing preferences ("User prefers morning meetings"), goals ("User is training for a half-marathon in May"), and long-running context ("User does not want diet advice"). One-off requests, already-resolved topics, and assistant behavior are not stored.</p>
  </CoolAccordion>

  <CoolAccordion title="What is the difference between user and agent scope?">
    <p>`user` scope (default): one memory document per end-user, shared across all agents. `agent` scope: one memory document per end-user × agent pair, isolated to that specific agent.</p>
  </CoolAccordion>

  <CoolAccordion title="How long is memory stored?">
    <p>Memory items expire after 90 days of inactivity and are then automatically deleted.</p>
  </CoolAccordion>

  <CoolAccordion title="What is the difference between Knowledge and Memories?">
    <p>Knowledge is a static document store that the agent retrieves via RAG to answer questions. Memories are dynamic and user-specific — the agent automatically extracts and stores facts about each individual end-user over time. Use Knowledge for shared reference content; use Memories for per-user context that evolves across conversations.</p>
  </CoolAccordion>
</CoolAccordionBox>

<br />