エージェントは構造と柔軟性の間で選択できない
エージェント仕様の設計において、構造化を重視するコード中心主義と柔軟性を重視するマークダウン中心主義の対立を解決し、意図をマークダウンで、実装をコードで行うハイブリッドアプローチの必要性を示唆している。
キーポイント
コード中心主義の限界
Pythonなどのコードで仕様を記述する方法は信頼性を高めるが、適応性に欠けるという課題を抱えている。
マークダウン中心主義のリスク
マークダウンによる記述は創造性を許容するが、エラーが発生しやすく実行の確実性が損なわれるリスクがある。
ハイブリッドアーキテクチャの提案
成功するエージェント設計では、マークダウンで意図を定義し、コードで構造を実装することで、柔軟性と確実な実行の両立を図る必要がある。
影響分析・編集コメントを表示
影響分析
この記事は、エージェント開発における実装パターンに関する重要な議論を提供しており、単なるツールの比較ではなく、設計哲学の転換を示唆しています。現場の開発者にとっては、スケーラビリティと保守性を両立させるための具体的な設計指針として活用できるため、実務への影響度は中程度ですが、長期的なアーキテクチャの標準化に寄与する可能性があります。
編集コメント
エージェントの「頭脳」である意図と、「手足」である実行ロジックを分離するこのアプローチは、複雑なシステムにおけるデバッグ容易性と拡張性を高める上で極めて合理的です。
LLM(大規模言語モデル)の熱狂的なブームが始まった数年前、エージェントの仕様記述言語としてPythonとMarkdownの間で、私たちの時代の重要な論争の一つになるとは誰も予想していなかったでしょう。しかし今、私たちはその状況にあり、これは急速にAIにおける最も重要なアーキテクチャ上の問いの一つへと発展しています。
この論争がもたらす結果について深く掘り下げる前に、まずは用語の定義を確認しましょう。
Python派は、エージェントがタスクを完了するために取るべき手順に対する厳格な要件をコードで表現します。一方、Markdown派は、広範な目標と制約条件を英語で記述し、エージェントに結果に至るまでの計画立案を委ねます。このトレードオフは比較的明確です。コードは強力なガードレール(安全装置)を作成し、エージェントの計画が逸脱する可能性を減らします。一方、Markdownは強力なモデルに探求の自由を与え、ツールやモデル間で柔軟に適応できますが、エージェントが予期せず望ましくない行動を取るリスクを孕んでいます。
出典:ChatGPT。
議論の大半は、これを二つの正当な立場の間での選択として扱っている。しかし実際にはそうではない。両極端な立場は、いずれも失敗モードであり、その理由は同じである。どちらの立場も、実際にはエージェントネイティブではないのだ。人間と同様に、エージェントは次第に複雑なタスクを任されるようになり、それには適切なツール(またはサブタスク)を選択するための柔軟性が要求される。コード極端主義は、エージェントに決定論的なワークフローに従わせることで、有用性をもたらす推論能力を奪う。マークダウン極端主義は制御を放棄し、デバッグも修正も改善もできないシステムを生み出す。どちらか一方に味方することは、エージェント設計という難問から逃れるための方法だ。
私たちはこの記事を「エージェントネイティブ」シリーズの一部として公開する。これらの二つのアプローチが、エージェントインタラクションの構築方法を定義しつつあること、そして両極端なバージョンが先週私たちが記述したのと同じ結論に至るためである。すなわち、異なる構文を用いながらも、人間が行うことをそのままコピー&ペーストしている点だ。
コード極端主義の誤り
コード極端主義の主張は信頼性にある。エージェントに特定のケースで正確に何を行うかを指示し、エラーが発生した際に表面化させ、狭いスコープの結果を得る。大規模言語モデル(LLM)が間違いを犯し、意図を誤解し、一般的に奇妙な振る舞いをすることが多いことを考慮すれば、これは理論的には魅力的に聞こえる。コード層で正しさを強制する。モデルが正しいことをすると信頼しない。
私たちは、AI SRE(Site Reliability Engineering)の領域において、このアプローチがどこで失敗するかを熟知しています。私たちの業界にあるほぼすべてのベンダーは、顧客に対してランブック(運用手順書)を作成する必要があると伝えています。その後、製品はそれらのランブックをワークフローとしてエンコードし、特定のアラートに対してエージェントがそれを実行する仕組みになっています。この結果は狭義では信頼できます:エージェントはおおよそ期待したことを実行します。しかし、アラートが過去のものとは異なる場合や、基盤となるアーキテクチャが変更された瞬間、それは無用なものになります。私たちは初期の段階でこの誤った道を進みましたが、実践ではほとんど機能しないことをすぐに学びました。
このアプローチは3つの点でエージェントネイティブ(エージェント本来の特性に適合した)ではありません。第一に、これは人間の行動をコピペしているに過ぎません。人間は経験に基づいて最も可能性が高い仮説を1つ選び、それを実行します。これは人間が確信を持っている場合には機能しますが、最初の仮説が間違っている場合、多くの無駄な作業が生じます。エージェントはそんな罠に陥る必要はありません。複数の仮説を並列で評価でき、その中には行き止まりになるものもありますが、正しい答えにたどり着く確率は劇的に向上します。これが私たちがRunLLMを構築した際のアーキテクチャであり、実際のインシデントが解決される方法を私たちが常に観察している手法でもあります。
第二に、ランブック(実行手順書)のアプローチでは、人間に意味のある可視性が提供されません。SRE(サイト信頼性エンジニア)が必要とするのは、エージェントがランブックのステップ3を実行したという確認ではありません。彼らが知りたいのは、エージェントが何を試み、どの可能性を除外し、なぜその判断をしたかという理由です。よく使われるパスは些細な作業を自動化しますが、人間がエージェントの推論過程を信頼したり、そこから学んだりすることを可能にはしません。
第三に、エンコードされたワークフローは進化せず、エージェントが約束する知能を失います。基盤となるシステムが変更されたり要件が変わったりした場合、すべてのエンコーディングもそれに合わせて変更しなければなりません。誰かがハーンネス(制御枠組み)に戻って修正しない限り、エージェントがフィードバックを受け取り、期待される動作が変化したことを理解し、自ら適応する方法はありません。
マークダウン・マキシマリズムの誤り
マークダウン・マキシマリストは柔軟性の最適化を目指しています。目標を記述し、能力のあるモデルに渡して、あとはそれが考えさせるようにします。これは移植性が高く、表現力豊かで、すぐに動作するものを作り上げることができます。創造性やオープンエンドな問題解決が重要となる場面では、固定されたワークフローよりもはるかに有用である場合があります。
この極端な形態は、AI によるスライド生成です。これらのツールの背後にある正確なアーキテクチャは不明ですが、外見上は「LLM にすべてを任せる」アプリケーションとして機能しています。プロンプトを一つ入力すると、スライドデッキ全体が出力されます。これを使用したことがある人なら誰でも知っている失敗パターンがあります。どこかがおかしいのです。7 枚目のスライドのレイアウトが奇妙で、グラフが主張と一致しておらず、論理展開が混乱しています。あなたは「7 枚目のスライドでは、水平方向ではなく垂直方向にフローを変更し、グラフを下部に移動して」と言いたいでしょう。しかし、通常は期待通りに動作させることはできません。調整可能な離散的なレイジックはなく、グラフ配置のための分離可能なステップもなく、生成全体よりも小さな単位でアドレス指定することはできません。再プロンプトして、異なる方法で間違っている新しいデッキを取得し、最初からやり直すことになります。
これを藁人形論として片付けるのは簡単でしょう。本格的な Markdown 最大化主義者は、すべてのアプリケーションを一発で処理することを主張しているわけではありません。この立場の洗練されたバージョンは、skills.md に基本的なエージェントループを追加したものです。これは豊富なコンテキスト、慎重な指示、そしてそれらを通じて推論する能力を持つモデルを組み合わせます。細粒度の LLM 呼び出しで制約するのではなく、コンテキストを通じてエージェントを誘導するという議論です。
複雑なアプリケーションは、このギャップを浮き彫りにします。現実と向き合う際、厳格な制約が依然として必要となるエンジニアリング上の判断は数多く存在します。コンテキスト管理や要約、モデルの選択、コスト管理、そしてエージェント間の調整などがその例です。これらすべてのケースにおいて、課題はモデルが賢明に推論することを信頼することではありません。むしろ、思慮深いモデルがこれらのタスクを効率的かつ確実に実行できるようにするツールとインフラストラクチャを構築することです。
本番環境では、コンテキストを管理し、モデル間のルーティングを行い、サブエージェントをオーケストレーションし、純粋なプロンプトが機能しない予測可能な箇所を処理するコードハネス(harness)が結果として生じます。これは、マークダウンがガイダンスの役割を果たし、コードが構造的な役割を果たすハイブリッドアーキテクチャになります。これはまさに、議論の的となるべき立場です。
マークダウン最大化主義のアーキテクチャから始めると、制約を適用するために、コンテンツ管理やモデルルーティングなどの狭義でハネスのような機能の数々を構築することになるでしょう。それは好きか嫌いかに関わらずです。重要なのは、それらのフックを意図的に設計するか、コードコンポーネントが有機的に成長するのを任せるかという点です。設計については意図的であるべきです。
ハイブリッドは妥協ではない
本格的なエージェントを構築するチームは、ほぼ独立して同じ結論に達しています。意図やドメインのガイダンスにはマークダウンを、強制実行やツール呼び出し、そして静かに失敗してはならない処理にはコードを使用するというアプローチです。Claude Code はこのように動作します。私たちが RunLLM を構築したのも、まさにこの方式でした。
これを無難な妥協点として捉える誘惑があります。しかし、それは誤った枠組みです。エージェントの本質的な意義は、従来のソフトウェアとは異なり、解決すべき問題に対する理解を持ち、それを実現するために適切なツールを使用できる点にあります。コード至上主義は計画段階で妥協し、マークダウン至上主義は実行と学習の面で妥協することになります。
ハイブリッドアーキテクチャが勝利を収めている理由は、それがエージェントに本来期待される機能をサポートする唯一のアーキテクチャだからです。エージェントは、未体験の状況に対応するために推論の柔軟性が必要であり、同時に人間が信頼し必要に応じて介入できるようにするための決定論的なガードレールも必要とします。どちらの極端な立場も両方を実現できないため、いずれのマキシマリストな立場も、真に柔軟なエージェントを提供するものではありません。それは、野心を持つだけのワークフローか、実行手段を持たない願望のいずれかを与えてしまうだけです。
アーキテクチャ設計における重要な作業は、システムの各部分がどのレイヤーに属するかを特定することです。何を意図として表現し、推論の対象とするべきか。何を強制し、確認すべきか。エージェントに創造性が求められる箇所と、制約が必要となる箇所はどこか。これが難しい部分であり、立場を選ぶことで回避できる部分でもあります。
エージェントネイティブが実際に要求するもの
PythonとMarkdownのどちらを選ぶかという議論を止めたとき、アーキテクチャ上の優先順位が明確になります。あなたのエージェントは複数の仮説を並列に評価できるか、それとも一つの道を進むだけなのか。人間はエージェントが何を試したのか、そしてなぜそうしたのかを見られるのか、それとも最終回答だけを受け取るのか。基盤システムが変更された際にエージェントは適応できるか、それとも誰かがハルネスを編集する必要があるのか。ユーザーは関心のある粒度で出力を修正できるか、それともすべてまたは nothing なのか。
最大主義的な議論は、業界がまだエージェントをワークフロー自動化ツールとして捉えていることの現れです。非常に堅牢なタイプか、非常に緩やかなタイプのどちらかです。エージェントネイティブな製品を構築しているチームはすでにその議論を超えており、なぜなら彼らはこの議論が本質的にPythonやMarkdownに関するものではなかったことに気づいたからです。それは、エージェントとして実際に振る舞うものを構築するために作業を行う意思があるかどうかについての議論でした。
原文を表示
I think it’s safe to say that when the LLM hype cycle started a few years ago, no one expected one of the great debates of our time would be between Python and Markdown as agent specification languages. But here we are, and this has quickly turned into one of the most consequential architectural questions in AI.
Before we dive into the consequences of this debate, we’ll take a moment to define our terms.
The Python camp uses code to express strict requirements for the steps an agent should take to accomplish a task. The Markdown camp uses English to express broad goals and constraints and lets the agent plan its way to the outcome. The tradeoffs are fairly straightforward. Code creates strong guardrails and reduces the chance that the agent’s plan goes off the rails. Markdown gives powerful models the freedom to explore, adapts flexibly across tools and models, but risks the agent doing something unexpected and undesirable.
Most of the debate treats this as a choice between two defensible positions. It isn’t. Both maximalist positions are, in fact, failure modes, and the reason is the same: Neither one is actually agent-native. Agents, like humans, are increasingly being given complex tasks, and that requires the flexibility to choose the right tool for the right task (or subtask). Code-maximalism forces agents to follow deterministic workflows and strips out the reasoning that makes them useful. Markdown-maximalism abdicates control and produces systems you can’t debug, correct, or improve. Picking a side is how you avoid the hard work of designing an agent.
We’re publishing this as part of the Agent Native series because these two approaches increasingly define how agent interactions get built — and because both maximalist versions end up in the same place we wrote about last week: copy-pasting what a human would do, just in different syntax.
What code-maximalism gets wrong
The code-maximalist pitch is reliability. You tell the agent exactly what to do in specific cases, surface errors when things break, and get tightly scoped results. Given that LLMs make mistakes, misunderstand intent, and generally do all sorts of weird things, this sounds appealing in theory. Enforce correctness at the code layer. Don’t trust the model to do the right thing.
We’re intimately familiar with where this can go wrong in the AI SRE space. Almost every vendor in our space tells customers they have to write runbooks. The product then encodes those runbooks as workflows and has the agent execute them in response to specific alerts. The results are trustworthy in the narrow sense: the agent does roughly what you expected. It’s also useless the moment an alert looks different from anything that’s come before or the underlying architecture changes. We started down this misguided path ourselves in the early days and quickly learned that it would rarely work in practice.
This approach fails to be agent-native in three ways. First, it copy-pastes what a human does. A human picks one hypothesis — the most likely based on experience — and runs it down. That works when the human is confident, but when the initial hypothesis is wrong, it creates a lot of wasted work. An agent doesn’t have to fall into that trap. It can evaluate multiple hypotheses in parallel, and some will be dead ends, but the chance it lands on the right answer goes up dramatically. That’s the architecture we’ve built RunLLM around, and it’s consistently how we see real incidents get resolved.
Second, the runbook approach gives humans no meaningful visibility. SREs don’t need to confirm that the agent executed Step 3 of the runbook. They need to know what the agent tried, what it ruled out, and why. A well-worn path automates some tedious work, but it doesn’t let the human trust or learn from the agent’s reasoning.
Third, encoded workflows don’t evolve – they lose the intelligence that agents promise. When the underlying system changes or requirements shift, every encoding has to change with it. There’s no way for the agent to take feedback, understand that the expected behavior has changed, and adapt on its own without someone going back into the harness.
What Markdown-maximalism gets wrong
The Markdown-maximalist is optimized for flexibility. Describe the goal, hand it to a capable model, let it figure things out. This is portable, expressive, and gets you something working quickly. Where creativity or open-ended problem-solving matters, it can be dramatically more useful than a fixed workflow.
The degenerate version of this is AI slide generation. We don’t know the exact architecture behind these tools, but from the outside they read as “let the LLM do everything” applications — one prompt in, a whole slide deck out. The failure mode is familiar to anyone who’s used one. Something is off. The layout is weird on slide 7, the chart doesn’t match the claim, the flow of the argument is scrambled. You want to say: “On slide 7, make the flow vertical instead of horizontal and move the chart to the bottom.” You usually can’t get this to work the way you expect. There’s no discrete layout logic to adjust, no separable step for chart placement, no addressable unit smaller than the whole generation. You re-prompt, get a new deck that’s wrong in a different way, and start over.
It would be easy to write this off as a strawman. Serious Markdown-maximalists aren’t arguing for one-shotting every single application. The sophisticated version of the position is skills.md plus a basic agent loop — rich context, thoughtful instructions, and a capable model reasoning its way through. Guide the agent through context, the argument goes, rather than constraining it with fine-grained LLM calls.
Complex applications expose the gap. When you’re grappling with reality, there are plenty of engineering decisions that still require strict constraints: Context management and summarization, model selection, cost management, and cross-agent coordination to name a few. In each one of these cases, the challenge is not trusting the model to reason intelligently. It is building the tooling and infrastructure that allows a thoughtful model to execute these tasks efficiently and reliably.
In production, this results in a code harness that manages context, routes between models, orchestrates sub-agents, and handles the predictable places where pure prompting breaks down. That ends up being a hybrid architecture with markdown doing the guidance work and code doing the structural work — which is exactly the position the debate was supposed to be between.
If you start with a Markdown-maximalist architecture, you’re probably going to end up building plenty of narrow, harness-like capabilities – content management, model routing, etc. – to enforce constraints whether you like it or not. The question is just whether you design those hooks intentionally or let the code component grow organically. You should be intentional about the design.
The hybrid isn’t a compromise
The teams building serious agents have, largely independently, landed in the same place: Markdown for intent and domain guidance, code for enforcement, tool execution, and anything that must not fail silently. Claude Code works this way. We built RunLLM this way.
It’s tempting to read this as an unopinionated compromise. That’s the wrong framing. The whole point of agents is that – unlike traditional software – they have an understanding of the problem to be solved and can use the right tools to get there. Code-maximalism compromises on the planning and Markdown-maximalism compromises on execution and learning.
The reason hybrid architectures are winning is because they’re the only architectures that support what agents are actually supposed to do. An agent needs reasoning flexibility to handle situations it hasn’t seen before, and it needs deterministic guardrails so humans can trust it and intervene when needed. Neither extreme gives you both, which means neither maximalist position gives you a truly flexible agent. It gives you either a workflow with aspirations or a wish with nothing to execute it.
The architectural work is figuring out, for each part of your system, which layer it belongs to. What needs to be expressed as intent and reasoned about? What needs to be enforced and checked? Where does the agent need creativity, and where does it need constraints? This is the hard part, and it’s the part that picking a side lets you avoid.
What agent-native actually requires
When you stop treating Python vs. Markdown as the debate, the architectural priorities come into focus. Can your agent evaluate multiple hypotheses in parallel, or does it march down one? Can a human see what the agent tried and why, or do they just get a final answer? Can the agent adapt when the underlying system changes, or does someone need to go edit the harness? Can a user correct the output at the level of granularity they care about, or is it all-or-nothing?
The maximalist debates are a symptom of an industry still thinking about agents as workflow automators — either very rigid ones, or very loose ones. The teams building agent-native products are past that argument, because they’ve figured out that the argument was never really about Python or Markdown. It was about whether you were willing to do the work to build something that actually behaves like an agent.
関連記事
今日のまとめ
AI日報で今日の重要ニュースをまとめ読み