Letterbook Docs
Connect MongoDB
Let Letterbook reference customer and account data stored in MongoDB.
Last updated June 25, 2026
What this guide covers#
Connect MongoDB so Letterbook can reference customer and account records stored in collections.
MongoDB is useful when support answers depend on account state, usage, entitlements, feature flags, customer settings, or application-specific records stored in collections.
Setup steps#
- Create a read-only database user for support access.
- Allow Letterbook network access if your database requires an allowlist.
- Select the database and collections Letterbook can query.
- Map customer identifiers, such as email, user ID, account ID, or workspace ID.
- Exclude sensitive collections and fields that support does not need.
- Test lookups with real customer examples.
- Document what each exposed field means in the internal knowledge base.
Configuration details#
- Prefer read-only access.
- Use support-specific views or limited collections when possible.
- Avoid exposing secrets, credentials, authentication tokens, or raw private data.
- Confirm how nested documents appear to support and the AI.
- Review mappings after schema changes.
Identifier mapping#
Customer matching is the most important part of database setup. Decide which field Letterbook should use for each type of ticket:
- Email address for email-first support
- User ID for app-created tickets
- Account or workspace ID for team products
- Subscription or billing customer ID when billing systems reference a different identifier
If multiple identifiers exist, document which one is authoritative.
Testing checklist#
Test customers with:
- A normal active account
- Multiple workspaces or organizations
- A missing or changed email address
- A disabled or canceled account
- A record with nested fields the AI should interpret