グラフエンジニアリング解説(マーケティング編)
グラフエンジニアリングとは、エージェントが動き回る「地図」を設計することだ。事前にステップとステップ間のルートを描いておき、エージェントはあなたが敷いた道を進む
これは「ループ」の一歩先にあるレイヤーで、ループでは1体のエージェントが1つのタスクを、あなたが設定した基準を満たすまでぐるぐる回るだけだ
すべてのエージェントグラフは4つの要素からできている:
> ノード:作業が通過する段階。リサーチ、下書き、採点、公開など。一度だけ実行されるものもあれば、その段階がクリアするまでエージェントが自分でループするものもある
> ルート:あらかじめノード間に描いておく経路。作業が進める全方向
> チェックポイント:各ルート上にあるチェック機構。結果を読み取り、クリアすれば先に進め、失敗すれば前のノードへ戻す
> ゲート:作業がスキップできないチェックポイント。下書きが評価基準をクリアするまで、何も公開されない
n8nでワークフローを組んだことがあるなら、あなたはすでにこれを描いたことがある。つなげたノード、条件で発火する分岐、クリアするまでループするステップ
エージェントグラフはそれと同じ形だが、各ノードにはn8nなら単一のAPI呼び出しに任せる作業を、エージェントがこなしている
私のエージェンシーで運用しているコンテンツグラフもすべてこの形をしている。ここにSEO向けに構築できる一例を示す
> 1 リサーチ:キーワード、検索意図、そのキーワードで上位表示している競合、人々が繰り返し尋ねている質問を集める
> 2 ブリーフ:そのリサーチを、切り口・カバーすべきエンティティ・記事が答えるべきクエリを含むブリーフに変換する
> 3 ドラフト:エージェントがブリーフだけを文脈にして記事を書く
> 4 採点:批評エージェントが評価基準(深さ、意図の一致、独自性)に照らして下書きを採点する。このノードはループで、弱い下書きは3に戻され、基準をクリアしたものだけが通される
> 5 公開:評価基準をクリアし、ブランドルールも通過したら、エージェントが内部リンクを追加して記事が公開される
それぞれの矢印がルートであり、すべての採点がチェックポイントとなって、作業が次にどのルートを進むかを決める。ドラフトと採点のノードは、より大きな地図の中にある小さなループを形成し、他のノードは一度だけ実行される
ここで「グラフ」という言葉が誤解を招き始める。そのドラフトと採点のループは、それ自身の中で完結してしまうことがある。批評エージェントが下書きを気に入り、評価基準をクリアし、公開される、それでも一切ランクインしないままだ。そのループは、他のエージェントの「意見」に対して文章を採点していただけで、本当に重要なのは「実際にランクしたかどうか」だけだった
だからこそ、エージェントたちが言い逃れできないチェックポイントを追加する。グラフの外側にある、実際の検索とAEOのシグナルを読み取るものだ:
> Googleにインデックスされたか
> ターゲットクエリで順位が上がっているか
> AIの回答がこれを引用しているか
> 訪問者が滞在しているか
これらが動けば、地図はそのままの形を保ち、次のキーワードを投入する。停滞が起きれば、作業をリサーチへ戻す。なぜなら、この段階での失敗は大抵、最初に選んだ切り口や意図に原因があり、書き直しでは直せないからだ
地図は、エージェントが偽造できない「結果」に固定し、彼らが決して書き換えないルール、つまりあなたのブランドボイスと、言ってはいけない主張だけは、少数に絞って凍結しておく
この土台があれば、失敗した記事は、どのノードで壊れたのかを正確に示してくれる
Shann³@shannholmberg
what's the difference between a loop and a graph? (marketing edition)
both are ways to run an agent, the difference is who decides the path, the agent or you.
a loop still starts with you. you set the goal, the brief, and the bar it has to clear. what the agent owns is the path.
take writing an SEO article: hand it the brief and it drafts, reads the draft back against that brief, rewrites the weak parts, checks again, and keeps circling until it clears the bar. the one thing you did not write is the step-by-step it took to get there.
a graph is you drawing the steps and the routes between them ahead of time. same article, but now you set the map: research the keyword and the competitors ranking for it. draft from what you find. score that draft against your rubric.
if it clears, add the internal links and publish. if it misses, back to the draft. the agent still decides how to handle each step, it just travels the routes you laid down.
the shape of this has a name, a state machine. every node is a state the work can be in, and a check at each one decides where it goes next, forward when it clears or back to an earlier node when it misses.
if you have built a workflow in n8n, you have already drawn one. nodes wired together, branches that fire on a condition, a step that loops until it clears, that picture is a graph. an agent graph is the same shape, the nodes hold agents doing the work instead of single api calls.
the way I think about it, a graph is a map of loops and checkpoints. some nodes run once, others are their own loop where the agent works something out, and the checkpoints between them read the result and route the work. you keep laying down nodes and checkpoints until the map reliably gives you the output you want.
the vault accelerator I run at my agency is one of these maps, 3 sessions that hand off in a fixed order:
> research session: reads our company brain and past campaign results, pulls in competitor and market context, and builds the cohort we go after
> landing page session: takes that research and builds the page from it
> content session: uses the research and the page to write the copy, illustrations, and slides for the live sessions we run
inside the content session runs a loop, a critic scores each draft against a rubric and sends it back until it clears the bar. that is one node on the map, the checkpoints between the sessions carry the work from one to the next
a graph earns its extra setup on anything you run every week:
> validation gates the work cannot skip
> a fixed set of routes the job can take
> a clear failure point, you see the exact step something broke on
a loop on its own is enough for the work you only do once, where you don't know the path yet, let the agent find it. graphs earn their place on the jobs you repeat, the content pipeline, the SEO and AEO funnel step by step, the vault accelerator
once the map works you reuse it, feed it the next cohort and the whole pipeline runs again
past the loop, the next thing you design is the map it runs inside.