※本記事は2025年10月13日に米国で公開された Introducing Hybrid Reasoning with Agent Script の抄訳です。本記事の正式言語は英語であり、その内容および解釈については英語が優先されます。
企業のワークフローをAI化するうえで特に難しいのが、柔軟性と厳密性の両立です。大規模言語モデル(LLM)は自然言語の解釈に優れ、対話形式の柔軟なやり取りを可能にしますが、企業が行う返金処理や融資申請といった重要業務では、厳格に定められた一連の処理手順に従うことが求められます。
推論チェーンの弱いAIエージェントは現場で役に立ちませんし、構造のない複雑な設定は開発者に大きな負担をかけます。この問題は、LLMの創造性だけでは解決できません。企業のワークフローの厳密性をAIに組み込める、新たな言語が必要です。
Salesforceが先日発表したAgent Scriptは、まさにこの課題を解決します。Agent Scriptは、Agentforce 360プラットフォーム上で稼働するAIエージェントを人に理解しやすい形式で記述できる新たなスクリプト言語です。高レベルの宣言型ドメイン固有言語(DSL)で、プログラム的に厳密なAIエージェントを実現します。
Atlas推論エンジンによるハイブリッド推論
今回のリリースの最注目ポイントは、強化されたAtlas推論エンジンです。設定可能になった新しいAtlas推論エンジンは、LLM本来の創造性と、構造化されたビジネスロジックの確実性を併せ持つハイブリッド推論を通じて、AIの柔軟性と企業のワークフローの厳密性を両立させる、予測可能で信頼性の高いAIエージェントを実現します。
Agent Scriptは、この推論エンジンの力を最大限に活かすポータブルな表現言語です。条件付きロジックや、正確なツール利用、ガイド付き制御によって、AIエージェントの動作を確実に定義できます。しかも、Agent Scriptは新しいエージェントビルダーでの開発だけでなく、各種IDE内のAgentforce Vibes(英語)でも利用できます。
トピック、アクション、引き継ぎ
Agent Scriptは、コンパイル型言語です。記述されたAIエージェントのスクリプトを直接実行するわけではありません。その代わりに、「エージェントグラフ」という構造化された仕様を生成し、それをAtlas推論エンジンで処理します。この仕組みによって、AIエージェントはリフレクション(内省)ループやマルチトピック、マルチエージェントの連携を開発者の指定どおりに実行します。
スクリプトの基本になるのは、業務ロジックをカプセル化するトピック(topic)ブロックです。ここに、AIエージェントの動作を制御する条件分岐、ルール、引き継ぎなどを定義します。
では、天気予報(Weather Forecast)のトピックをAgent Scriptなしで定義する方法を見てみましょう。まずAIエージェントへの指示を記述し、実行できることと実行できないことを指定します。今は指示文のなかで変数を使えますが、それらをアクション出力に割り当てる必要があります。さらに、「このトピックでは何を扱わないか」も明示的に指定しなければなりません(たとえば、現在の天候情報は提供しない等)。リクエストに対して適切なトピックを選ぶ作業は、LLMに一任されます。
この場合の指示文の例は、以下のようになります。
1Deliver comprehensive weather forecasts tailored to user needs.
2
3First, call the Get_Weather_Forecast action with {$User_City} and {$User_Country} if available.
4Include forecast_days parameter (1-14 days) and set include_hourly flag based on user needs.
5
6Present multi-day forecasts showing daily conditions, high/low temperatures, precipitation chances, and wind information.
7Always include forecast confidence level and highlight notable weather trends.
8
9You can't provide any information about the current weather.
10You don't handle any alert monitoring for severe weather situations.
11
12Gather missing preferences when needed: number of days, hourly details, or location clarification.(参考: 日本語訳)
1ユーザーのニーズに合わせて、総合的な天気予報を提供します。
2
3まず、Get_Weather_Forecastアクションを呼び出します。{$User_City}と{$User_Country}の入力がある場合は、これらを引数とします。
4forecast_daysパラメーター(1~14日)を適用し、ユーザーのニーズにもとづきinclude_hourlyフラグを設定します。
5
6複数日にわたる予報を表示します。この予報には、各日の天候、最高気温と最低気温、降水確率、風向きと風速の情報を含めます。
7必ず予報の信頼度を掲載し、注意すべき気象傾向を目立たせるようにします。
8
9現在の天気に関する情報は提供しません。
10深刻な気象状況に関する警報監視は一切行いません。
11
12必要な選択要素(日数、時間の詳細、位置情報)が不足している場合は、情報を収集します。今度は、同じトピックをAgent Scriptで定義してみましょう。説明するなかで、この言語の核となる要素をいくつかご紹介します。
以下の例では、トピックの指示文中に具体的なアクションや変数を直接埋め込んでいます。これにより、必要なタイミングでAIエージェントの動作を完全にコントロールすることが可能になります(たとえば、AIエージェントが推論を行う直前に動的なコンテキストを追加する等)。また、Agent Scriptでは@utils.transition toステートメントのようなユーティリティを利用して、他のトピックへの引き継ぎを厳密に制御できます。
1topic forecast_service:
2 description: "Provides detailed weather forecasts including hourly and multi-day predictions"
3
4 reasoning_instructions:
5 >>
6 Deliver comprehensive weather forecasts tailored to user needs.
7
8 Call {{@action.Get_Weather_Forecast}} with {{@variable.user_city}} and {{@variable.user_country}} if available.
9 Include forecast_days parameter (1-14 days) and set include_hourly flag based on user needs.
10
11 Present multi-day forecasts showing daily conditions, high/low temperatures, precipitation chances, and wind information.
12 Always include forecast confidence level and highlight notable weather trends.
13
14 If user also wants current conditions, {{@action.current_conditions}} can transition to current weather service.
15 If severe weather is detected in forecast data, {{@action.alert_monitoring}} can transition to alerts.
16
17 Gather missing preferences when needed: number of days, hourly details, or location clarification.
18
19 reasoning_actions:
20 @action.Get_Weather_Forecast
21 with city=@variable.user_city
22 with country=@variable.user_country
23 with forecast_days
24 with include_hourly
25 set @variable.forecast_data = @result.daily_forecast
26 set @variable.hourly_forecast = @result.hourly_forecast
27
28 @utils.transition to @topic.current_weather_service as current_conditions
29 description: "Check current weather conditions alongside the forecast."
30 @utils.transition to @topic.severe_weather_alerts as alert_monitoring
31 description: "Monitor for any severe weather in the forecast period.(参考: 日本語訳)
1topic forecast_service:
2 description: "時間ごとの予報、複数日の予報を含む、詳しい天気予報を提供する"
3 reasoning_instructions:
4 >>
5 ユーザーのニーズに合わせて、総合的な天気予報を提供します。
6
7 {{@action.Get_Weather_Forecast}}を呼び出します。{{@variable.user_city}}と{{@variable.user_country}}の入力がある場合は、これらを引数とします。
8 forecast_daysパラメーター(1~14日)を適用し、ユーザーのニーズにもとづきinclude_hourlyフラグを設定します。
9
10 複数日にわたる予報を表示します。この予報には、各日の天候、最高気温と最低気温、降水確率、風向きと風速の情報を含めます。
11 必ず予報の信頼度を掲載し、注意すべき気象傾向を目立たせるようにします。
12
13 ユーザーが現在の天候情報も必要としている場合は、{{@action.current_conditions}}で現在の天候情報サービスに遷移できます。
14 予報データで深刻な気象状況が検出された場合は、{{@action.alert_monitoring}}で警報情報に遷移できます。
15
16 必要な選択要素(日数、時間の詳細、位置情報)が不足している場合は、情報を収集します。
17
18 reasoning_actions:
19 @action.Get_Weather_Forecast
20 with city=@variable.user_city
21 with country=@variable.user_country
22 with forecast_days
23 with include_hourly
24 set @variable.forecast_data = @result.daily_forecast
25 set @variable.hourly_forecast = @result.hourly_forecast
26
27 @utils.transition to @topic.current_weather_service as current_conditions
28 description: "現在の天候状況と予報を確認する"
29 @utils.transition to @topic.severe_weather_alerts as alert_monitoring
30 description: "予報期間中の深刻な気象状況を監視する"まとめ
Agent Scriptは、AIの創造性とワークフローの厳密性を両立させる、開発者にとって理想の言語です。Atlas推論エンジンのハイブリッド推論が、プログラム的な厳密性を保ち、複雑な業務を行う信頼性の高いAIエージェントの構築を可能にします。
Agent Scriptは現在パイロット版を提供中です。2025年11月には、すべてのお客様と開発者向けエディションの組織(英語)で利用可能なパブリックベータを公開予定です。
オリジナルの執筆者について
René Winkelmeyer
開発者アドボカシーチームのリーダーとして、Agentforce、Data Cloud、MuleSoft、Salesforce Platformを担当。業務外でもコーディングを趣味とし、GitHubでコードを公開。LinkedInでのフォロー歓迎。

