# End users (/docs/docklee/end-users)
When one app serves many people, one person's memories must never show up in another person's replies. An `end_user` tag makes each memory belong to one person, and recall returns only that person's memories.

The value is an ID from your own system. Docklee doesn't create accounts for your end users and doesn't need to know who they are.

<Callout type="info" title="Pass an end user when...">
- Your app has signed-in users, customers, or players.
- A memory describes one person, not the whole product.
</Callout>

## Write and recall for one user [#write-and-recall-for-one-user]

<CodeTabs>
  <Tab value="Python">
    ```python
    from docklee import Dock, Lynk

    dock = Dock()
    dock.capture("Prefers dark mode.", type="preference", end_user="user_8f2c")
    dock.flush_sync()

    records = Lynk().recall_sync("display preferences", end_user="user_8f2c")
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    import { Dock, Lynk } from 'docklee';

    const dock = new Dock();
    dock.capture('Prefers dark mode.', { type: 'preference', endUser: 'user_8f2c' });
    await dock.close();

    const records = await new Lynk().recall('display preferences', { endUser: 'user_8f2c' });
    ```
  </Tab>
  <Tab value="cURL">
    ```bash
    curl https://api.docklee.com/v1/dum/search \
      -H "Authorization: Bearer $DOCKLEE_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "memory_space_id": "your-memory-space-id",
        "query": "display preferences",
        "top_k": 5,
        "end_user": "user_8f2c"
      }'
    ```
  </Tab>
</CodeTabs>

## How isolation works [#how-isolation-works]

1. **Separate encryption.** Each end user's memories are encrypted with a key that belongs to that end user alone.
2. **A one-way switch.** The first end user memory makes the space multi-user for good. Every write and every recall must then name an end user.
3. **Fail closed.** A recall in a multi-user space with no end user returns nothing, so a missing ID can never expose someone else's data.

## Set a default user [#set-a-default-user]

When one `Dock` or `Lynk` instance serves one user, set the user once:

<CodeTabs items={['Python', 'TypeScript']}>
  <Tab value="Python">
    ```python
    dock = Dock(end_user="user_8f2c")
    lynk = Lynk(end_user="user_8f2c")
    ```
  </Tab>
  <Tab value="TypeScript">
    ```ts
    const dock = new Dock({ endUser: 'user_8f2c' });
    const lynk = new Lynk({ endUser: 'user_8f2c' });
    ```
  </Tab>
</CodeTabs>

You can also set `DOCKLEE_END_USER`. A value passed to one call overrides the default for that call only.

<Callout type="warn">
In a server that handles many users at once, pass `end_user` on every call instead of setting a default. A shared default can attach one request's memories to another request's user.
</Callout>

## Choose a good ID [#choose-a-good-id]

- Use a stable, opaque ID from your own system, such as a database key.
- Don't use email addresses, phone numbers, or names. They're personal data, and they change.
- Use the same ID for a person on every write and recall. A different ID is a different end user.

## Next steps [#next-steps]

Each user's memories are now private. Learn what Docklee does with them next.

<Cards>
  <Card title="How memory works" href="/docs/memory/how-memory-works" description="Classification, links, and conflict handling." />
  <Card title="Recall memory" href="/docs/memory/recall-memory" description="Every option for reading memories back." />
  <Card title="Deleting a person's data" href="/docs/memory/governance/entity-deletion" description="Erase every memory about one person or company." />
</Cards>
