> For the complete documentation index, see [llms.txt](https://docs.allganize.ai/alli-llm-app-market/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.allganize.ai/alli-llm-app-market/first/start-guide/hands-on-a-rag-app.md).

# 4. 【ハンズオンA】RAG型アプリを作る

3章で登録したドキュメント・Q\&Aを根拠に回答する、**初めてのRAG型アプリを30分で作成します**。

## 4-1. この章で作成するアプリ <a href="#app-to-build" id="app-to-build"></a>

**「アップロードしたドキュメントについて、質問を入力すると回答する会話型アプリ」**&#x3092;作成します。\
例：「就業規則について回答するQ\&Aアプリ」

{% hint style="success" %}
アプリの設計に迷ったら：アプリマーケットの [**ドキュメントから回答自動生成**](https://docs.allganize.ai/alli-llm-app-market/app-market) デフォルトアプリが、同様のRAG型アプリのテンプレートです。フローや設定の参考にできます。
{% endhint %}

{% stepper %}
{% step %}

### 会話型アプリを新規作成 <a href="#create-new-app" id="create-new-app"></a>

1. 左メニューから **「アプリ管理」** を開く
2. **\[+新しいアプリを作成]** をクリック
3. **\[会話型アプリを作成]** を選択

<figure><img src="/files/dl8s0iEoHSdw4h6KjhKC" alt=""><figcaption></figcaption></figure>

4. アプリ名を入力（例：`就業規則QA_スタートガイド検証`）\
   ※アプリ名入力後は、キーボードで\[Enter]ボタンを押すとアプリ名が保存されます

<figure><img src="/files/Mpzxkxa069vL4YQiJc98" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 回答生成ノードを配置 <a href="#place-answer-node" id="place-answer-node"></a>

1. チャットフロー編集画面の上部パネルから **「回答生成ノード」** を選択
2. **Startノード → 回答生成ノード** の順に線でつなぐ

<figure><img src="/files/VQG3nnYOm772Jotw1NuP" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 回答生成ノードを設定 <a href="#configure-answer-node" id="configure-answer-node"></a>

回答生成ノードの編集ボタン（鉛筆マーク）をクリックして設定画面を開き、以下を入力します。最初は**最小設定**で進めましょう。

<figure><img src="/files/m8BAildL6nF0itXZjynF" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="156.407470703125">設定項目</th><th width="280.11114501953125">設定例</th><th>補足</th></tr></thead><tbody><tr><td>質問の入力方式</td><td>メンバー入力</td><td>回答生成ノード上でユーザーの質問入力を受け付ける設定</td></tr><tr><td>質問</td><td>「質問を入力してください」と入力</td><td>ユーザーに提示するメッセージを入力</td></tr><tr><td>ベースモデル</td><td>利用可能なモデルからご自由にお選びください</td><td>1つ選んでまず動作確認。<br>※社内指針等に応じて適切なモデルを設定してください</td></tr><tr><td>エージェント</td><td>Rag Agent V2</td><td>基本的には最新版のRAGエージェント機能を推奨。違いは<a href="/pages/4e32a7ea5850c3a1d5d2d6d88bc91122f3164bb1#allganizenonadeforutojento">主なデフォルトエージェント</a>を参照</td></tr><tr><td>検索ソース</td><td>3章で登録した内容に応じて、<strong>「Q&#x26;A」「ドキュメント」</strong>にチェック。<br>・<strong>Q＆Aを利用する場合：</strong>[ハッシュタグの適用範囲]で対象ハッシュタグの設定を推奨。<br><strong>・ドキュメントを利用する場合：</strong>[フォルダ検索の適用範囲]で対象フォルダ指定を推奨。</td><td>全社検索にせず、対象を絞ると精度向上</td></tr></tbody></table>

📚 各設定項目の詳細は [ユーザーガイド > 回答生成ノード](https://docs.allganize.ai/alli-llm-app-market/manual/app-management/conversation/generative-answer) を参照してください。
{% endstep %}

{% step %}

### プレビューで動作確認 <a href="#preview-and-test" id="preview-and-test"></a>

1. 画面右上の **「プレビュー」** をクリック

<figure><img src="/files/Ky4jhyTo9XnKDpzHjZge" alt=""><figcaption></figcaption></figure>

2. テスト質問を入力（アップロードしたドキュメントの内容に関するもの）

<figure><img src="/files/wlioungmPjlOpaYuZDDA" alt=""><figcaption></figcaption></figure>

3. 期待通りの回答が返るか確認
4. **回答根拠** を開き、正しいドキュメントページが参照されているか確認

<figure><img src="/files/EoW4Zs5XEDKlWeSa7SSe" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}

#### 期待通りの回答が返らないとき

* ドキュメントが「公開」ステータスか確認
* 検索対象に正しいドキュメント／Q\&Aが含まれているかご確認
* 質問文を自然な文章にしてみてください（単語のみは検索精度が低下します）
* 改善されない場合は [ユーザーガイド > ドキュメントから回答生成機能の精度向上方法](/alli-llm-app-market/practice/improved-ga-accuracy.md#no) をご参照ください
  {% endhint %}
  {% endstep %}

{% step %}

### 下書き保存 <a href="#save-draft" id="save-draft"></a>

* チャットフローの編集内容は、**自動保存**されます。
* アプリ管理画面に戻り、「ドラフト」タブに作成したアプリが保存されていることを確認します。
* 公開作業は [6章 ](/alli-llm-app-market/first/start-guide/publish-and-share.md)で行います　※チャットフロー上から公開を進めることも可能です。
  {% endstep %}
  {% endstepper %}

## 4-2. ここまでで完成するもの <a href="#what-you-built" id="what-you-built"></a>

✅ アップロードしたドキュメントを根拠に回答するRAG型アプリの**ドラフト版**（未公開状態）

ここまでで、AlliにおけるRAGアプリ作成の基本をご体験いただけたことになります。

## 4-3. 次に試したくなったら <a href="#next-steps" id="next-steps"></a>

| やりたいこと                                     | 行き先                                                                                                                               |
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------- |
| 検索範囲をハッシュタグで絞り込みたい                         | [ユーザーガイド > ナレッジベース](https://docs.allganize.ai/alli-llm-app-market/manual/knowledge-base)                                          |
| 入力フォーム・選択肢を追加したい                           | [ユーザーガイド > ノード](https://docs.allganize.ai/alli-llm-app-market/manual/app-management/conversation)                                 |
| Excelの表データに回答・集計させたい（Table Agent）          | [ユーザーガイド > Excelファイルをテーブルデータとして実行して利用する](https://docs.allganize.ai/alli-llm-app-market/manual/document/table-agent)               |
| Web・ドキュメント横断の調査レポートを自動生成したい（Deep Research） | [ユーザーガイド > Deep Researchノード](https://docs.allganize.ai/alli-llm-app-market/manual/app-management/conversation/deep-research-node) |
| 独自のAIエージェントを作りたい                           | [ユーザーガイド > Agent Builder](https://docs.allganize.ai/alli-llm-app-market/manual/app-management/agent-builder)                      |
| プロンプトをカスタマイズしたい                            | [ユーザーガイド > プロンプト管理](/alli-llm-app-market/manual/prompt-management.md)                                                             |

## ✅この章のチェックリスト <a href="#checklist" id="checklist"></a>

* [ ] 会話型アプリを新規作成した
* [ ] 開始→回答生成の最小フローを構築した
* [ ] 回答生成ノードに検索対象・LLMモデルを設定した
* [ ] プレビューで動作確認した
* [ ] ドラフトに保存した


---

# 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.allganize.ai/alli-llm-app-market/first/start-guide/hands-on-a-rag-app.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.
