Learn how to use Operand to build multi-tenant applications, i.e. a per-user index of knowledge. Keep data logically seperated, to ensure users are only seeing knowledge belonging to them.
Operand supports two modes of multi-tenancy. Each has its own tradeoffs, and you should choose the one that best fits your use case.
Per-User or Per-Entity Collection
This method is best suited for applications where each user or entity in your application will index a small amount of data. In this scheme, your application will use one Operand index, which will contain many collections (folders). Filters can be used to ensure that each user only sees data belonging to them.
For example, in a writing app, each user may choose to index a few documents that they're actively pulling knowledge from while writing. In this case, you can create a collection (i.e. folder) on a per-document basis and index any knowledge you want to pull from directly into that collection.
In general, this should be used for demos, or for applications where you don't expect users to index a large amount of data. As a rule of thumb, a per-user index is likely a better option for production applications (see below).
When each user has a perhaps large amount of data they'd like to index, it's recommended to use a per-user index. This has a number of benefits over a per-user collection:
- Guarentees that each user will only see data belonging to them.
- Faster retrieval performance on larger knowledge bases.
- Easier to manage and scale.
If you're building a production-grade application, this is the recommended approach.
Please reach out if you have any questions or need any help setting this up.