Skip to content

Workflows and prompting

このページでは対話型セッション、具体的にはウェルカム画面、list modelsコマンド、スラッシュコマンド、3つの主要なワークフロー(設計、コーディング、デプロイ)について説明し、プロンプティングのヒントについても紹介します。

Start Agent Assist

空のディレクトリでdr assistを実行する

dr assistは、専用の空のディレクトリからのみ実行します。 コードやその他のファイルが含まれるディレクトリでこのコマンドを実行するのは安全ではありません。 エージェントアシストのコーディングワークフローを使用すると、アシスタントはDataRobot Agent Application Templateのクローンを現在のディレクトリに作成します。 この操作によって既存のファイルが上書きされたり競合が発生したりする可能性があり、既存のプロジェクトが損なわれ、アシスタントの出力精度が低下する恐れがあります。 dr assistを実行する前に、専用のディレクトリがない場合は、ディレクトリを作成してそこでターミナルを開きます(たとえば、mkdir my-agent && cd my-agentを実行してから、dr assistを実行します)。

まず、dr assistコマンドを実行します。

dr assist 

When DataRobot Agent Assist is started, the welcome screen shows the welcome message, three options, and the help footer:

Output: Welcome screen
$ dr assist
🔌 Running plugin: assist
█████████
         █████             ███████                              ████████              ██
█████████                  ██    ███             ██             ██      ██            ██                    ██
              █████        ██      ██    █████  █████   █████   ██      ██   █████    ███████      █████   █████
██████████████             ██      ███       ██  ██         ██  █████████  ██     ██  ██     ██  ██     ██  ██
              █████        ██      ██   ███████  ██    ███████  ██   ██    ██     ██  ██     ██  ██     ██  ██
█████████                  ██    ████  ██    ██  ██   ██    ██  ██    ███  ██     ██  ██     ██  ██     ██  ██
         █████             ████████    ████████  ████ ████████  ██     ███   █████    ████████     █████    ████
█████████

Welcome! I help you design, code, and deploy AI agents.

What would you like to do?
  1. Design an AI agent      Describe your idea
  2. Code an AI agent        Load and implement an existing agent_spec.md
  3. Deploy an AI agent      Deploy an implemented agent to DataRobot

Type /help for commands | /quit to exit 

Input is collected at the $ prompt. Type a number (1, 2, or 3) to choose a category, or, describe the goal in natural language. If the first instruction is one of those numbers, the assistant treats it as referring to the predefined categories.

組み込みコマンド

$プロンプトでlist modelsと入力すると(スラッシュは不要)、LLM Gatewayのモデルカタログ、セッションで使用中のモデル、およびモデルを切り替えるか継続するかの選択肢が表示されます。 詳細については、環境とコマンドのリファレンスを参照してください。 スラッシュコマンドは「/」で始まります。全リストと説明については、スラッシュコマンドを参照してください。 /と入力すると、利用可能なスラッシュコマンドが表示され、/helpで詳細を確認できます。 The /quit command exits the session.

Design an AI agent

Use this workflow when starting a new agent idea. アシスタントは、エージェントの目的、機能、および要件について、明確化のための質問を行います。これには、ビジネスまたはドメインに関する懸念事項(エスカレーションルール、ユーザーシナリオ、トーンなど)や技術的な詳細が含まれます。 また、ツールとモデルを提案し、エージェントの仕様を作成します。 The specification is displayed and written to agent_spec.md in the current directory (YAML format). 完全な仕様には、通常、コードが存在する前に実装およびレビューすべき内容(エージェントの動作とプロンプト、モデルの選択、ツールの定義、認証と連携の仕組みなど)が含まれます。これにより、開発者とステークホルダーの両方が意図を一致させることができます。 フィールドの定義や例については、エージェント仕様リファレンスを参照してください。

The specification can be refined over several iterations. アシスタントは、最初のドラフトを提案する前に、確認のための質問を2回程度に限定し、その後、そのドラフトをもとにあなたと共同で修正を重ねていきます。 モデルを選択する際、コストやその他の制約を指定しない限り、LLM Gatewayカタログ から適切なデフォルトモデルが推奨されます。 いつでもlist modelsと入力して、組織内で使用可能なモデルを確認できます。

シミュレーションやコーディングを行う前に、アシスタントが、Agentic StarterテンプレートのデフォルトのチャットUIで十分か、それともカスタムフロントエンド(ダッシュボード、データ可視化、マルチページアプリなど)が必要かを確認します。 その選択は、agent_spec.mdfrontendセクションに記録されます。 仕様ができたら、コーディングの前にエージェントをシミュレーションして設計を検証できます。

Example conversation: Design a customer support agent
$ I want to create a customer support agent for an e-commerce site
Agent Assist: I'll help you design that! I can ask some questions to understand your requirements better. What specific customer issues should this agent handle?
User: $ It should handle order status, returns, and product questions
DataRobot Agent Assist: Great! What data sources will it need access to?
User: $ Our order database and product catalog
DataRobot Agent Assist: Perfect. Should it escalate complex issues to humans?
User: $ Yes, escalate billing and refund requests
DataRobot Agent Assist: I'll create a specification for your customer support agent...
[Creates and displays agent_spec.md, saves to file] 

エージェントのシミュレーション

agent_spec.mdができたら、実装の前にエージェントのシミュレーションができます。 シミュレーションはドレスリハーサルと呼ばれることもあります。実装コードを記述することなく、エンドユーザーと同じように設計を試してみることができます。 シミュレーションは設計の検証のみを目的としています。実際のツールコードは実行されず、外部サービスも呼び出されません。

  • 動作:モデル(LLM)は仕様を使用して、どのツールをどのような引数で呼び出すかを決定します。 モデルがツール呼び出しをリクエストした際、Agent Assistはツールの実装を実行したり、DataRobotのデプロイ、データセット、その他のAPIを呼び出したりすることはありません。 代わりに、LLMを使用して、ツールの記述された入力と出力に一致するシミュレーション済みの戻り値を生成します。 選択されたツール、渡された引数、およびシミュレーション結果が表示されます。それにより、設計が妥当かどうかを判断できます。
  • 目的:実際のツールコードの実装に時間を費やす前に、適切なツールが存在すること、入出力構造が妥当であること、および選択されたモデルがタスクに対して適切なツールを呼び出す傾向があることを検証します。
  • 対象外:シミュレーションでは、実際のDataRobotのデプロイを呼び出したり、実際のデータセットを読み取ったり、実際のAPIにアクセスしたりすることはありません。 ライブデータとデプロイを使用するには、エージェントを実装し、コードまたはデプロイワークフローで実行します。

まず、アシスタントにエージェントのシミュレーションを依頼します(例:「エージェントをシミュレーションして」や「設計を試させて」)。 セッション中:

  • エンドユーザーになりきる:実際のユーザーがするようにメッセージを入力します(注文状況に関する質問、検索クエリー、または気になるエッジケースなど)。
  • 特定のシナリオを試す:特定のリクエストや障害モードについて説明し、モデルが適切なツールと引数を選択するかどうかを確認します。
  • 設計メモを残す:プロンプト、ツール、または例の内容に変更が必要な場合は、アシスタントに知らせます。アシスタントは、ユーザーが習得した内容に基づいてagent_spec.mdを更新できます。
  • 終了して確認する:終了したら、アシスタントにシミュレーションの終了を依頼します。 アシスタントはエージェントのパフォーマンスを要約し、仕様(システムプロンプト、ツール、モデル、または例)に対して具体的な変更を提案できます。

終了したら、/quitと入力してセッションを閉じます。

Code an AI agent

Use this workflow when the agent_spec.md file already exists and is ready to implement. アシスタントは仕様を読み込み、テンプレートリポジトリがまだ存在しない場合は、DataRobot Agentic Starterリポジトリのクローンを作業ディレクトリに作成します。 It then follows the template’s AGENTS.md for setup and implementation. The assistant can run shell commands (with approval), edit files, and manage multi-step work with tools. It suggests testing locally and deploying when the implementation is ready.

空の作業ディレクトリ

Agent Assistは、テンプレートのクローンを現在のディレクトリに作成します。 ディレクトリにagent_spec.md以外のファイルがすでに含まれている場合は、既存の作業が上書きされないよう、先に進む前にアシスタントが警告します。

初めてテンプレートを準備する場合、アシスタントは通常、以下のことを行います。

  1. 依存関係を確認する:必要なツール(Git、Node、Task、Pulumiなど)が最小バージョンを満たすように、dr dependencies checkを実行します。 必要なツールを参照してください。
  2. エージェントフレームワークを要求する:サポートされているフレームワーク(LangGraphCrewAILlamaIndexNeMo Agent Toolkit (NAT)、またはBase(最小限のスキャフォールド))から1つを選択します。 選択内容はテンプレート設定に保存され、アシスタントが従うサンプルパターンが決定されます。
  3. プロジェクトを初期化するdr startを(承認を得て)実行し、Agentic Starterテンプレートの資格情報、ポート、およびLLM設定を構成します。
  4. 仕様に沿って実装するagent_spec.md(ツール、プロンプト、およびフロントエンドの要件)に合わせてテンプレートコードを調整します。 外部APIへのアクセスが必要なツールは、仕様で説明されている認証を使用します。シークレットの設定は、AGENTS.mdの説明に従ってテンプレート内で行います。

Windows

Agent AssistはmacOSおよびLinuxで動作します。 Windowsでは、コードワークフローにWSLまたはDataRobot codespaceを使用します。 システム要件を参照してください。

Agentic Starterテンプレートは、本番環境向けのエージェントアプリケーション(ツール用のMCPサーバーインターフェイス、dr startによるガイド付き設定、デプロイ向けのタスクなど)向けに構成されています。 テンプレートに標準で含まれる内容の詳細については、Agenticアプリケーションテンプレートの概要を参照してください。

実装後、テンプレートのAGENTS.mdに記載されているコマンドを使用して、エージェントをローカルでテストします。 プロジェクトディレクトリの別のターミナルでそれらのコマンドを実行します。 本番環境での運用準備ができたら、AIエージェントのデプロイに進みます。

Example conversation: Add a tool to an existing specification
User: $ Load my existing agent specification and add a tool for inventory checking
Agent Assist: I found your agent_spec.md. I can see it's a customer support agent.
Let me add an inventory checking tool...
[Reads current spec and adds the requested tool] 

Deploy an AI agent

Use this workflow when an implemented agent is ready to deploy to DataRobot. The assistant reads the deployment instructions from the template’s AGENTS.md and guides users through the steps. It does not run deployment commands; it indicates what to run (in a separate terminal). For interactive or long-running steps (such as dr start), the assistant uses the appropriate tools as defined in the codebase.

Example conversation: Deploy the agent
User: $ Help me deploy the agent I implemented
Agent Assist: I'll read the deployment section of AGENTS.md and walk you through the steps...
[Displays deployment commands and instructions] 

Interact with the DataRobot CLI

DataRobot Agent Assist runs certain DataRobot CLI (dr) commands on your behalf and can run other shell commands (including additional dr commands) with your approval.

  • At startup: The assistant runs dr dependencies check to verify that required tools (Python, Node, Git, Task, Pulumi, etc.) are installed and meet minimum versions. See Prerequisites and installation.
  • Code workflow: When you use the assistant to clone and prepare the template (for example, "Code an AI agent" or "prepare to code"), it runs dr start in the template directory to initialize the DataRobot project. You are prompted to approve before the command runs.
  • Any workflow: The assistant can run shell commands—including dr subcommands—after you approve. It shows the command and description, then prompts for approval before executing.

For full DataRobot CLI usage (authorization, deployment, and other commands), see the DataRobot CLI documentation.

Prompting considerations

Consider the following guidelines to get better results from the assistant:

  • Be specific: "Create a customer support agent that handles order inquiries and escalates billing issues" rather than "Create an agent".
  • Provide context: "I'm building a travel booking agent and need help with the flight search API integration" rather than "Help me with my code".
  • Ask for explanations: "Explain why this code isn't working and show me how to fix it" rather than "Fix this".
  • Iterate: "This is good, but can you make it handle edge cases like cancelled orders?" rather than accepting the first solution.