NVIDIA Nemotron 3 Ultra のパフォーマンス向上に向けた LangChain Deep Agents ハーネスプロファイルの作成方法
NVIDIA は、LangChain Deep Agents のハネスプロファイルを活用してモデルを微調整することなく、Nemotron 3 Ultra の性能を最高峰の独自モデルに匹敵させる方法を解説したチュートリアルを発表しました。
キーポイント
コストと精度のトレードオフ解消
高価格な独自フロントier モデルに頼らず、効率的なオープンソースモデルをハネスレベルで最適化することで、高精度かつ低コストの実装が可能になる。
モデル微調整不要の最適化手法
従来のモデル学習(ファインチューニング)に必要なハードウェアや専門知識を要さず、既存のエンドポイント上でハネスプロファイルを変更するだけで性能向上を図る。
評価ベンチマークとカスタマイズ
特定のハネス向けに設計された評価ベンチマークと、LangChain のエージェントハネスプロファイルという機能により、変更が実際に性能向上につながるか検証可能になった。
Nemotron 3 Ultra の最適化手順
ベースライン評価の実行、失敗箇所の分析、ハネスプロファイルの変更提案、変更後の再実行による検証という4段階のプロセスでモデルに合わせた調整を行います。
ハネスプロファイルの調整対象
システムプロンプトやツール説明などのプロンプト変更、不要なツールの除外、レスポンスチェック用のミドルウェア追加など、モデル特性に合わせて柔軟に拡張可能です。
最適化の目的と具体例
エージェントからモデルへの呼び出しを学習データに近い状態にするのが目的であり、具体的には 'read_file' ツールの文字列切り取り回復テストで失敗した事例が挙げられています。
ファイル読み取りツールの制限と課題
read_file ツールは最初のページのみを返すため、必要な情報が later にある場合、モデルがオフセット/リミットによる継続読み込みを行わないと正解に到達できない。
影響分析・編集コメントを表示
影響分析
この記事は、AI エージェント開発のワークフローにおいて、高コストなモデル学習や大規模ハードウェアを必要としない現実的な高性能化アプローチを提示しています。特に、ハネスレベルでの最適化が一般化することで、中小企業や個人開発者でも高品質なエージェントシステムを構築できる環境が整いつつあることを示唆しており、業界全体の導入障壁を下げる重要な一歩となります。
編集コメント
モデルの微調整という重労働を避けつつ、ハネス側の設定変更だけで性能を飛躍させる手法は、実務現場での即効性が高く非常に注目すべきアプローチです。
エージェントシステムは、精度とコストの間にしばしばトレードオフが生じます。最高性能を誇るプロプライエタリな フロンティアモデル やハーンネスは優れた精度を提供しますが、その分高価です。ファインチューニングはこの問題に対処する一つの方法となります。初期の精度が低めである小規模またはより効率的なオープンモデルに、特定の エージェント に対してより高いパフォーマンスを発揮するように学習させるのです。ただし、ファインチューニングには、カスタムモデルのトレーニングとホスティングのための専門知識とハードウェアが必要です。
特定の使用ケース向けにプロンプトを調整することは一般的な慣行ですが、エージェントハーンネスにおけるこのプロセスを形式化し、それが著しく優れた結果を生むことを検証するのはより最近の動きです。これを可能にする二つの進展があります:
- 特定のハーンネスのために構築された評価ベンチマークにより、変更がパフォーマンス向上につながっているかを検証することが可能になります。
- モデルごとのカスタマイズ用エントリーポイント(例:LangChain のエージェントハーンネスプロファイル)は、チームがモデルを特定のエージェントワークフローに適応させることを可能にする、類まれな事例です。
本チュートリアルでは、NVIDIA Nemotron 3 Ultra に対して プロプライエタリなフロンティアモデルの知能に匹敵する LangChain Deep Agents ハーンネスプロファイルを作成します。すべての調整は、NVIDIA クラウドプロバイダーから利用可能な既存の NVIDIA Nemotron 3 Ultra エンドポイントを用いてエージェントハーンネスに対して行われます。
*ビデオ 1. 手動および自動評価を用いて、Nemotron 3 Ultra 用の LangChain Deep Agents ハーネスプロファイルを作成し検証する*
前提条件
- Python と LangChain Deep Agents がインストールされたホスト。
- NVIDIA Nemotron 3 Ultra の API キー。テスト用には build.nvidia.com で無料の API アクセスが提供されています。本番環境では、Baseten、Crusoe、Fireworks、Nebius、Together AI などの NVIDIA クラウドプロバイダーからのエンドポイントを検討してください。
- 推奨:エージェントのトレース収集用の LangSmith アカウント
ハーネスプロファイル作成のための評価実行
LangChain Deep Agents は人気のあるオープンソースのエージェントハーネスです。特定のモデルとの併用に際してエージェントハーネスを調整するために、LangChain は以下の 2 つの重要なツールを提供しています。
- オープンソースの評価ベンチマーク。
- エージェントハーネスプロファイル。これは開発者がモデルに基づいてエージェントハーネスの動作を変更するためのファーストクラス拡張ポイントを提供します。
NVIDIA Nemotron 3 Ultra 用のディープエージェントを調整する手順は以下の通りです。
- ハーネスプロファイルを指定せずに、ディープエージェントと NVIDIA Nemotron 3 Ultra を用いて評価ベンチマークを実行し、ベースラインを確立する。
- 失敗箇所を分析する。
- 失敗に対処するためのハーネスプロファイルへの変更案を提案する。
- 変更が回帰(性能低下)を引き起こさずに評価の改善をもたらすことを確認するために、ベンチマークを再実行する。
エージェントハーネスプロファイルに対して適用可能な変更の種類は以下の通りです。
- プロンプト:ディープエージェントのベースシステムプロンプトを変更するか、プロンプトサフィックスを適用するか、ツール説明を変更します。例えば、Nemotron Ultra に対して明確化質問を優先するよう指示したり、モデルの記憶よりもツールの結果を優先するよう指示したりすることが含まれます。
- 除外:削除すべきツールまたはミドルウェアです。
- 追加:開発者は、モデル応答が切り捨てられているか、ツール名が誤っているかをチェックするミドルウェアやサブエージェントなど、ハネスに追加のミドルウェアやサブエージェントを拡張します。
ハネスエンジニアリングの目的は、エージェントからモデルへの呼び出しが、モデルがトレーニングデータで見た内容により近くなるようにすることです。
- 評価を実行
NVIDIA Nemotron 3 Ultra は、組み込みの read_file ツールに対するテストに失敗しました。
失敗したテスト:tests/evals/test_file_operations.py::test_read_file_truncation_recovery_with_pagination[nvidiahub:ultra-tme]
失敗内容:
成功チェックが失敗:最終テキストに 'opal-fox-91' が含まれていることを期待しましたが、'x' でした。
軌跡:
ステップ 1:
- read_file {'file_path': '/big.txt'}
ステップ 2:
text: x
read_file ツールは、コーディング、データ分析、スキル表示のようなエージェントタスクに使用される LangChain Deep Agent ハネスの重要な部分です。このタスクでは、/big.txt の最後の空でない行を要求しています。最初の read_file 呼び出しはファイルの最初のページを返しますが、そこには x 値しか含まれていません。正解である 'opal-fox-91' はファイルの後半に現れます。モデルはオフセット/制限によるページネーションで読み続ける必要がありましたが、最初のページの回答から止まってしまいました。
- 修正案の提案
class ReadFileContinuationNoticeMiddleware(AgentMiddleware):
"""ファイルの読み取り結果が続く可能性がある場合、モデルに通知する。"""
name = "ReadFileContinuationNoticeMiddleware"
def wrap_tool_call(self, request, handler):
return self._annotate(request, handler(request))
@staticmethod
def _annotate(request, result):
if not isinstance(result, ToolMessage):
return result
if request.tool_call.get("name") != "read_file":
return result
content = str(result.text)
args = request.tool_call.get("args", {}) or {}
offset = int(args.get("offset", 0))
limit = int(args.get("limit", 100))
n_lines = sum(
1
for row in content.split("\n")
if "\t" in row and row.split("\t", 1)[0].strip().isdigit()
)
if n_lines < limit:
return result
notice = (
f"\n\n[read_file は {limit}行を返しました。これはオフセット {offset} から開始し、1 回の読み取り制限に達しています。ファイルはこのウィンドウを超えて続いている可能性があります。さらに読むには、offset={offset + limit} を指定して read_file を再度呼び出してください。ファイルの末尾に至ったと仮定しないでください。]"
)
return result.model_copy(update={"content": content + notice})
ミドルウェアをハネスプロファイルに追加します:
profile = HarnessProfile(
extra_middleware=[
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
ReadFileContinuationNoticeMiddleware(),
]
)
register_harness_profile("nvidia:nemotron-ultra", profile)
- 修正の検証
新しいプロファイルで失敗していたテストを再実行します:
uv run pytest \
tests/evals/test_file_operations.py \
--model nvidia:nemotron-utlra \
--harness-profile nemotron-ultra
テストが合格したら、プロファイルの変更によって回帰(性能低下)が生じていないか確認するため、評価ベンチマーク全体を再実行してください。ベンチマークとテストはどちらも確率的な性質を持つため、ベースラインと提案された変更の両方を複数回実行することが重要です。
プロファイルファイル読み取りテスト評価ベンチマーク
ベースライン0 / 3平均 94 / 127
ファイル読み取りミドルウェア3 / 3平均 96 / 127
*表 1: 結果は、ファイルミドルウェアが失敗していた 3 つの read_file テストをすべて解決し、全体の評価ベンチマークスコアを 94 から 96/127 に向上させたことを示しています*
変更を確定する前に、過学習(overfitting)の可能性を検討することが重要です。この例では、ファイルページネーションミドルウェアは機械的な修正です。これはモデルに適切なツール呼び出しを行う方法を教えるものです。対照的に、エージェントが「インシデントアラート」と「インシデントトリアージ」を混同したために評価タスクに失敗した場合を想像してください。このような場合、ハネス(harness)に「アラート」や「トリアージ」の定義を追加すると、過学習を引き起こす可能性が高くなります。
ハネスプロファイル作成の自動化
最初の3ステップの手順はループです。ベンチマークを実行し、失敗を読み取り、プロファイルを変更して再度実行します。このようなループこそが、エージェントが無人で実行するのに適している点です。Geoffrey Huntley はこれを「ラルフ・ループ」と呼んでいます:モデルが現在の状態を繰り返し読み取り、1 つの変更を加え、ファイルシステム(会話ではなく)をメモリとして使用します。これはコーディングエージェントのために考案された用語ですが、このパターンは広く適用可能です。
ハネスエンジニアリングも同じループであり、ターゲットが異なるだけです。コードベースをプロファイルファイルに置き換え、テストスイートを評価ベンチマークに置き換えると、その形状は同一になります。変更を提案し、客観的な指標に対して検証し、維持するか破棄するかを決め、これを繰り返します。このプロセスを自動化して安全に行えるのは、評価ベンチマークがあるからです。これはループに真の検証者を与え、提案された変更が測定可能な改善をもたらす場合にのみ採用されるようにします。
LangSmith Engine は、ハネス改善のためのこのループを LangChain が管理するバージョンです。プロダクショントレース内の失敗を検出し、ソースコードに対して根本原因を診断し、修正草案を作成し、回帰が再発しないように評価器を追加します。各提案された変更は、リリース前に人間によってレビューされます。
このセクションの残りは、NemoClaw コミュニティリポジトリで利用可能な LangChain Deep Agents を基盤とした実行可能な参照実装を備えた、同様のアルゴリズムの簡略化版を追跡します。これは意図的に小さく設計されており、ライブトラフィックに対してではなく評価ベンチマークに対して単一のハネスプロファイル(harness profile)を調整するものですが、同様の自己修正ループをエンドツーエンドで実行するため、その仕組みを追体験し、実際に試すことができます。
改善ループ
外側のループは意図的にシンプルに設計されていますが、信頼性の高い改善ループと過学習(overfitting)を起こす機械を分けるのは、いくつかの意思決定です:
- 信じる前に検証する。モデル呼び出しは確率的であり、LLM が判定するベンチマークも同様に確率的です。修正が採用されるのは、同じテストに連続して複数回合格した後だけです。これにより、偶然一度だけ合格した変更をフィルタリングします。
- スナップショットを取得しロールバックする。各試行の前にプロファイルが保存され、その試行が効果を持たない場合は復元されます。これにより、悪い提案によってプロファイルが始点よりも悪化することは決してありません。
- 最後の試行から学ぶ。試行が失敗した場合、ループは次の試行に対して、直前に何を行ったか、そしてどのように失敗したかを正確に引き渡します。これにより、モデルは同じ修正を再度提案するのではなく、アプローチを洗練させます。
- 全体スイートを再チェックする。いかなる修正が適用された後でも、修正されたテストだけでなく、全体のベンチマークが再実行されます。これは回帰(regression)を検出し、新たに解放されたパスによって露呈したテストを表面化させるためです。
このループは、プロファイルが正常に合格するまで、改善が見られないラウンドが1回完全に終了するまで、または反復予算が尽きるまで、ラウンドごとに続行されます。
image*図 1. 改善ループ—ベンチマークを実行し、失敗に対するプロファイル変更を提案し、それを繰り返し検証し、採用するかロールバックするかして、フルスイートを再実行し、これを繰り返す*
エージェント型提案者
興味深いのは「変更を提案する」ステップです。ここではモデルが失敗の説明を受け取り、解決策を探るためのツールを与えられ、プロファイルの変更を提案します。
各提案は、短く制限されたエージェントセッションとして実行されます。エージェントには、書き込み可能なプロファイルのコピーと、読み取り専用の failing テスト(失敗するテスト)、観測されたエージェントの軌跡、および SDK およびベンチマークコードへのアクセス権が与えられます。通常のファイルツール—read(読み取り)、edit(編集)、grep、glob—を用いて、ミドルウェアフックやツールのデフォルト動作を信頼する前にその挙動を確認し、スニペットから推測するのではなく、実際に確認します。その後、診断された失敗に対処するための最小限の変更を行い、何を変更したか、そしてなぜ変更したのかという短い説明を記述します。
エージェントを grounded に保つための 2 つの制約があります。書き込み権限はプロファイルファイルに限定されているため、コンテキストのためにコードベース全体を読み取ることはできますが、チューニング対象となる 1 ファイルのみを変更可能です。また、特定のハックよりも一般的な修正を優先し、あるテストの正確な入力に対して特別処理を行うのではなく、失敗によって露呈したより広範な振る舞いを推論するように指示されています。この区別は、モデルに永続的なスキルを教えることと、単一の答えを暗記させることの差です。
過学習を防ぐために、評価スイートのこの部分を検証セットとして保持するよう指定することもできます。変更を加えるエージェント・ループはこれらのテストを見ることはありませんが、テストの結果スコアを使用してプロファイルの改善を検証します。
以下の省略された出力は、以前に特定された read_file のページネーション障害を解決するために、ディープ・エージェント・ハネスと Nemotron 3 Ultra を対象とした参照実装の実行例を示しています:
$ hep langchain ralph \
--model "openai:nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B" \
--profile examples/deepagents/profiles/nvidia_nemotron_3_ultra.py \
--evals-dir external/deepagents/libs/evals \
--category file_operations \
--ralph-model "anthropic:...:bedrock-claude-opus-4-8" \
--ralph-max-turns 100 \
--max-iters 100 \
--max-iters-per-failure 5 \
--verify-runs 3
[ralph] baseline: 20 passed, 1 failed (correctness: 0.95)
FAILED test_read_file_truncation_recovery_with_pagination
期待された最終テキストに 'opal-fox-91' が含まれているはずでしたが、実際には 'x' でした
ステップ 1: read_file {'file_path': '/big.txt'}
ステップ 2: テキスト:x
[ralph] ラウンド 1 — ページネーション失敗の修正(試行 1/100)
[ralph:proposer] 根本原因:read_file は行単位でページ化(100 行)され、結果としてファイルがその先へ続いているというシグナルが得られないため、モデルは最初のページの最後の行を EOF とみなし、1 回の呼び出し後に回答してしまいました。
修正(テスト固有の値ではなく、プロファイルのレバーを使用):
- ミドルウェア:ページが満杯(行数 == リミット)の場合、次のページへ続けるためのヒントを追加する(オフセット=<最後の行>)。短いページの出現までこれを続け、EOF を示す。
- プロンプト:ファイルの終わりに関する質問に答える前に、ページを EOF まで読み込むこと。
[ralph] 検証 1/3 ✓ 2/3 ✓ 3/3 ✓
[ralph] 修正完了
[ralph] === フルスーイト再実行 ===
結果:21 件合格、0 件失敗(正答率:1.00)
結果:20 → 21 件合格、1 → 0 件失敗
エージェントは失敗の根本原因を特定し、3 回の連続チェックに合格する修正を実装しました。さらに、回帰なしでフルスーイトの再実行も無事に完了しました。
Ultra を他のハーンチスに適応させる
必ず JSON 形式で返してください。translation フィールドのみ。他のフィールド (technical_terms 等) は一切追加しないこと — 余計なフィールドを書こうとして本文翻訳がトークン上限で打ち切られる事故を防ぐため:
{"translation": "翻訳全文"}
この自動化ループに LangChain Deep Agents に固有の要素は存在しません。このフレームワークを用いて Ultra を他のエージェント・フレームワークに適応させるには、3 つのものを公開する必要があります:評価を実行し、各テストごとのパス/フェイル結果と軌跡を報告する方法、プログラムで編集および検証可能なプロファイルまたは設定ファイル、そして編集を提案する最先端品質モデルです。これらがあれば、「提案」「検証」「維持またはロールバック」「再実行」という同じループが変更なく実行されます。
さらに詳しく学ぶ
- LangChain チームが公開した Nemotron 3 Ultra エージェント・ハネスのプロファイルを確認してください。
- Nemotron を含み NVIDIA OpenShell を追加する、LangChain Deep Agents 向けの NVIDIA NemoClaw ブループリントをテストしてください。
- LangChain の開発者は、Baseten、Crusoe Cloud、DeepInfra、Fireworks、Nebius、Together AI プラットフォームで Nemotron 3 Ultra にアクセスできます。
- エージェント・ハネス、モデル、ワークロードを調整して LangChain Deep Agent を最適化し、Deep Research Bench で優勝した方法について探索してください。
- ハンズオン学習モジュールを使用して、最初のディープエージェントを構築してください。
原文を表示
Agentic systems often face a trade-off between accuracy and cost. The highest-performing proprietary frontier models and harnesses provide top accuracy but are expensive. Fine-tuning offers one way to address this problem. Smaller or more efficient open models starting with lower accuracy are taught to perform better with specific agents. However, fine-tuning requires expertise and hardware for training and hosting custom models.
While tuning prompts for specific use cases is common practice, formalizing this process for agent harnesses—and verifying that it produces significantly better results—is more recent. Two developments are making this possible:
- Evaluation benchmarks built specifically for a given harness, making it possible to verify whether a change improves performance.
- Per-model customization entry points, such as LangChain’s agent harness profiles, are a first-of-their-kind example, enabling teams to adapt models to specific agent workflows.
In this tutorial, you’ll create a LangChain Deep Agents harness profile for NVIDIA Nemotron 3 Ultra that matches proprietary frontier model intelligence. All adjustments are made to the agent harness using existing NVIDIA Nemotron 3 Ultra endpoints available from NVIDIA cloud providers.
Prerequisites
- A host with Python and LangChain Deep Agents installed.
- An API key for NVIDIA Nemotron 3 Ultra. For testing, build.nvidia.com provides free API access. For production, consider an endpoint from NVIDIA Cloud Providers such as Baseten, Crusoe, Fireworks, Nebius, or Together AI.
- Recommended: LangSmith account for collecting agent traces
Run evaluations to create a harness profile
LangChain Deep Agents is a popular open-source agent harness. To tune the agent harness for use with a specific model, LangChain provides two important tools:
- An open-source evaluation benchmark.
- Agent harness profiles that provide a first-class extension point for developers to change the agent harness behavior based on the model.
The procedure for tuning a deep agent for NVIDIA Nemotron 3 Ultra is:
- Establish a baseline by running the evaluation benchmark using a deep agent and NVIDIA Nemotron 3 Ultra without a harness profile.
- Analyze the failures.
- Propose changes to the harness profile that address the failures.
- Re-run the benchmark to verify the changes improve the evaluation without introducing regressions.
The types of changes available for the agent harness profile are:
- Prompts: Change the deep agents’ base system prompt, apply a prompt suffix, or change tool descriptions. For example, adding instructions for Nemotron Ultra to prefer clarifying questions or preferring tool results over model recall.
- Exclusions: Tools or middleware to remove.
- Additions: Developers extend the harness with extra middleware or sub-agents, such as middleware that checks for truncated model responses or incorrect tool names.
The goal of harness engineering is to make the calls from the agent to the model more closely resemble what the model saw in the training data.
- Run the evaluation
NVIDIA Nemotron 3 Ultra fails a test for the built-in read_file tool.
Failing test: tests/evals/test_file_operations.py::test_read_file_truncation_recovery_with_pagination[nvidiahub:ultra-tme]
Failure:
success check failed: Expected final text to contain 'opal-fox-91', got: 'x'
Trajectory:
step 1:
- read_file {'file_path': '/big.txt'}
step 2:
text: x
The read_file tool is a critical part of the LangChain Deep Agent harness used for coding, data analysis, and agentic tasks like viewing skills. The task asks for the last non-empty line in /big.txt. The first read_file call returns the first page of the file, which contains only x values. The correct answer, opal-fox-91, appears later in the file. The model needed to continue reading with offset/limit pagination, but answered from the first page.
- Propose a fix
class ReadFileContinuationNoticeMiddleware(AgentMiddleware):
"""Tell the model when a read_file result probably continues."""
name = "ReadFileContinuationNoticeMiddleware"
def wrap_tool_call(self, request, handler):
return self._annotate(request, handler(request))
@staticmethod
def _annotate(request, result):
if not isinstance(result, ToolMessage):
return result
if request.tool_call.get("name") != "read_file":
return result
content = str(result.text)
args = request.tool_call.get("args", {}) or {}
offset = int(args.get("offset", 0))
limit = int(args.get("limit", 100))
n_lines = sum(
1
for row in content.split("\n")
if "\t" in row and row.split("\t", 1)[0].strip().isdigit()
)
if n_lines < limit:
return result
notice = (
f"\n\n[read_file returned {limit} lines starting at offset {offset}, "
f"the per-read limit. The file likely continues past this window. "
f"To read further, call read_file again with offset={offset + limit}. "
f"Do not assume you have seen the end of the file.]"
)
return result.model_copy(update={"content": content + notice})
Add the middleware to a harness profile:
profile = HarnessProfile(
extra_middleware=[
ReadFileContinuationNoticeMiddleware(),
]
)
register_harness_profile("nvidia:nemotron-ultra", profile)
- Validate the fix
Re-run the failing test with the new profile:
uv run pytest \
tests/evals/test_file_operations.py \
--model nvidia:nemotron-utlra \
--harness-profile nemotron-ultra
With the test passing, re-run the entire evaluation benchmark to ensure the profile change did not introduce regressions. The benchmark and tests are both stochastic, so it’s important to run the baseline and proposed change multiple times.
Before finalizing the change, it’s important to consider overfitting. In this example, the file pagination middleware is a mechanical fix. It teaches the model how to make appropriate tool calls. In contrast, imagine the agent failing an evaluation task because it confuses “incident alerts” with “incident triage”. Adding the definition of “alert” or “triage” to the harness could more likely cause overfitting.
Automate harness profile creation
The manual procedure in the first three steps is a loop. Run the benchmark, read the failures, change the profile, run it again. Loops like this are exactly what agents are good at running unattended. Geoffrey Huntley calls this the “ralph loop”: a model repeatedly reads the current state, makes one change, and uses the filesystem—not the conversation—as memory. Although coined for coding agents, the pattern applies broadly.
Harness engineering is the same loop pointed at a different target. Swap the codebase for the profile file and the test suite for the evaluation benchmark, and the shape is identical. Propose a change, check it against an objective signal, keep it or throw it away, and repeat. The evaluation benchmark is what makes this safe to automate—it gives the loop a ground-truth verifier, so a proposed change is only kept if it measurably helps.
LangSmith Engine is LangChain’s managed version of this loop for harness improvement. It detects failures in production traces, diagnoses their root cause against source code, drafts a fix, and adds an evaluator to stop the regression from returning. Each proposed change is reviewed by a human before it ships.
The rest of this section walks through a simplified version of a similar algorithm, with a runnable reference implementation built on LangChain Deep Agents available in theNemoClaw community repository. It is intentionally small—it tunes a single harness profile against an evaluation benchmark rather than live traffic—but it runs a similar self-correcting loop end-to-end, so you can follow the mechanics and try them yourself.
The improvement loop
The outer loop is deliberately simple, but a few decisions are what separate a reliable improvement loop from an overfitting machine:
- Verify before believing. A model call is stochastic, and an LLM-judged benchmark is too. A fix is accepted only after it passes the same test several times in a row, which filters out changes that passed once by luck.
- Snapshot and roll back. The profile is saved before each attempt and restored if the attempt doesn’t help, so a bad proposal can never leave the profile worse than it started.
- Learn from the last try. When an attempt fails, the loop hands the next attempt exactly what it just tried and how it failed, so the model refines its approach instead of proposing the same fix again.
- Re-check the whole suite. After any fix lands, the entire benchmark is re-run — not just the test that was fixed—to catch regressions and to surface tests that a newly unblocked path exposes.
The loop continues round by round until the profile passes cleanly, an entire round produces no improvement, or the iteration budget is exhausted.

The agentic proposer
The interesting part is the “propose a change” step, where the model receives a description of the failure, is given tools to explore solutions, and proposes a profile modification.
Each proposal runs as a short, bounded agent session. The agent gets a writable copy of the profile plus read-only access to the failing test, the observed agent trajectory, and the SDK and benchmark code. With ordinary file tools—read, edit, grep, glob—it can confirm how a middleware hook or a tool default behaves before relying on it, rather than guessing from a snippet. It then makes the smallest change that addresses the diagnosed failure and writes a short explanation of what it changed and why.
Two constraints keep the agent grounded. Its write access is scoped to the profile file, so it can read the whole codebase for context but can only modify the one file under tuning. And it is told to prefer the general fix over the specific hack—to infer the broader behavior a failure exposes rather than special-casing the exact inputs of one test. This distinction is the difference between teaching the model a durable skill and memorizing a single answer.
To further prevent overfitting, you can specify that this part of the evaluation suite should be held out as a validation set. The agent-loop making changes never sees these tests, but the score on the tests is used to validate the profile improvements.
The following abbreviated output shows the reference implementation running against the deep agents harness and Nemotron 3 Ultra to resolve the previously identified read_file pagination failure:
$ hep langchain ralph \
--model "openai:nvidia/NVIDIA-Nemotron-3-Ultra-550B-A55B" \
--profile examples/deepagents/profiles/nvidia_nemotron_3_ultra.py \
--evals-dir external/deepagents/libs/evals \
--category file_operations \
--ralph-model "anthropic:...:bedrock-claude-opus-4-8" \
--ralph-max-turns 100 \
--max-iters 100 \
--max-iters-per-failure 5 \
--verify-runs 3
[ralph] baseline: 20 passed, 1 failed (correctness: 0.95)
FAILED test_read_file_truncation_recovery_with_pagination
Expected final text to contain 'opal-fox-91', got: 'x'
step 1: read_file {'file_path': '/big.txt'}
step 2: text: x
[ralph] round 1 — fixing pagination failure (attempt 1/100)
[ralph:proposer] Root cause: read_file pages by lines (100),
and the result gives no signal the file continues past the
page — so the model treated the first page's last line as
EOF and answered after one call.
Fix (profile levers, not test-specific values):
1. Middleware: when a page returns full (lines == limit),
append a hint to keep paging (offset=<last line>)
until a short page signals EOF.
2. Prompt: page to EOF before answering end-of-file
questions.
[ralph] verify 1/3 ✓ 2/3 ✓ 3/3 ✓
[ralph] FIXED
[ralph] === re-running full suite ===
results: 21 passed, 0 failed (correctness: 1.00)
result: 20 → 21 passed, 1 → 0 failed
The agent diagnosed the failure’s root cause, landed a fix that passed three consecutive checks, and survived the full-suite re-run without regressions.
Adapting Ultra to other harnesses
Nothing in this automation loop is specific to LangChain Deep Agents. To adapt Ultra to other agent frameworks using this framework, expose three things: a way to run evaluations and report per-test pass/fail results and trajectories, a profile or config file that can be edited and validated programmatically, and a frontier quality model to propose the edits. Given those, the same loop—propose, verify, keep or roll back, re-run—runs unchanged.
Learn more
- Review the Nemotron 3 Ultra agent harness profile published by the LangChain team.
- Test the NVIDIA NemoClaw Blueprint for LangChain Deep Agents, which includes Nemotron and adds NVIDIA OpenShell.
- LangChain developers can access Nemotron 3 Ultra on Baseten, Crusoe Cloud, DeepInfra, Fireworks, Nebius, and Together AI platforms.
- Explore how NVIDIA optimized a LangChain Deep Agent to win the Deep Research Bench by tuning the agent harness, model, and workload.
- Build your first deep agent with a hands-on learning module.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み