Skip to Content

Core Concepts

End users

Keep each of your users' memories private inside one memory space.

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.

Pass an end user when...

  • Your app has signed-in users, customers, or players.
  • A memory describes one person, not the whole product.

Write and recall for one user

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")

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

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

dock = Dock(end_user="user_8f2c")
lynk = Lynk(end_user="user_8f2c")

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

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.

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

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

On this page