Skip to content

Commit

Permalink
cleanup: update multi tenecy docs to represent recommended practices
Browse files Browse the repository at this point in the history
  • Loading branch information
densumesh authored and skeptrunedev committed Jan 15, 2025
1 parent 338cf59 commit df94b0d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 108 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
title: "Creating Organizations and Datasets with Trieve"
description: "Learn how to create and manage organizations and datasets with Trieve"
title: "Multi-tenant applications with Trieve"
description: "Learn how to structure your data for multi-tenant applications with Trieve"
icon: "users"
iconType: "regular"
---

## Overview

We provide the ability to create and independently manage organizations and datasets for multi-tenant use cases. With Trieve, you have full control of each organization's users, configurations, and datasets.
We provide the ability to create and independently manage organizations and datasets for multi-tenant use cases. With Trieve, you have full control of each organization's users, configurations, and datasets. However, we recommend that users only have 1 organization and create seperate datasets for each tenant, as this reduces complexity.

## Creating an Organization

The main route we use to expose this functionality is the [create organization route](/api-reference/organization/create-organization). Use the `name` parameter to pass a arbitrary, unique name which will be used to identify the organization.
The main route we use to expose this functionality is the [create organization route](/api-reference/organization/create-organization). Use the `name` parameter to pass a arbitrary, unique name which will be used to identify the organization. We recommend that you create seperate organizations for your main application as well as a staging environment for testing.

Example of creating an organization on demand through the API:

Expand All @@ -28,14 +28,14 @@ curl --request PUT \

## Creating a Dataset

To create a dataset, use the [create dataset route](/api-reference/dataset/create-dataset).
To create a dataset, use the [create dataset route](/api-reference/dataset/create-dataset). These datasets are kept isolated from each other and can be configured independently, making them perfect to represent each tenant within your application. Each dataset can have its own configurations, tags, and crawl options.

### Important parameters

- `crawl_options`: Provides the options to setup crawling to populate your dataset (e.g., include/exclude paths, tags, and more).
- `dataset_name`: The name of the dataset. This must be a unique within the organization.
- `server_configuration`: Provide the server configuration for the dataset such as RAG and system prompt, stop tokens, embedding models, and more.
- `tracking_id`: A unique, optional tracking ID for the dataset that can be used to track the dataset in external systems.
- `tracking_id`: A unique, optional tracking ID for the dataset that reflects the id of the tenant within your system. You can use this tracking id in the `TR-Dataset` header to specify the dataset for the request rather than the dataset id.

Example of creating a dataset through the API:

Expand All @@ -62,22 +62,9 @@ curl --request POST \
}'
```

## Managing multiple organizations

Trieve provides a solution for multi-tenanted environments, allowing users to manage and operate across multiple organizations. Each organization can have its own datasets, configurations, and users.

To access different organizations, use the `TR-Organization` header. For example, to fetch the details of a specific organization, you can do:

```json
curl --request GET \
--url https://api.trieve.ai/api/organization/{organization_id} \
--header 'Authorization: <api-key>' \
--header 'TR-Organization: <tr-organization>' // The id of the organization you want to fetch
```

## Update configuration across datasets

To update all dataset configs in an organization, use the [update all dataset configurations route](/api-reference/organization/update-all-dataset-configurations). Use the `server_configuration` parameter to pass in a new configuration for all datasets in the organization.
You can also manage all of your dataset configurations at once using the the [update all dataset configurations route](/api-reference/organization/update-all-dataset-configurations). Use the `server_configuration` parameter to pass in a new configuration for all datasets in the organization.

Example of updating all dataset configurations in an organization:

Expand Down
23 changes: 6 additions & 17 deletions mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,7 @@
},
{
"group": "Plugins",
"pages": [
"site-search/plugin-docusarus"
]
"pages": ["site-search/plugin-docusarus"]
},
{
"group": "Guides",
Expand All @@ -118,7 +116,7 @@
"guides/recommending-with-trieve",
"guides/RAG-with-trieve",
"guides/analytics-quickstart",
"guides/create-organizations-and-dataset",
"guides/multi-tenency",
"guides/group-with-trieve",
"guides/using-exposed-api-keys",
"vector-inference/rerank",
Expand All @@ -140,10 +138,7 @@
},
{
"group": "Examples",
"pages": [
"examples/job-board",
"examples/ecommerce"
]
"pages": ["examples/job-board", "examples/ecommerce"]
},
{
"group": "Chunk",
Expand Down Expand Up @@ -272,9 +267,7 @@
},
{
"group": "User",
"pages": [
"api-reference/user/update-user-org-role"
]
"pages": ["api-reference/user/update-user-org-role"]
},
{
"group": "Auth",
Expand All @@ -287,9 +280,7 @@
},
{
"group": "Health",
"pages": [
"api-reference/health/health-check"
]
"pages": ["api-reference/health/health-check"]
},
{
"group": "Invitation",
Expand All @@ -312,9 +303,7 @@
},
{
"group": "Metrics",
"pages": [
"api-reference/metrics/get-prometheus-metrics"
]
"pages": ["api-reference/metrics/get-prometheus-metrics"]
}
],
"footerSocials": {
Expand Down
71 changes: 0 additions & 71 deletions test.js

This file was deleted.

0 comments on commit df94b0d

Please sign in to comment.