> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/database/link-chatbots-groups.md).

# AI アシスタントとグループ権限の関連付け

データベースを作成しデータテーブルを設定したら、データベースを**AIアシスタントに関連付ける**必要があります。これにより、AIアシスタントが Text to SQL 機能を使ってデータを照会できるようになります。

## AIアシスタントの関連付け <a href="#link-ai-agent" id="link-ai-agent"></a>

### 操作手順 <a href="#steps" id="steps"></a>

1. データベース設定ページに入り、「<mark style="color:blue;">AIアシスタントの関連付け</mark>」タブに切り替えます
2. ページ左側に選択可能なAIアシスタント、右側に関連付け済みのAIアシスタントが表示されます
3. 左側から関連付けたいAIアシスタントを選択し、矢印ボタンをクリックして右側へ移動します
4. 完了したら「<mark style="color:blue;">保存</mark>」をクリックします

<figure><img src="/files/YfuWcPuKtzdEzYkaf4ph" alt="AIアシスタントの関連付け"><figcaption><p>AIアシスタントの関連付けタブ：左側は選択可能なアシスタント、右側は関連付け済みのアシスタント</p></figcaption></figure>

{% hint style="info" %}
検索欄を使って特定のAIアシスタントをすばやく見つけることができます。AIアシスタントの数が多い場合、リストはページ分割して表示されます。
{% endhint %}

{% hint style="warning" %}
AIアシスタントの回答モードが **Agent モード**に切り替わっていることを必ず確認してください。そうでない場合、Text to SQL 機能を使用できません。

回答モードの詳細については、以下を参照してください：[AIアシスタントの作成](/maiagent-user-guide/maiagent-user-guide-ja/build/setup.md)
{% endhint %}

### 複数データベースの照会 <a href="#multi-database-query" id="multi-database-query"></a>

1つのAIアシスタントは複数のデータベースを関連付けることができます。ユーザーが質問すると、AIアシスタントは質問内容に応じて、どのデータベースを照会すべきかを自動的に判断します：

```
ユーザー：「先月の売上はいくらですか？」
→ AIアシスタントが自動的に「売上データベース」を照会

ユーザー：「マーケティング部には現在何人の従業員がいますか？」
→ AIアシスタントが自動的に「人事データベース」を照会
```

{% hint style="info" %}
AIアシスタントが異なるデータベースを正確に区別できるよう、各データベースには用途が明確にわかる名称を付け、詳細な説明とフィールドの説明を記入することをおすすめします。
{% endhint %}

## グループ権限の管理 <a href="#group-permission-management" id="group-permission-management"></a>

グループ権限を使うと、組織内の異なるチームがデータベースにアクセスできる範囲を制御でき、各チームが自分に関連するデータベースのみを見られるようにできます。

### グループ権限の設定 <a href="#configure-group-permission" id="configure-group-permission"></a>

1. データベース設定ページに入り、「<mark style="color:blue;">グループ権限</mark>」タブに切り替えます
2. シャトルコンポーネントを使って、権限を付与したいグループを左側から右側へ移動します
3. 完了したら「<mark style="color:blue;">保存</mark>」をクリックします

{% hint style="info" %}
グループ権限と「AIアシスタントの関連付け」は独立した設定です。データベースがあるAIアシスタントに関連付けられていても、ユーザーが所属するグループにそのデータベースへのアクセス権限がなければ、ユーザーは依然としてそのデータベースを照会できません。
{% endhint %}

### 権限の階層 <a href="#permission-levels" id="permission-levels"></a>

データベースへのアクセス権限は、以下の条件によって総合的に決まります：

```
ユーザーはAIアシスタントを通じてデータベースを照会できるか？

✅ データベースが有効化されている
  └── ✅ データベースがそのAIアシスタントに関連付けられている
       └── ✅ ユーザーが所属するグループがそのデータベースへのアクセス権限を持っている
            └── ✅ 照会可能
```

* **データベースの所有者**（作成者）は、自分が作成したすべてのデータベースにアクセスでき、グループ権限の制限を受けません
* **所有者以外**は、グループ権限を通じてのみデータベースにアクセスできます


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-ja/database/link-chatbots-groups.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
