Hi Convex team,
I'm implementing a multi-tenant application with the Convex Agent component where:
- Each tenant represents an organization with multiple users
- Users have different roles and permissions within the organization
- We need agents to access context across users within the same organization
I've explored using tenant-prefixed userIds (like account:${accountId}:user:${userId}) which works well for tenant isolation, but I noticed a limitation: when searchOtherThreads is enabled, it only searches for the exact prefixed userId and not other users in the same organization.
Questions:
- What's the recommended approach for sharing context across users within the same organization while maintaining tenant isolation?
- Is there a built-in way to implement organization-wide knowledge bases that all users within a tenant can access?
- Are there any plans to enhance the Agent component with more flexible context retrieval options, such as custom filters for userId patterns?
I've considered workarounds like:
- Creating shared organization threads with special userIds (like
account:${accountId}:shared:kb) - Implementing custom context fetching to query across multiple users
- Using threadId-based lookups more extensively
Would love to hear the team's recommendations on the best approach that maintains clean tenant isolation without sacrificing cross-user context.
Thanks!
Tagging @thick sigil