LangGraph.js v0.2でJavaScriptの信頼できるエージェント構築:クラウドとスタジオをサポート
LangChain は JavaScript/TypeScript 向けの LLM エージェント構築フレームワーク「LangGraph.js v0.2」をリリースし、ストリーミング機能の強化、チェックポイントシステム、人間介入サポート、並列ノード対応に加え、Studio と Cloud のベータ版をサポートした。
キーポイント
高度な制御とデバッグ機能の追加
中間ステップやチャットメッセージの柔軟なストリーミング、過去の状態への巻き戻しを可能にするビルトインチェックポイントシステムが実装された。
人間による介入(Human-in-the-loop)の正式サポート
グラフ内の任意の時点で処理を中断・更新・再開できる機能により、より信頼性の高いエージェント構築が可能になった。
並列実行と開発環境の統合
複数のノードを同時に実行して結果を結合する並列ノードサポートに加え、デスクトップ用 IDE「LangGraph Studio」とスケーラブルなインフラ「LangGraph Cloud」のベータ版が提供された。
影響分析・編集コメントを表示
影響分析
このリリースは、JavaScript エコシステムにおける LLM エージェント開発の成熟度を決定づける重要な転換点です。特に「人間による介入」や「チェックポイント機能」の強化により、実務で求められる信頼性のあるエージェント構築が現実的なものとなり、開発現場での採用加速が期待されます。
編集コメント
JavaScript 開発者が複雑なエージェントロジックを扱う際のハードルが下がり、実運用レベルの信頼性を確保する機能が標準装備された点は非常に評価できます。
本日、LLM搭載エージェントの構築を支援するJavaScript/TypeScriptフレームワーク「LangGraph.js v0.2.0」https://github.com/langchain-ai/langgraphjs?ref=blog.langchain.comをリリースいたします。今回の新機能は以下の通りです。
- 異なるストリーミングモードによる中間ステップやチャットモデルメッセージの柔軟なストリーミング
- 過去の状態への巻き戻しや、誤ったモデル応答などのエラーデバッグを可能にする組み込みチェックポイントシステム
- グラフ内の任意の地点で中断、内部状態の更新、再開を可能にする第一級の人間関与(ヒューマンインザループ)サポート
- 複数のノードから結果を同時に実行・結合するための並列ノードサポート
さらに、デスクトップ向けエージェントIDEであるLangGraph Studioおよびエージェントのデプロイメントを支援するスケーラブルなインフラストラクチャであるLangGraph Cloudにおいて、LangGraph.jsプロジェクトのベータサポートも開始しました。
LangGraph.jsはすでにトップクラスのAIチームを支援し、重要な課題に取り組んでいます。Elasticのセキュリティアナリティクス部門における生成AIおよびML担当ディレクター、ジェームス・スピテリ氏は以下のように述べています:
*LangGraph.jsおよびLangChainエコシステム全体は、Elasticのセキュリティ向けAIアシスタント「Attack Discovery and Automatic Import」のアーキテクチャにおいて重要な要素であり、これらの機能*https://www.elastic.co/security/ai?ref=blog.langchain.com*を記録的な速さでプロダクション環境へ展開し、反復開発を可能にしています。LangChainチームによる継続的な改善と協働には感銘を受けており、LangChainとの連携をさらに強化していくことを楽しみにしています。*
JavaScriptコミュニティにとって、これらの新機能は、信頼性の高いエージェントの構築、デバッグ、展開のためのより強力なループを実現します。
扱うべき内容が多岐にわたるため、早速見ていきましょう!
JavaScriptでLangGraph 0.2を用いて制御可能なエージェントを構築する
従来のAPIとは異なり、大規模言語モデル(LLM: Large Language Model)は、その長時間実行かつ非確定的な性質により、開発者にとって独自の課題を突きつけます。ロジック内のLLM呼び出し数が増加し、特にモデルにコード実行の自律性を付与するエージェントステップを導入すると、これらの課題はさらに複雑化します。
LangGraph.jsは、JavaScript開発者に対して、こうした複雑さに対処し、エージェントに関する魅力的な体験を創出するための強力なツールキットを提供します。LangGraph.jsは、アプリケーションの以下の点を改善できます:
- 応答性:結果をトークン単位でストリーミングすることで、リアルタイムのインタラクティブな体験を提供し、進捗状況を即座に報告できます。即時のフィードバックと滑らかなユーザー体験が求められるウェブアプリケーションにおいて、ストリーミングの多様なモードは極めて重要です。
- 耐障害性:ノードレベルのリトライポリシーとチェックポイントを使用することで、アプリケーションの堅牢性を確保します。サービスがダウンしたりステップが失敗したりした場合でも、アプリケーションはシームレスに回復し、以前の状態から実行を再開できます。
- アクセス制御:機密性の高いツールへのアクセスには人間の承認を必須とします。これにより、アプリケーションを保護し、意図しない結果のリスクを軽減できます。
LangGraph.js は、Node、Deno、Cloudflare Workers、Vercel の Edge ランタイムに加え、@langchain/langgraph/web エントリポイントを通じてブラウザ内での実行も可能など、ほとんどの JavaScript ランタイムで動作します。
新しいハウツーガイド、チュートリアル、概念ガイドを含む刷新されたドキュメントをご覧ください。これらは初心者向けのサポートに役立ちます。最新の変更やドキュメントの更新内容の概要については、こちらの要約も参照してください。
LangGraph Studio で反復とデバッグを高速化
LangGraph Studio は、エージェントのデバッグにおいて最高クラスの体験を提供します。非同期操作を含む動的な TypeScript / JavaScript 環境では、データのフローを理解することがしばしば困難であり、LLM(大規模言語モデル)搭載のエージェントがさらに分岐ロジックの複雑さを加えます。
LangGraph Studio は、TypeScript の型推論を使用してグラフの入力と出力を自動的に検出し、ロジックの明確な視覚的概要を提供します。これにより、異なるデータフローを手動で追跡する必要がなくなり、デバッグが簡素化されます。
テスト時には、個々の状態に移動して再実行することができます。これにより、アプリケーション全体を再起動することなく、問題の特定と修正が可能になります。また、インターラプト(中断)を設定してロジックをステップ実行し、コードがどのように段階的に実行されるかを検査することもできます。LangGraph Studio はホットリロードにも対応しており、変更をリアルタイムで適用して開発を加速させることができます!
LangGraph Studio が LangGraph.js をサポートするようになったことをお知らせします。LangGraph Studio は現在ベータ版であり、ベータ期間中はすべての LangSmith ユーザーに無料でご利用いただけます。最新のリリースは こちら からダウンロードでき、JavaScript のスターターテンプレートについては このリポジトリ をご確認ください。**
既存のグラフがある場合は、LangGraph.js と LangChain コアを最新バージョンに更新し、ファイルからグラフをエクスポートして、パスとメタデータを含む langgraph.json ファイルを追加する必要があります。
LangGraph Cloud で大規模デプロイ
ローカルで LangGraph.js のグラフを完成させたら、LangGraph Cloud上でワンクリックでデプロイできます。Webスケールに対応して設計された LangGraph Cloud は、タスクキューとサーバーの管理・プロビジョニングを支援し、エージェントが多数の同時ユーザーや高トラフィックを処理できるようにします。
本番環境での問題診断には、LangGraph Cloud が LangSmith と統合され、詳細なトレーシングを提供し、組み込みの Postgres チェックポインタを使用します。このオプトアウト(初期設定)のチェックポインタは状態とスレッドを保存するため、以前の状態に巻き戻して再実行でき、ローカルで開発しているかのようにトラブルシューティングや問題の再現が可能になります。
さらに、LangGraph Cloud はストリーミングやヒューマンインザループを超えた高度な実世界の相互作用パターンをサポートしています。これには、グラフのアクティブなスレッド上で新しいユーザー入力を処理するためのダブルテキスト送信機能、長時間実行されるタスクを管理する非同期バックグラウンドジョブ、スケジュールされたプロセスを自動化するための cron ジョブなどの機能が含まれます。
LangGraph Cloud が現在、Plus 契約または Enterprise 契約の LangSmith ユーザー全員を対象にベータ版として提供されています。今すぐ LangSmith へのサインアップ を行って、無料でお試しください。
次のステップは?
これは始まりに過ぎません。長期的には、LangGraph.js が JavaScript でエージェントを構築するための最も魅力的な方法となるよう、私たちはコミットしています。
私たちはコミュニティの声とフィードバックに密接耳を傾けており、すでに LangGraph.js を本番環境で運用しているユーザーも多数います。あなたの意見をお聞かせください。X で私たちとつながる か、コミュニティ Slack ワークスペース にご参加ください。
原文を表示
Today, we’re launching LangGraph.js v0.2.0, our JavaScript/TypeScript framework for building LLM-powered agents. Here’s what’s new:
- Flexible streaming of intermediate steps and chat model messages with different streaming modes
- A built-in checkpointing system that lets you to rewind to past states and debug errors like faulty model responses
- First-class human-in-the-loop support that allows you to interrupt, update internal state, and resume at any given point in the graph
- Parallel node support to run and combine results from multiple nodes simultaneously
We’re also introducing beta support for LangGraph.js projects in LangGraph Studio, our agent IDE for desktop, and LangGraph Cloud, our scalable infrastructure for deploying agents..
LangGraph.js is already empowering top AI teams to tackle critical problems. James Spiteri, Director of Generative AI & ML for Security Analytics at Elastic highlights that:
LangGraph.js and the entire LangChain ecosystem have been key pieces in our architecture in Elastic’s AI Assistant for Security, Attack Discovery and Automatic Import, helping us iterate and push these features to production in record time. We’ve been impressed by the continual improvements and collaboration from the LangChain team, and are excited to continue building with LangChain.
For the JavaScript community, these new features unlock an even more powerful loop for building, debugging, and deploying reliable agents.
There’s a lot to cover, so let’s dive in!
Build controllable agents with LangGraph 0.2 in JavaScript
Unlike traditional APIs, LLMs pose unique challenges to developers due to their long-running, non-deterministic nature. These challenges compound as the number of LLM calls in your logic increases, especially as you introduce agentic steps that give models autonomy over your code execution.
LangGraph.js provides JavaScript developers with a powerful toolkit for addressing these complexities and creating delightful experiences around agents. LangGraph.js can improve your application’s:
- Responsiveness: By streaming results token-by-token, you can deliver real-time, interactive experiences and report progress immediately. Having various modes of streaming is crucial for web apps that demand instant feedback and smooth user experience.
- Resilience: Using node-level retry policies and checkpointing, ensure your app stays robust. If a service goes down or a step fails, your app can recover seamlessly and resume execution from previous states.
- Access control: Restrict sensitive tools to require human approval. This lets you protect your application and reduce the risk of unintended consequences.
LangGraph.js also runs in most JS runtimes, including Node, Deno, Cloudflare Workers, Vercel’s Edge runtime and even in the browser through the @langchain/langgraph/web entry point.
Check out our revamped documentation for new how-to guides, tutorials, and conceptual guides that help you get started. For an overview of the latest changes and updates to the documentation, you can also view a summary here.
Iterate and debug faster with LangGraph Studio
LangGraph Studio provides a best-in-class experience for debugging agents. In dynamic TypeScript / JavaScript environments involving async operations, it’s often tough to understand the flow of data– with LLM-powered agents adding further branching logic complexity.
LangGraph Studio automatically detects your graph’s inputs and outputs using TypeScript's type inference, giving you a clear visual overview of your logic. This eliminates the need to manually trace different data flows and simplifies debugging.
When testing, you can travel back to individual states and rerun them. This lets you identify and fix issues without restarting the entire application. You can also set interrupts to step through your logic and inspect how your code is executing step-by-step. LangGraph Studio even supports hot reload to apply changes in real-time and speed up development!
We’re excited to announce that LangGraph Studio now supports LangGraph.js. LangGraph Studio is currently in beta, and is free to all LangSmith users during the beta period. You can download the latest release here and check out this repo for a JavaScript starter template.
And if you have an existing graph, you’ll need to update to the latest versions of LangGraph.js and LangChain core, then export your graph from a file and add a langgraph.json file with the path and some metadata.
Deploy at scale with LangGraph Cloud
Once you've perfected your LangGraph.js graphs locally, you can deploy them in one-click on LangGraph Cloud. Designed for web-scale, LangGraph Cloud helps you manage and provision task queues and servers so that your agents can handle many concurrent users and high traffic.
For diagnosing issues in production, LangGraph Cloud integrates with LangSmith for detailed tracing and uses a built-in Postgres checkpointer. This out-of-the-box checkpointer stores states and threads so that you can rewind and rerun previous states, allowing you to troubleshoot and replicate issues as if you were developing locally.
In addition, LangGraph Cloud supports advanced real-world interaction patterns beyond streaming and human-in-the-loop. These include features like double-texting to handle new user inputs on active threads of the graph, async background jobs to manage long-running tasks, and cron jobs to automate scheduled processes.
LangGraph Cloud is now available in beta for all LangSmith users on Plus or Enterprise plans. Try it out today for free by signing up for LangSmith.
What’s next?
This is just the beginning - we’re committed to making LangGraph.js the most delightful way to build agents in JavaScript in the long run.
We’re closely listening to the community and their feedback, many of whom are already running LangGraph.js in production – and we invite you to share your thoughts. Connect with us on X, or join our community Slack workspace.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み