講座 › 分野1 エージェントとワークフロー
1.3 エージェントのパターンとフレームワーク
基本の部品は、ツールを回すループ、作業を任せるサブエージェント、記憶(メモリ)、コンテキストの管理。フレームワークは便利だが、仕組みを理解して使う。
ワークフローの代表的なパターン 読了

プロンプトチェーンは、作業を順番の決まった手順に分け、前の出力を次の入力にします。途中にプログラムの検査を入れられます。ルーティングは、入力を分類して専用の処理へ振り分けます。並列化は、独立した作業を同時に動かして結果をまとめます。評価・改善型は、1つの呼び出しが答えを作り、別の呼び出しが評価して返す流れを繰り返します。
出典:Building effective agents
Prompt chaining decomposes a task into a sequence of steps, where each LLM call processes the output of the previous one.https://www.anthropic.com/research/building-effective-agents(取得 2026-11-17)
出典:Building effective agents
Routing classifies an input and directs it to a specialized followup task.https://www.anthropic.com/research/building-effective-agents(取得 2026-11-17)
出典:Building effective agents
In the evaluator-optimizer workflow, one LLM call generates a response while another provides evaluation and feedback in a loop.https://www.anthropic.com/research/building-effective-agents(取得 2026-11-17)
ツール使用ループ 読了

エージェントの中心は、ツール使用ループです。Claudeが考え、ツールを呼び、結果を受け取って、また考えます。ツールを呼ばずに文章だけを返したときが、ループの終わりです。部品の基本は、検索・ツール・メモリで能力を足した「拡張LLM」です。
出典:How the agent loop works
The SDK yields a final AssistantMessage with the text response (no tool calls)https://code.claude.com/docs/en/agent-sdk/agent-loop.md(取得 2026-11-17)
出典:Building effective agents
We'll start with our foundational building block—the augmented LLMhttps://www.anthropic.com/research/building-effective-agents(取得 2026-11-17)
メモリとコンテキストウィンドウの管理 読了

メモリツールを使うと、Claudeは会話をまたいで情報をファイルに保存し、後で読み戻せます。すべてをコンテキストウィンドウに入れておかなくても、知識を積み上げられます。メモリツールはクライアント側のツールなので、保存先はアプリ側で管理します。長い作業では、計画をメモリに書いておくと、コンテキストが切り詰められても失いません。
出典:Memory tool
Claude can create, read, update, and delete files that persist between sessions, building up knowledge over time without keeping everything in the context window.https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-t…(取得 2026-11-17)
出典:Memory tool
Because the memory tool is client-side, Claude only requests memory operations.https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-t…(取得 2026-11-17)
出典:How we built our multi-agent research system
saving its plan to Memory to persist the contexthttps://www.anthropic.com/research/multi-agent-research-system(取得 2026-11-17)
抽象化フレームワーク 読了

LangGraph・PydanticAI・Strandsのようなフレームワークを使うと、エージェントを素早く作れます。LangGraphは、状態を持つ長時間のエージェント向けの、低レベルなオーケストレーションの基盤です。PydanticAIは、型付きのエージェントループを提供するPythonの仕組みです。ただしAnthropicは、本番に近づいたら抽象化の層を減らし、基本の部品で作ることもためらわないよう勧めています。
出典:LangGraph overview(公式)
LangGraph is a low-level orchestration framework and runtime for long-running, stateful agents.https://docs.langchain.com/oss/python/langgraph/overview(取得 2026-11-17)
出典:PydanticAI(公式)
Pydantic AI is the Python AI SDK: a typed, extensible agent loophttps://pydantic.dev/docs/ai/overview/(取得 2026-11-17)
出典:Strands Agents(公式)
The open source toolkit for building production agents.https://strandsagents.com/latest/(取得 2026-11-17)
出典:Building effective agents
Frameworks can help you get started quickly, but don't hesitate to reduce abstraction layers and build with basic components as you move to production.https://www.anthropic.com/research/building-effective-agents(取得 2026-11-17)
- パターン名と使いどころを対で覚える。分けられる固定手順はチェーン、種類ごとの振り分けはルーティング、独立作業はパラレル、品質を詰めるなら評価・改善型。
出典:Building effective agents
This workflow is ideal for situations where the task can be easily and cleanly decomposed into fixed subtasks.
https://www.anthropic.com/research/building-effective-agents(取得 2026-11-17) - 会話をまたいで覚えさせたいならメモリ(ファイルに保存)。コンテキストに全部詰め込むのではない。
出典:Memory tool
The memory tool lets Claude store and retrieve information across conversations in a directory of memory files.
https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-t…(取得 2026-11-17)