When the same person uses your agent on both Telegram and Discord, they appear as two different users with separate memory stores. Identity resolution merges these into a single canonical identity, so the agent remembers context across platforms.Documentation Index
Fetch the complete documentation index at: https://docs.definable.ai/llms.txt
Use this file to discover all available pages before exploring further.
How It Works
TheIdentityResolver maps (platform, platform_user_id) pairs to a single canonical_user_id. This canonical ID is then used for memory scoping, so all platforms share the same memory store.
Quick Example
IdentityResolver Protocol
Any identity resolver must implement:| Method | Description |
|---|---|
await initialize() | Set up the resolver (create tables, connect) |
await close() | Clean up resources |
await resolve(platform, platform_user_id) | Get the canonical user ID, or None if not linked |
await link(platform, platform_user_id, canonical_user_id, username=None) | Create or update a link |
await unlink(platform, platform_user_id) | Remove a link. Returns True if a link was removed |
await get_identities(canonical_user_id) | Get all platform identities for a canonical user |
SQLiteIdentityResolver
The built-in implementation uses SQLite for persistence:Path to the SQLite database file. Created automatically.
PlatformIdentity
Theget_identities() method returns PlatformIdentity objects:
| Field | Type | Description |
|---|---|---|
platform | str | Platform name (e.g., "telegram", "discord") |
platform_user_id | str | User ID on that platform |
canonical_user_id | str | The shared canonical ID |
username | str | None | Optional display name |
linked_at | float | Unix timestamp of when the link was created |
Integration with BaseInterface
Passidentity_resolver when creating any interface:
resolver.resolve(platform, platform_user_id) before creating the agent session. If a canonical ID is found, it’s used as the user_id for memory and session scoping.
Integration with serve()
When usingserve() for multi-interface deployments, pass the resolver once and it propagates to all interfaces: