UiPath Documentation
getting-started
latest
false
スタート アップ ガイド - 開発者向け
  • はじめに
    • 概要
    • Environment set up
  • UiPath Agents の利用を開始する
  • LangGraph を使用した UiPath Agents の利用を開始する
    • はじめに
    • 環境をセットアップする
    • エージェントを構築する
    • Add a tool
    • エージェントを評価する
    • Studio Web に接続
  • Studio Web でローコード エージェントを構築する
  • UiPath エージェントにツールを追加する
  • Getting Started with UiPath Maestro Flow
重要 :
このコンテンツは機械翻訳によって処理されています。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

エージェントを構築する

コーディング エージェントと UiPath のスキルを使用して、LangGraph エージェントをローカルで構築、設定、実行します。

CLI をインストールし、スキルを配置し、アカウントが認証されたら、ローカル プロジェクトをスキャフォールディングする準備が整いました。

手順 4 - ローカル プロジェクトを設定する​

エージェント プロジェクトの新しいフォルダーを作成し、VS Code で開きます ([ファイル] → [フォルダーを開く])。この手順以降のすべてのコマンドは、プロジェクト フォルダーのルートから実行されます。

Python 環境を作成する​

サポートされている Python のバージョンにピン留めされた仮想環境を作成し、アクティブ化します。

mkdir QuestIntake
cd QuestIntake

uv venv --python 3.13
source .venv/bin/activate
mkdir QuestIntake
cd QuestIntake

uv venv --python 3.13
source .venv/bin/activate
注:

Windows:ではなく .venv\Scripts\activatesource .venv/bin/activateを使用してください。

注:

Python バージョン: 3.13 が PATH にない場合、 uv は Python を自動的にダウンロードして管理します。サポートされているバージョンは 3.11、3.12、3.13 です。

LangGraph 連携をインストールする​

LangGraph は、ノードとエッジのグラフとしてステートフル LLM エージェントを構築するための Python フレームワークです。uipath-langchain は、UiPath Platform でのデプロイと評価のために LangGraph エージェントをパッケージ化する UiPath 統合レイヤーです。

アクティブな venv に UiPath LangGraph パッケージをインストールします。これにより、次のステップのプロジェクト スキャフォールディングにもフレームワークが利用できるようになります。

uv pip install uipath-langchain
uv pip install uipath-langchain

UiPath CLI に Python を登録する​

UiPath 互換の Python 実行可能ファイルが存在する場所を CLI に指示します。

uip codedagent setup --force
uip codedagent setup --force

が表示されます "Result": "Success"。この手順は、 uip codedagent コマンドを使用する前に、マシンごとに 1 回 (および venv の変更後に) 必要です。

プロジェクトのスキャフォールディング​

UiPath プロジェクトの構造を作成します。uip codedagent new インストールされているフレームワークを検出し、適切なスキャフォールディング ファイルを生成します。

uip codedagent new QuestIntake
uip codedagent new QuestIntake

これにより、 pyproject.toml、 main.py、 langgraph.json、 uipath.json、 entry-points.json、 bindings.json、およびコーディング エージェントのコンテキスト ファイル (AGENTS.md、 CLAUDE.md、 .agent/) が作成されます。main.pyはプレースホルダーです。手順 5 でコーディング エージェントがこれを置き換えます。

ローカルの開発サーバー依存関係を追加し、ロックファイルを同期します。

uv add uipath-dev --dev
uv sync
uv add uipath-dev --dev
uv sync

エントリ ポイントを生成する​

init を実行して、スキャフォールド コードからエントリ ポイント スキーマを生成します。

uip codedagent init
uip codedagent init

この段階では、プロジェクトにプレースホルダーのエントリ ポイントがあります。コーディング エージェントが実際のエージェント コードを記述した後、手順 5 で init を再実行します。


手順 5 - コーディング エージェントでエージェントを構築する​

ここで UiPath のスキルが実を結びます。コーディング エージェントを開き、エージェント ロジックを作成するようプロンプトで指示します。以下のプロンプトは簡潔で、エージェントを構築する方法ではなく、エージェントが何をすべきかを説明しています。

The uipath-agents skill your coding agent has installed already knows the LangGraph integration patterns, correct SDK imports, Pydantic schema conventions, and relevant SDK requirements. Without these skills, you would need to specify all of this in the prompt itself.

次のプロンプトを使用します (または、ユース ケースに合わせて調整してください)。

Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.

The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)

Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)

Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.

Only touch main.py, langgraph.json, and input.json.

Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
Update main.py to implement this UiPath coded agent using LangGraph as a single-node graph with no tools and no retry or error-handling logic.

The agent is a quest intake classifier for a fantasy adventurer's guild. Given a
description of an incoming quest, it classifies the difficulty as one of four tiers:
- Trivial: Simple errands anyone can handle (e.g., deliver a letter, clear rats from a cellar)
- Standard: Moderate quests requiring some skill (e.g., escort a merchant caravan)
- Heroic: Difficult quests requiring significant expertise (e.g., slay a wyvern, infiltrate a thieves' guild)
- Legendary: Extreme quests requiring top-tier heroes and special approval (e.g., defeat a lich, close a planar rift)

Return the classification tier and a brief reasoning. Use these exact field names in the State schema:
- Input field: `description` (string)
- Output fields: `tier` (a Literal type constrained to exactly "Trivial", "Standard", "Heroic", "Legendary" — not a plain string, so the model can't emit an out-of-vocabulary tier) and `reasoning` (string)

Update the existing langgraph.json to point at the new graph, and create an input.json with this exact sample quest: {"description": "Clear the rats out of the inn cellar"}.

Only touch main.py, langgraph.json, and input.json.

Don't run any uip codedagent commands or otherwise verify that the agent runs — I will do this myself.
注:

Why this prompt is so specific. It names the exact files to touch and tells the coding agent not to run any uip codedagent commands or verify its own work. That's deliberate here: the rest of this lab exercises those same CLI commands directly in the next steps, so verification is left to you instead of the coding agent running it first.

The prompt above is a good template to start from in your own projects, but you should remove the last two sentences to enable the coding agent to test its work and organize files to its own judgment.

重要:

コーディング エージェントは非決定論的です。生成されるコードは、ここに示す例とは異なります。それは予想通りです。重要なのは、 main.py がエラーなしで実行され、分類が返されることです。

And note that if your coding agent presents a 'Delivery' question (Studio Web, local dev server, or skip), select Skip - I'm done for now. Connect to Studio Web in Step 10.

コーディングエージェントが終了したら、 init を再実行して、新しい Pydantic スキーマから更新されたエントリポイントを取得します。

uip codedagent init
uip codedagent init

エントリ ポイントが検出されたことを確認する出力が ASCII グラフ ダイアグラムとともに表示されます。

Created 'entry-points.json' file with 1 entrypoint(s).
Created 'entry-points.json' file with 1 entrypoint(s).

続行する前に、pyproject.toml を開き、[[project]] にauthorsエントリがまだ存在しない場合は追加します。UiPath では、プロジェクトをパッケージ化するためにこのフィールドが必要です。

authors = [{ name = "Your Name" }]
authors = [{ name = "Your Name" }]

With the agent running locally and the entry points registered, you are ready to run it in the next step.

手順 6 - エージェントをローカルで実行する​

コーディング エージェントが作成したサンプル入力ファイルを使用してエージェントを実行します。

uip codedagent run agent --file input.json
uip codedagent run agent --file input.json

エージェントが要求を分類し、推論とともに層を返すのがわかります。

入力をインラインで渡すこともできます。これらの例では、Bash の一重引用符構文を使用します。PowerShell を使用している場合は、代わりに JSON ファイルで --file を使用します。

uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'
uip codedagent run agent '{"description": "Clear the rats out of the inn cellar"}'

Try your own inputs to verify the classifications make sense, for example:

uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'
uip codedagent run agent '{"description": "Slay the ancient red dragon terrorizing the countryside"}'

With the agent classifying correctly, you are ready to give it something to verify its answers against.

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

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得