LangGraph で 3 年間のグラフ工学の知見
LangChain Blog は「Graph Engineering」という新用語の背景を解説し、LLM エージェントの非確実性を制御するためにグラフ構造を用いる LangGraph の設計思想と、その業界における重要な役割について詳述している。
キーポイント
Graph Engineering という新トレンドの定義
プロンプトエンジニアリングやループエンジニアリングに続く用語として「Graph Engineering」が浮上しており、これは単なるバズワードではなく、構築者が直面する実際の課題と設計判断を記述するための実用的な概念である。
LLM の非確実性に対する制御手段
LLM は非堅牢で非決定論的なソフトウェアであるため、グラフ構造を用いることで構築者が事前に定義したワークフロー(特定のパス)を強制し、エージェントの振る舞いをより厳密に制御可能にする。
LangGraph の設計哲学と市場地位
3 年前から開発されている LangGraph は、決定論的なパスと自律的なステップ(アジェンシー)のバランスを取ることで人気を集め、現在月間 6500 万回以上のダウンロードを記録している。
エージェントシステムのグラフモデル化
エージェントをグラフとしてモデル化することで、ノードが作業を実行する具体的なワークフローを定義でき、複雑なシステム構築における構造化と制御の基盤となる。
重要な引用
"Graph engineering" is a very reasonable way to harness the power of LLMs.
They are a new type of non-robust, non-deterministic software and we're constantly trying new strategies to get them to work.
LangGraph rose in popularity because of the balance it strikes between deterministic paths and agentic steps.
影響分析・編集コメントを表示
影響分析
この記事は、LLM エージェント開発における「Graph Engineering」という概念を明確に定義し、単なる流行語ではなく、非確実性を持つ AI システムを制御するための重要な設計手法であることを強調しています。LangGraph の成功事例を通じて、業界が「自律的な判断」だけでなく「構造的な制御」の重要性を再認識している現状を示しており、今後のエージェントアーキテクチャの標準化に大きな影響を与える可能性があります。
編集コメント
「Graph Engineering」という用語が、LLM の非決定論的な性質を克服するための具体的な設計アプローチとして確立されつつある点に注目すべきです。LangChain が提示する LangGraph の成功は、単なるツールの普及を超え、複雑なエージェントシステムを構築する際の標準的な思考法へと変化していることを示しています。
今週末、この ツイート をきっかけに「グラフエンジニアリング」という言葉が注目されました。

これは、プロンプトエンジニアリング、コンテキストエンジニアリング、ハーネスエンジニアリング、ループエンジニアリングに続く、X(旧 Twitter)の AI コンテンツファクトリーから生まれた最新の用語です。これらを単なる流行語だと片付けたくなるのも無理はありませんが、これらの言葉が存在し、広まっているのには理由があります。それらは、開発者が直面する現実的な課題や設計上の判断を的確に表しているからです。
結局のところ、LLM(大規模言語モデル)の力を活用して実用的な成果を出すことが目標です。プロンプトを使うか、エージェントやループ、あるいはグラフを採用するかは、あくまで実装の詳細の問題に過ぎません。LLM を使って作業をさせるのがなぜこれほどまでに難しいのか、そしてなぜこれほど多くの用語が生まれるのかといえば、LLM は新しいタイプの「非堅牢で非決定論的なソフトウェア」だからです。私たちは常に、これを動かすための新たな戦略を試しており、その結果として新しい流行語が生まれていくのです。
流行語の喧騒を置いておいても、「グラフエンジニアリング」、つまりエージェントシステムをグラフとして表現することは、LLM の力を引き出す非常に合理的な方法です。具体的には、開発者であるあなたが「このシステムはこうあるべきだ」という先入観や設計思想を、より制約されたパスに反映させることができます。これは LLM の判断だけに頼るのではなく、人間が制御できる道筋を設けることを意味します。つまり、エージェントに特定の経路をたどらせたい場合など、振る舞いをより厳密にコントロールできるようになるのです。
この直感こそが、3 年前に LangGraph の構築へと繋がりました。これは、このようなエージェント型システムを構築するためのフレームワークとして設計されたものです。
現在、LangGraph は月間 6,500 万回以上ダウンロードされており、スタートアップから大企業まで幅広く利用されています。
数ある他のエージェントフレームワークと比較して、LangGraph が人気を集めた理由は、決定論的なパスとエージェント型のステップの間に適度なバランスを保っている点にあります。
グラフとしてエージェントを構築する中で、私たちは数年にわたり多くのことを学びました。
エージェントをグラフとしてモデル化する
グラフを用いることで、エージェントが従うワークフローを具体的に定義できるようになります。
LangGraph において ノード は実際に処理を行います。ノードは決定論的なコード、1 つの LLM(大規模言語モデル)呼び出し、ツール呼び出し、あるいは内部ループを持つ完全なエージェントそのものになり得ます。
エッジ は次に何が起こるかを定義します。エッジには決定論的なものと、ノードの結果や現在の状態、外部からのシグナルに基づいて分岐する条件付きのものがあります。
これは状態機械(ステートマシン)と考えることができます。グラフがワークフローを定義し、その中を移動する状態と、ステップ間の遷移を記述します。
エージェントをグラフで表現すべきタイミング
現実世界のエージェントワークフローには、予測可能な構造が存在します。サポートエージェントはまず課題を分類し、その後回答するかエスカレーションするかを決めます。コーディングエージェントも、変更案を提案する前にリポジトリを検査します。コンプライアンスワークフローでは、外部アクションを実行する前に承認が必要です。
グラフを使えば、こうした構造を直接記述できます。どのパスが有効か、モデルが選択できる箇所はどこか、そしてモデルに毎回正解を期待するのではなく、システム側で決定論的な振る舞いを強制すべき箇所はどこかを明確に定義できるのです。
システムをグラフとして表現することは、そのシステムがどのように動作すべきかという世界知識をコードに埋め込む行為です。プロンプトがドメイン知識を含み、汎用的な ChatGPT とは異なるエージェントを構築するのと同様に、これらの「認知アーキテクチャ」も同様の役割を果たします。
例えば、検索に 3 つのサブエージェントを活用するナレッジベースエージェントを考えてみましょう。コードやイシュー、プルリクエストには GitHub エージェント を、社内ドキュメントやウィキには Notion エージェント を、関連スレッドには Slack エージェント を使います。このワークフローは「分類」「検索」「統合」という 3 つの固定ステージで構成されます。
こうしてコードとモデルの推論が連携します。価値を生む箇所ではモデルに推論を任せ、それ以外はコードが処理する。その結果、エージェントはより安価で高速になり、予測可能性も高まります。
グラフを使うべきでないケース
タスクによっては、本質的にエージェント性が強く求められるものがあります。そのような場合、決定論的なパスに無理やり当てはめるのは逆効果です。システムをグラフとして表現するのではなく、エージェント・ハーネス(例:Deep Agents)を活用すべきです。
汎用的な深層調査(deep research)はその好例です。調査エージェントは、計画立案、委任、検索、読解、統合といったタスクを事前に特定しにくい方法で実行する必要があります。私たちは当初、事前定義された LangGraph ワークフローを用いて深層調査を実装していましたが、よりエージェント性の高いコア・ループへと移行しました。
人気のある深層調査の実装である GPT Researcher も同様の転換を行いました。グラフ形状のマルチエージェント・パイプラインを Deep Agents に置き換え、計画や委任、コンテキスト管理といった機能をハードコードされたグラフから、ハーネス内で自律的に発生する形へと変更したのです。
LangGraph の構築から得た教訓
私たちは過去 3 年間、グラフで駆動されるエージェントの構築に取り組んできました。その過程で得られた知見をいくつか紹介します。
第一に、エージェント用のグラフは通常、有向非巡回グラフ(DAG)ではありません。
実運用におけるエージェントには、ループ処理が不可欠です。失敗したツール呼び出しの再試行、ユーザーからの不足情報への問い合わせ、検証後の回答修正、十分な文脈が揃うまでのツール連続呼び出し、そして人間の入力を待ってから再開する一時停止など、これらはすべてループの一部です。ループはエージェントシステムの核心部分であり、そのためシステムは必ずしも有向非巡回グラフ(DAG)である必要はありません。
第二に、ループは単純なグラフです。
Loop engineering はグラフの代替案というよりも、むしろその簡易版と言えます。David Khourshid 氏も指摘している通り As David Khourshid put it、ループとは単に有向で循環するグラフのことです。実際、シンプルなエージェントループを基盤とする LangChain フレームワークも、LangGraph 上に構築されています。
第三に、動的な遷移が重要です。
すべてのエッジを事前に定義する必要はありません。あるノードが実行時に処理量を決定するケースもあるからです。マッピングとリダクション(Map-reduce)は古典的な例で、入力を分割して各ピースをワーカーに送り、結果を結合します。この場合のワーカー数は入力によって変動するため、事前にその数を把握することはできません。
LangGraph は Send を用いてこれに対応し、ノードが静的にすべての遷移を定義するのではなく、実行時に下流のノードへ動的に作業をルーティングできるようにしています。
これは重要です。有用なエージェントシステムは、既知の構造と実行時の可変性を組み合わせているからです。
「研究では情報を収集して統合すべきだ」ということは知っていても、実際に何件のソースが必要かはわからないかもしれません。「スーパーバイザーがワーカーにタスクを委任するべきだ」という原則は知っていても、どの特定のワーカーを使うかはタスクが始まるまでわかりません。グラフ構造にも、実行時の柔軟性が求められます。
何が本当に新しいのか
エージェントシステムをグラフとして表現すること自体は古くからあり、すでに3年間行われています。「グラフエンジニアリング」という新たな波の中で、いったい何が変わったのでしょうか?
寛容に解釈すれば、変化したのは「ノード内に何を詰め込めるか」です。初期の頃は、ノードは決定論的なコードか、LLM(大規模言語モデル)への単一呼び出しに限られていました。しかし現在では、エージェント自体が信頼性を持って実務を任せるのに十分になったため、ノードには「エージェントの実行全体」を含めることが可能になりました。つまり、LLM の呼び出しを調整するだけでなく、エージェント自体をオーケストレーションしているのです。
コーディングエージェントはこの好例です。現在、生産環境で最も効果的で影響力のあるエージェントの一つであり、それをより大きなグラフのノードとして埋め込むというパターンが、ようやく実用的なものとなりました。
例えば、Slack 上のリクエスト(以下参照)をドキュメント作成エージェントが受け取り、

レビュー待ちのプルリクエストとして出力するケースがあります。
このグラフの各ノードは、決定論的から自律的なまでのスケール上で異なる位置に存在します。
- 固定ステップ:スラック処理と線形演算は、事前に定義されたコードと API 呼び出しによって実行されます。
- モデルステップ:分類器と合成ステップでは、ツールを使用せず単一の LLM(大規模言語モデル)呼び出しが行われます。
- エージェントステップ:リファレンスドキュメント用エージェントとコンセプトドキュメント用エージェントは、それぞれのコードベースにおいてより自由度の高い作業を遂行します。
このように決定論性と自律性を組み合わせることで、ドキュメント作成エージェントは予測可能かつ強力でありながら効率的に動作するのです。
大きな視点
グラフエンジニアリング自体は新しい概念ではありません。これは信頼性の高いエージェントを構築するための確立されたアプローチの最新の名前です。
これは ループエンジニアリング や ハネスエンジニアリング の背後にある考え方と同じで、各ステップにおいてモデルの推論を適切な場所に、適切なコンテキストとともに配置するアプローチです。
グラフエンジニアリングを試してみたい場合は、LangGraph をぜひお試しください。
原文を表示
"Graph engineering" surfaced this weekend, kicked off by this tweet:

It's the latest term to come out of X's AI content factory, joining prompt engineering, context engineering, harness engineering, and loop engineering. While it’s both tempting and accurate to call these terms buzzwords, they exist and emerge for a reason: they do describe real challenges and design decisions builders face.
At the end of the day, the goal is to harness the power of LLMs to do useful things for us. Whether you use prompting or agents or loops or graphs, those are implementation details. The reason so many terms exist that getting LLMs to do work is hard. They are a new type of non-robust, non-deterministic software and we’re constantly trying new strategies to get them to work. And these new strategies lead to new buzzwords.
Buzzwords aside, representing agentic systems as graphs (”graph engineering”) is a very reasonable way to harness the power of LLMs. Specifically, it allows you (as the builder) to impose your preconceptions of how the system should work into more constrained paths, not relying solely on the judgement of the LLM. More concretely, it lets you more tightly control behavior when you want the agent to follow specific paths.
This intuition drove us to build LangGraph three years ago, as a framework to help build these types of agentic systems. Today, LangGraph is downloaded 65M+ times a month, and used by startups and enterprises alike.
Compared to the myriad of other agent frameworks out there, the reason LangGraph rose in popularity is because of the balance it strikes between deterministic paths and agentic steps.
Here’s what we’ve learned from years of building agentic systems as graphs.
Modeling agents as graphs
A graph gives you a concrete way to define the workflow an agent follows.
In LangGraph, nodes do work. A node can be deterministic code, a single LLM call, a tool call, or a full agent with its own internal loop.
Edges define what happens next. Some edges are deterministic. Others are conditional, based on the result of a node, the current state, or some external signal.
You can think of this as a state machine. The graph defines the workflow, the state that moves through it, and the transitions between steps.
When to represent agents as graphs
Real-world agent workflows often have predictable structure: a support agent classifies an issue before answering or escalating, a coding agent inspects the repository before proposing a change, and a compliance workflow requires approval before taking an external action.
Graphs let you encode that structure directly: the valid paths, where the model gets to choose, and where the system should enforce deterministic behavior instead of hoping the model makes the right call every time.
By representing the system as a graph, you are encoding your world knowledge of how this system should work. Just as prompts contain domain knowledge that separates your agent from generic ChatGPT, so can these “cognitive architectures”.
Take a knowledge base agent that uses three subagents for search: a GitHub agent for code, issues, and pull requests, a Notion agent for internal docs and wikis, and a Slack agent for relevant threads. The workflow has three fixed stages: classify, search, synthesize.
The result is code and model reasoning working together: the model reasons where it adds value, code handles the rest, and the agent gets cheaper, faster, and more predictable.
When not to use graphs
Some tasks are more agentic by nature, and forcing them into deterministic paths is the wrong move. In these cases, you don’t want to represent the system as a graph but rather just use an agent harness (like Deep Agents).
Generic deep research is a good example: a research agent needs to plan, delegate, search, read, and synthesize in ways that are hard to pin down ahead of time. We built early deep research on predefined LangGraph workflows, then moved to a more agentic core loop. GPT Researcher, a popular deep research implementation, made the same move, swapping its graph-shaped multi-agent pipeline for Deep Agents so planning, delegation, and context management emerge in the harness rather than being hardcoded in the graph.
What building LangGraph taught us
We've been building agents powered by graphs for the last three years. Here's what we've learned.
First, agent graphs are usually not DAGs.
Production agents need cycles: retrying failed tool calls, asking users for missing information, revising answers after validation, calling tools repeatedly until they have enough context, and pausing for human input before resuming. Looping is a core part of agentic systems, so they are likely not DAGs.
Second, loops are simple graphs.
Loop engineering isn't an alternative to graphs, so much as a simple version of them. As David Khourshid put it, a loop is just a directed, cyclic graph. In fact, the LangChain framework, which is based on a simple agentic loop, is built on top of LangGraph.
Third, dynamic transitions matter.
You do not always want to define every edge up front. Sometimes a node decides at runtime how much work to create. Map-reduce is the classic case: split an input into pieces, send each to a worker, then combine the results. The number of workers depends on the input, and you do not know that number in advance.
LangGraph handles this with Send, which lets a node route work to one or more downstream nodes dynamically, without statically defining every transition.
This is important because useful agent systems mix known structure with runtime variability. You might know research should fan out and then synthesize, but not how many sources there will be. You might know a supervisor should delegate to workers, but not know which specific workers to use until the task starts. Graphs still need flexibility at runtime.
What's actually new
Representing agentic systems as graphs isn't new, we've been doing it for three years! Has anything changed in this new wave of “graph engineering”?
A generous interpretation would say that what's changed is what you can put inside a node. Early on, nodes were deterministic code or a single LLM call. Now that agents themselves are reliable enough to trust with real work, a node can be a full agent run — you're orchestrating agents, not just LLM calls.
Coding agents are a good example of this. They're some of the most effective and impactful agents in production today, and embedding one as a node inside a larger graph is a newly practical pattern.
Consider a docs agent that turns a slack request, like this:

Into a ready for review pull request:
Each node in this graph sits at a different point on the deterministic-to-agentic scale:
- Fixed steps: the slack and linear operations are powered by set code and API calls.
- Model steps: the classifier and the synthesize step use a single LLM call with no tools.
- Agent steps: the reference docs agent and the conceptual docs agent complete more open ended work in their relevant codebases.
The mix of determinism and agency here is what makes this docs agent predictable, powerful, and efficient.
The bigger idea
Graph engineering isn't a new idea. It's the latest name for a well established approach to building reliable agents.
It's the same idea behind loop engineering and harness engineering: building putting model reasoning in the right places, with the right context, at each step.
If you want to try out graph engineering, try out LangGraph.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み