# How memory works (/docs/memory/how-memory-works)
Docklee Universal Memory sits between your app and your model. You send it plain text with `Dock`. It turns that text into organized, connected memories, keeps them current as facts change, and returns the right ones when you call `lynk.recall`.

Read this page before you design your captures. It explains why you can send raw text, and why recall still returns clean, current facts.

<FlowDiagram
  caption="A memory is organized when it's written and ranked when it's recalled. Both happen inside Docklee."
  stages={[
    { title: 'Capture', detail: 'Dock sends text to a memory space.' },
    { title: 'Organize', detail: 'Docklee titles, classifies, tags, and finds entities.' },
    { title: 'Connect', detail: 'Links the memory to related memories and settles conflicts.' },
    { title: 'Recall', detail: 'Lynk returns the most relevant, current memories.' },
  ]}
/>

## Without and with Docklee [#without-and-with-docklee]

| Without Docklee | With Docklee |
| --- | --- |
| You decide what's worth storing and write the parsing yourself. | You send raw text. Docklee classifies it and keeps what matters. |
| "Lives in Austin" and "Moved to Denver" both come back, and your model guesses. | The newer fact replaces the older one, and recall returns the current value. |
| Search finds similar words and nothing else. | Recall also follows people, time, and cause and effect. |
| Old details pile up until prompts overflow. | Old, low-value details are summarized. Important ones stay in full. |
| Deleting someone's data means writing a script. | One action erases every memory about a person or company. |

## What you send and what's stored [#what-you-send-and-whats-stored]

| You send | Docklee stores |
| --- | --- |
| `"Maya moved from Austin to Denver last month."` | A memory titled *Maya moved to Denver*, classified as an event, tagged, and linked to the person *maya* and the place *denver* |
| `"Maya prefers email over phone calls."` | A preference memory linked to *maya*, connected to the move above through the same person |
| `"Maya now prefers phone calls."` | A new preference that replaces the email preference. The old one is kept as history. |

## On write [#on-write]

1. **Admit.** Docklee checks whether the text holds a durable fact. Noise isn't stored, a repeat of a known fact strengthens the existing memory, and anything uncertain is kept and marked for review.
2. **Organize.** Docklee gives the memory a short title, a type such as fact, preference, event, or decision, up to five tags, and a list of the people, companies, products, and places it mentions.
3. **Record the source.** Each memory keeps a permanent record of where it came from, such as the SDK or the API, and that record can't be changed later.
4. **Connect.** The memory is linked to similar memories, to earlier and later memories about the same entities, and to memories it caused or was caused by. See [Entities and links](/docs/memory/intelligence/entities-and-links).
5. **Settle conflicts.** A clear update replaces the older fact. A real conflict keeps both and flags them for review. Matching facts from different sources raise each other's confidence. See [Contradictions and updates](/docs/memory/intelligence/contradictions-and-updates).

Organizing and connecting happen after the write is accepted, so `capture` never waits on them.

## On recall [#on-recall]

1. **Read the question.** A question about a person leans on that person's memories. "Before" and "after" lean on time. "Why" leans on cause and effect.
2. **Gather candidates.** Docklee searches by meaning and follows the links that fit the question.
3. **Rank.** Candidates are scored on relevance, whether they're still valid, confidence, how connected they are, and how recent they are. See [Ranking](/docs/memory/intelligence/ranking).
4. **Return.** `lynk.recall` returns the top memories, best first, each with a type and a confidence score.

## Where memories live [#where-memories-live]

| Memory | Lives in | Returned to |
| --- | --- | --- |
| Space-level memory | Its memory space | Any recall on that space |
| End user memory | Its memory space, encrypted for that end user | Recalls with the same `end_user` |
| A replaced fact | Its memory space, marked as superseded | The dashboard history, not recall's current view |
| A summarized group | One summary memory, with the originals kept for 30 days | Recall, as the summary |

## Build with this flow [#build-with-this-flow]

- Send whole sentences. Context such as "last month" or "for urgent issues" helps Docklee classify and connect the memory.
- Capture updates as new memories. Don't try to find and edit the old one yourself.
- Use one memory space per product or environment, and an `end_user` for every person.
- Recall with a natural question, not a keyword list.
- Check the **Review** tab in the dashboard for conflicts Docklee couldn't settle on its own.

## Next steps [#next-steps]

You know what happens inside Docklee. Start writing memories next.

<Cards>
  <Card title="Capture memory" href="/docs/memory/capture-memory" description="Every option for writing a memory." />
  <Card title="Recall memory" href="/docs/memory/recall-memory" description="Every option for reading memories back." />
  <Card title="Contradictions and updates" href="/docs/memory/intelligence/contradictions-and-updates" description="How a newer fact replaces an older one." />
</Cards>
