> 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/agent-builder/agent.md).

# Agent（AI アシスタント）

<figure><img src="/files/dndvJhHF7FIJC6BdNi8T" alt="Agent のコアコンセプト"><figcaption><p>Agent の中核となる動作フロー：LLM 駆動 × 役割指示 × 記憶</p></figcaption></figure>

## これは何ですか？ <a href="#what-is-this" id="what-is-this"></a>

Agent とは、MaiAgent 上で作成する AI 対話キャラクターです。それぞれの Agent は独立した対話ボットであり、固有のアイデンティティ、個性、知識、能力を備えています。

Agent は新しく入社した従業員のようなものだとお考えください。次のことを伝える必要があります。

* **あなたは誰か**（役割指示 / System Prompt）
* **あなたは何を知っているか**（ナレッジベース、データベース）
* **あなたは何ができるか**（ツール、スキル）

設定が完了すると、Agent はさまざまな対話プラットフォーム上でユーザーにサービスを提供できるようになります。

## コアコンセプト <a href="#core-concepts" id="core-concepts"></a>

### 言語モデル（LLM） <a href="#language-model-llm" id="language-model-llm"></a>

Agent の理解力と応答能力は、その背後にある大規模言語モデル（LLM）から生まれます。LLM は Agent の「頭脳」のようなものだとお考えください。モデルによって、理解力、応答品質、速度、コストにそれぞれ違いがあります。

Agent を作成する際には、利用シーンに適したモデルを選択できます。MaiAgent は Claude や GPT などさまざまなモデルに対応しており、ご自身でモデルを管理する必要はなく、プラットフォームが処理いたします。

> **簡単な判断基準**：正確な応答や複雑な推論が必要な場合 → より高性能なモデルを選択。高頻度のシンプルな問い合わせやコストを抑えたい場合 → より高速で軽量なモデルを選択。

### 役割指示（System Prompt） <a href="#system-prompt" id="system-prompt"></a>

役割指示は、Agent の振る舞い方を決定します。例えば次のとおりです。

* 「あなたは親切なカスタマーサポート担当者です。日本語で応答し、プロフェッショナルでありながら堅苦しくない口調で対応してください。」
* 「あなたは財務分析アシスタントです。財務に関連する質問にのみ回答し、不確実なデータに遭遇した場合は明確にその旨を伝えてください。」

優れた役割指示は、Agent の応答品質を大幅に向上させます。

### 応答モード <a href="#response-mode" id="response-mode"></a>

MaiAgent は 2 種類の応答モードを提供しています。

* **Chat モード**：一般的な問い合わせに適しており、ナレッジベースの内容を使って直接応答します
* **Agent モード**：複数ステップの推論が必要なシーンに適しており、Agent がどのデータを調べ、どのツールを使うかを自ら判断します

### 記憶 <a href="#memory" id="memory"></a>

Agent は記憶能力を備えています。

* **対話記憶**：同一の対話セッション内で、前に話した内容を記憶します
* **長期記憶**：対話をまたいで重要な情報を記憶するため、毎回改めて説明する必要がありません

> **応用説明**：記憶機能により、Agent は複数ターンの対話においてコンテキストの一貫性を保ち、ベクトル検索を通じて過去の対話内容を思い出すことができます。関連するパラメータは、Agent 設定の「記憶設定」で調整できます。

## 何をすればよいですか？ <a href="#what-do-i-need-to-do" id="what-do-i-need-to-do"></a>

1. **Agent を作成する** — 名前を付け、言語モデルを選択する
2. **役割指示を書く** — Agent の役割と応答スタイルを定義する
3. **能力を付与する** — ナレッジベース、ツール、スキルを連携する（必要に応じて）
4. **対話をテストする** — 内蔵のチャットウィンドウで効果をテストする
5. **プラットフォームと連携して公開する** — Web Chat、LINE などの対話プラットフォームにデプロイする

## 関連記事 <a href="#further-reading" id="further-reading"></a>

* [AI アシスタントの機能](/maiagent-user-guide/maiagent-user-guide-ja/build/explain.md)
* [AI アシスタントを作成する](/maiagent-user-guide/maiagent-user-guide-ja/build/setup.md)
* [役割指示の設計ガイド](/maiagent-user-guide/maiagent-user-guide-ja/build/system-prompt.md)
* [AI アシスタントに役割指示を追加する](/maiagent-user-guide/maiagent-user-guide-ja/build/add-system-prompt.md)


---

# 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/agent-builder/agent.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.
