UiPath Documentation
maestro-automate
latest
false
Maestro Automate ユーザー ガイド

チャット エージェントのワークフローを構築する

出力ベースのルーティングとエージェントのハンドオフを使用して、AI を活用したリアルタイムのチャット エクスペリエンスをキャンバス上で構築します。

構築するもの​

主要なチャット ノードがどのように柔軟なチャット エクスペリエンスを構築するかを示す会話形式のワークフロー。

このチュートリアルでは、アカウント スペシャリスト エージェントに会話をいつ引き渡すかを決定する一般的なヘルプデスク エージェントで構成されるチャット エクスペリエンスを構築します。

開始する前に​

  • エージェントが使用できる大規模言語モデル (LLM)。

使用されるノード​

  • 会話トリガー: ワークフローを会話型としてマークし、ユーザーがチャットを開始したときにワークフローを開始します。
  • メッセージを待機: ユーザーがメッセージを送信して最新の会話コンテキストを返すまで一時停止します。
  • 会話型エージェント: 会話のコンテキストに基づいて一連の応答とツール呼び出しを順番に実行する、単一プロンプトの会話型 AI ノードです。
  • 判断: エージェントの構造化された出力に基づいてルーティングします。
  • メッセージを送信: 決定論的な (LLM 以外の) 通知をチャットに送信します。

手順​

ヒント:

コーディング エージェントが設定されていれば、手動の手順を省略できます。質問してください:

Build a Maestro Automate chat workflow: a Conversation trigger, a Wait for message node, a general helpdesk Conversational agent that answers IT questions and hands account questions to an account specialist agent, and Send message nodes that reply, looping back to Wait for message.
Build a Maestro Automate chat workflow: a Conversation trigger, a Wait for message node, a general helpdesk Conversational agent that answers IT questions and hands account questions to an account specialist agent, and Send message nodes that reply, looping back to Wait for message.

次に、キャンバス上でワークフローを開き、以下の手順と照合してテストします。コーディング エージェントを設定する 設定について説明しています。

1. ワークフローを作成し、会話トリガーを追加します​

  1. 最初のワークフローで説明しているように、プロジェクトを作成します。
  2. 既定のトリガー ( [手動トリガー] というラベル) を選択し、[ トリガーを変更] を選択します。
  3. トリガー ピッカーで [ 会話トリガー] を選択します。

2. ユーザーの最初のメッセージを待機する​

[メッセージを待機] は、会話トリガーの後の最初のノードである必要があります。

  1. 会話トリガーの出力ハンドルで [+ ] を選択し、[ メッセージを待機] を検索して選択します。
  2. プロパティ パネルで、[ 会話 ID ] を $vars.conversationTrigger1.output.conversationIdに設定します。

The node outputs conversationContext, which holds the recent chat history, user profile data, and other turn information, so the next chat nodes can use it.

3. 会話型エージェント ノードを追加する​

最初の会話型エージェント ノードは 一般的なヘルプデスク エージェント です。日常的な IT に関する質問をそれ自体で処理し、構造化された出力を通じていつスペシャリストに引き渡すかを決定します。

  1. [メッセージを待機] ノードの出力ハンドルで [+ ] を選択し、[ 会話型エージェント] を検索して選択します。

  2. Rename it generalHelpdeskAgent. The Decision node in step 4 uses this name to read the agent's output.

  3. エージェントの [プロパティ] パネルで、[ システム プロンプト] を設定します。

    You are the internal IT helpdesk assistant.
    Answer everyday questions about our tools, wifi, printers,
    meeting rooms, and where to find internal docs.
    
    When the employee is having an account problem —
    a forgotten password, a locked account, an MFA issue,
    or a missing permission — tell the user that they will
    be handed off to an account specialist agent.
    You are the internal IT helpdesk assistant.
    Answer everyday questions about our tools, wifi, printers,
    meeting rooms, and where to find internal docs.
    
    When the employee is having an account problem —
    a forgotten password, a locked account, an MFA issue,
    or a missing permission — tell the user that they will
    be handed off to an account specialist agent.
    
  4. Under Conversational Agent Settings, set Conversation context to $vars.waitForMessage1.output.conversationContext.

  5. [ 出力] で、出力変数を追加します。

    • Name (名前): needsAccountSpecialist
    • データ型: ブール値
    • 既定値: false
    • 説明: Set to true when the employee has an account problem — a forgotten password, a locked account, an MFA issue, or a missing permission. Otherwise false.

The Description on the output variable is necessary, because the agent uses the description, together with the system prompt, to decide the output value after each reply.

4. Branch on the agent's decision​

Follow the agent with a Decision node that sends the conversation down a different path based on the agent's output.

  1. エージェント ノードの出力ハンドルで [+ ] を選択し、[ 判断] を検索して選択します。
  2. 条件 を設定します$vars.generalHelpdeskAgent.output.needsAccountSpecialist
  3. Connect the False branch back to the original Wait for Message (Step 2). The general helpdesk agent keeps the conversation and may hand off later, or never.

True 分岐は、次の手順まで開いたままになります。

5. ハンドオフをアナウンスする​

Tell the employee what's happening and ask them to describe their issue before the specialist takes over.

  1. On the True branch of the Decision, add a Send Message node. Set:
    • 会話 ID: $vars.conversationTrigger1.output.conversationId
    • 取引所 ID: $vars.waitForMessage1.output.conversationContext.latestExchangeId
    • コンテンツ: "You've been connected to the account specialist, which can help with password resets, unlocking your account, and permission or group membership questions. Please explain your issue."

6. アカウント スペシャリストとの 2 つ目の [メッセージを待機] ループを追加します​

  1. [メッセージを送信] の後に、[ メッセージを待機 ] ノードをもう 1 つ追加します。

  2. [ 会話 ID ] を $vars.conversationTrigger1.output.conversationIdに設定します。

  3. 2 番目の [メッセージを待機] ノードの出力ハンドルで [+ ] を選択し、[ 会話型エージェント] を検索して選択します。

  4. 必要に応じて、名前を Account Specialist Agent に変更します。

  5. システム プロンプトを設定します。

    You are the account specialist. The user has been handed off
    to you from a general helpdesk assistant.
    
    Help only with account problems — password resets, unlocking
    accounts, MFA re-enrollment, and permission or group membership
    questions.
    You are the account specialist. The user has been handed off
    to you from a general helpdesk assistant.
    
    Help only with account problems — password resets, unlocking
    accounts, MFA re-enrollment, and permission or group membership
    questions.
    
  6. Under Conversational Agent Settings, set Conversation context to $vars.waitForMessage2.output.conversationContext.

  7. Connect the output of the Account Specialist Agent back to the second Wait for Message node, so the specialist keeps the conversation.

ヒント:

With more than one Wait for Message node, a later node might read the conversation context from an older Wait for Message node.

To avoid this, create one workflow variable (for example, $vars.globalConversationContext) and update it from each Wait for Message node's Update Variable section. Later nodes then read that one variable.

7. ワークフローをデバッグする​

キャンバスの下部のツールバーで [ デバッグを実行 ] (▶) を選択します。キャンバスの横にチャット パネルが開きます。

  • 「オフィスの仮想プライベート ネットワーク (VPN) に接続するにはどうすればよいですか?」と尋ねる: 一般的なヘルプデスク エージェントが直接応答し、別のターンにループ バックする必要があります。
  • 「ログインに問題が発生しています」と尋ねます。一般的なヘルプデスク エージェントが needsAccountSpecialist: trueを設定すると、判断は True の分岐にルーティングされ、引き継ぎの通知が表示され、アカウント スペシャリストが引き継ぎます。

実行トレースを調べて、各ターンで実行されたエージェントと、一般的なヘルプデスク エージェントが生成した構造化された出力を確認します。

結果​

デプロイが完了すると、会話型ワークフローはチャットの デプロイ チャネル に 会話型エージェント としてユーザーに表示されます。チャット エージェントのオブザーバビリティを通じて、パフォーマンス、メトリック、ユーザーからのフィードバックを監視します。

このワークフローを拡張する​

  • エージェントにコンテキストとツールを提供する: コンテキスト リソースをエージェントの コンテキスト ハンドルに接続し、モデルだけでなく、インデックス付きのナレッジ ソースから回答できるようにします。ツール リソースをエージェントの [ツール] ハンドルに接続し、エージェントが応答するだけでなく、会話のターン中にアクションを実行できるようにします。
  • 並列ブランチを追加する: [メッセージを待機] にルーティングするだけでなく、並列ブランチを追加して、会話をブロックすることなく背後でのアクションを実行します。たとえば、ブランチは、マネージャーの承認を得るために クイック フォーム ノードを起動し、他のアクションを続行できます。
  • 問題が解決したらチャットを終了します。実行を終了する分岐にルーティングする resolved: true 出力をエージェントに追加します。会話は正常に終了し、ユーザーには会話が終了したことがわかります。

上記の機能によってワークフローを拡張して、完全なチャット エクスペリエンスにすることができます。

次のステップ​

このページは役に立ちましたか?

接続

ヘルプ リソース サポート(opens in new window)

学習する UiPath アカデミー(opens in new window)

質問する UiPath フォーラム(opens in new window)

最新情報を取得