Skip to content

Commit ff76bcd

Browse files
Copilotks6088ts
andcommitted
Add demo agents documentation and Makefile targets
Co-authored-by: ks6088ts <[email protected]>
1 parent f0a3cd0 commit ff76bcd

File tree

3 files changed

+116
-16
lines changed

3 files changed

+116
-16
lines changed

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,3 +215,21 @@ run-task-decomposer-agent: ## run task decomposer agent
215215
--name task_decomposer_agent \
216216
--question "KABUTOにログインできない。パスワードは合ってるはずなのに…若手社員である山田太郎は、Windows 11 を立ち上げ、日課のように自社の業務システムKABUTOのログイン画面を開きます。しかし、そこには、意味をなさない「虚無」という文字だけがただひっそりと表示されていたのです。これは質問でもあり不具合の報告でもあります。岡本太郎さんに本件調査依頼します。" \
217217
--verbose
218+
219+
.PHONY: run-weather-agent
220+
run-weather-agent: ## run weather agent (demo)
221+
uv run python scripts/demo_agents_operator.py weather-agent \
222+
--query "What's the weather in Japan?" \
223+
--verbose
224+
225+
.PHONY: run-multi-agent
226+
run-multi-agent: ## run multi agent (demo)
227+
uv run python scripts/demo_agents_operator.py multi-agent \
228+
--query "What's the weather in Tokyo?" \
229+
--verbose
230+
231+
.PHONY: run-parallel-processor-agent
232+
run-parallel-processor-agent: ## run parallel processor agent (demo)
233+
uv run python scripts/demo_agents_operator.py parallel-processor-agent \
234+
--goal "ソフトウェアシステム開発会社を立ち上げる戦略を立てるための情報収集をしたい" \
235+
--verbose

docs/index.ja.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ uv run python scripts/elasticsearch_operator.py create-index \
9191
- **`template_langgraph/`** - すべてのエージェント実装を含むメイン Python パッケージ
9292
- **`notebooks/`** - インタラクティブな例と説明付き Jupyter ノートブック
9393
- **`scripts/`** - エージェント実行用コマンドラインツール
94+
- `agent_operator.py` - プロダクションエージェント用メインランナー
95+
- `demo_agents_operator.py` - シンプルなデモエージェント用ランナー
96+
- データ管理用各種オペレータースクリプト(`qdrant_operator.py``elasticsearch_operator.py` など)
9497

9598
### エージェントの例(`template_langgraph/agents/`
9699

@@ -104,6 +107,14 @@ uv run python scripts/elasticsearch_operator.py create-index \
104107
- `news_summarizer_agent/` — Web/YouTube 要約。取得 → 要約 → 通知。主要概念: 扇形サブタスク、Notifier/Scraper/Summarizer を差し替え。
105108
- `image_classifier_agent/` — 画像分類。ローカル画像を分類し通知。主要概念: 画像 ×LLM、並列サブタスク。
106109

110+
#### デモエージェント(`template_langgraph/agents/demo_agents/`
111+
112+
学習と実演用の追加シンプルエージェント:
113+
114+
- `weather_agent.py` — シンプルなツール呼び出しエージェント。モック天気検索ツールを使った基本的な ReAct パターン。主要概念: ツール呼び出し、基本エージェントパターン。
115+
- `multi_agent.py` — マルチエージェント協調。転送機能を使ったエージェント間の引き渡しを実演。主要概念: エージェント協調、ワークフロー転送。
116+
- `parallel_processor_agent/` — 並列実行タスク分解。目標をタスクに分解し並列処理。主要概念: 並列処理、タスク分解、Send 操作。
117+
107118
### サポートモジュール
108119

109120
- `template_langgraph/llms/`: LLM ラッパー(Azure OpenAI など)
@@ -242,8 +253,36 @@ uv run python scripts/agent_operator.py image-classifier-agent \
242253
--verbose
243254
```
244255

256+
### デモエージェント実行例
257+
258+
- Weather agent(シンプルなツール呼び出し):
259+
260+
```shell
261+
uv run python scripts/demo_agents_operator.py weather-agent \
262+
--query "日本の天気はどうですか?" \
263+
--verbose
264+
```
265+
266+
- Multi agent(エージェント協調):
267+
268+
```shell
269+
uv run python scripts/demo_agents_operator.py multi-agent \
270+
--query "東京の天気はどうですか?" \
271+
--verbose
272+
```
273+
274+
- Parallel processor agent(タスク分解):
275+
276+
```shell
277+
uv run python scripts/demo_agents_operator.py parallel-processor-agent \
278+
--goal "ソフトウェア会社立ち上げのための情報収集戦略を計画する" \
279+
--verbose
280+
```
281+
245282
Makefile のショートカット(例: `make run-chat-with-tools-agent`, `make run-issue-formatter-agent`, `make run-news-summarizer-agent`, `make run-image-classifier-agent`)も用意しています。
246283

284+
デモエージェントのショートカット: `make run-weather-agent`, `make run-multi-agent`, `make run-parallel-processor-agent`
285+
247286
## 実演されている主要概念
248287

249288
### 1. **ReAct パターン**(推論 + 行動)
@@ -319,9 +358,10 @@ make mcp-inspector
319358
## 次のステップ
320359

321360
1. **基本から始める**: `kabuto_helpdesk_agent`の例を実行
322-
2. **実装を理解する**: `chat_with_tools_agent`と比較
323-
3. **高度なパターンを探索**: タスク分解器とスーパーバイザーエージェントを試す
324-
4. **独自のものを構築**: このテンプレートをあなたのユースケースの出発点として使用
361+
2. **デモエージェントを試す**: `weather_agent``multi_agent``parallel_processor_agent`でシンプルなパターンを探索
362+
3. **実装を理解する**: `chat_with_tools_agent`と比較
363+
4. **高度なパターンを探索**: タスク分解器とスーパーバイザーエージェントを試す
364+
5. **独自のものを構築**: このテンプレートをあなたのユースケースの出発点として使用
325365

326366
## 可観測性(任意)
327367

@@ -340,10 +380,11 @@ uv run python scripts/otel_operator.py run -q "health check" -v
340380

341381
このテンプレートは複数の実証済みエージェントアーキテクチャを実演しています:
342382

343-
1. **ツール付きシングルエージェント** - 基本的なツール呼び出しパターン
344-
2. **ReAct エージェント** - ループでの推論と行動
345-
3. **構造化出力エージェント** - フォーマットされたデータの返却
346-
4. **計画エージェント** - 複雑なタスクの分解
347-
5. **スーパーバイザーエージェント** - 複数エージェントの協調
383+
1. **ツール付きシングルエージェント** - 基本的なツール呼び出しパターン(`weather_agent`
384+
2. **ReAct エージェント** - ループでの推論と行動(`kabuto_helpdesk_agent`
385+
3. **構造化出力エージェント** - フォーマットされたデータの返却(`issue_formatter_agent`
386+
4. **計画エージェント** - 複雑なタスクの分解(`task_decomposer_agent`
387+
5. **マルチエージェントシステム** - 複数エージェントの協調(`supervisor_agent``multi_agent`
388+
6. **並列処理** - 同時タスク実行(`parallel_processor_agent`
348389

349390
各パターンは、いつどのように使用するかを理解するのに役立つ明確な例と文書で実装されています。

docs/index.md

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ uv run python scripts/elasticsearch_operator.py create-index \
9191
- **`template_langgraph/`** - Main Python package containing all agent implementations
9292
- **`notebooks/`** - Jupyter notebooks with interactive examples and explanations
9393
- **`scripts/`** - Command-line tools for running agents
94+
- `agent_operator.py` - Main agent runner for production agents
95+
- `demo_agents_operator.py` - Runner for simple demo agents
96+
- Various operator scripts for data management (`qdrant_operator.py`, `elasticsearch_operator.py`, etc.)
9497

9598
### Agent Examples (`template_langgraph/agents/`)
9699

@@ -104,6 +107,14 @@ This project includes several agent implementations, each demonstrating differen
104107
- `news_summarizer_agent/` — Web/YouTube summarization. Scrapes content, summarizes to `StructuredArticle`, and notifies. Key: fan-out subtasks, notifier/scraper/summarizer plugins.
105108
- `image_classifier_agent/` — Vision classification. Classifies local images and notifies results. Key: LLM-based image classification, parallel subtasks.
106109

110+
#### Demo Agents (`template_langgraph/agents/demo_agents/`)
111+
112+
Additional simple agents for learning and demonstration:
113+
114+
- `weather_agent.py` — Simple tool-calling agent. Basic ReAct pattern with mock weather search tool. Key: tool calling, basic agent pattern.
115+
- `multi_agent.py` — Multi-agent coordination. Demonstrates agent-to-agent handoff using transfer functions. Key: agent coordination, workflow transfer.
116+
- `parallel_processor_agent/` — Task decomposition with parallel execution. Breaks down goals into tasks and processes them in parallel. Key: parallel processing, task decomposition, Send operations.
117+
107118
### Supporting Modules
108119

109120
- `template_langgraph/llms/`: LLM wrappers (Azure OpenAI, etc.)
@@ -242,8 +253,36 @@ uv run python scripts/agent_operator.py image-classifier-agent \
242253
--verbose
243254
```
244255

256+
### Demo agent runs
257+
258+
- Weather agent (simple tool calling):
259+
260+
```shell
261+
uv run python scripts/demo_agents_operator.py weather-agent \
262+
--query "What's the weather in Japan?" \
263+
--verbose
264+
```
265+
266+
- Multi agent (agent coordination):
267+
268+
```shell
269+
uv run python scripts/demo_agents_operator.py multi-agent \
270+
--query "What's the weather in Tokyo?" \
271+
--verbose
272+
```
273+
274+
- Parallel processor agent (task decomposition):
275+
276+
```shell
277+
uv run python scripts/demo_agents_operator.py parallel-processor-agent \
278+
--goal "Plan information gathering strategy for launching a software company" \
279+
--verbose
280+
```
281+
245282
Makefile shortcuts are also available (e.g., `make run-chat-with-tools-agent`, `make run-issue-formatter-agent`, `make run-news-summarizer-agent`, `make run-image-classifier-agent`).
246283

284+
Demo agent shortcuts: `make run-weather-agent`, `make run-multi-agent`, `make run-parallel-processor-agent`.
285+
247286
## Key Concepts Demonstrated
248287

249288
### 1. **ReAct Pattern** (Reasoning + Acting)
@@ -321,9 +360,10 @@ make mcp-inspector
321360
## Next Steps
322361

323362
1. **Start with the basics**: Run the `kabuto_helpdesk_agent` example
324-
2. **Understand the implementation**: Compare it with `chat_with_tools_agent`
325-
3. **Explore advanced patterns**: Try the task decomposer and supervisor agents
326-
4. **Build your own**: Use this template as a starting point for your use case
363+
2. **Try demo agents**: Explore the simple patterns with `weather_agent`, `multi_agent`, and `parallel_processor_agent`
364+
3. **Understand the implementation**: Compare it with `chat_with_tools_agent`
365+
4. **Explore advanced patterns**: Try the task decomposer and supervisor agents
366+
5. **Build your own**: Use this template as a starting point for your use case
327367

328368
## Observability (optional)
329369

@@ -342,10 +382,11 @@ uv run python scripts/otel_operator.py run -q "health check" -v
342382

343383
This template demonstrates several proven agent architectures:
344384

345-
1. **Single Agent with Tools** - Basic tool-calling pattern
346-
2. **ReAct Agent** - Reasoning and acting in loops
347-
3. **Structured Output Agent** - Returning formatted data
348-
4. **Planning Agent** - Breaking down complex tasks
349-
5. **Supervisor Agent** - Coordinating multiple agents
385+
1. **Single Agent with Tools** - Basic tool-calling pattern (`weather_agent`)
386+
2. **ReAct Agent** - Reasoning and acting in loops (`kabuto_helpdesk_agent`)
387+
3. **Structured Output Agent** - Returning formatted data (`issue_formatter_agent`)
388+
4. **Planning Agent** - Breaking down complex tasks (`task_decomposer_agent`)
389+
5. **Multi-Agent Systems** - Coordinating multiple agents (`supervisor_agent`, `multi_agent`)
390+
6. **Parallel Processing** - Concurrent task execution (`parallel_processor_agent`)
350391

351392
Each pattern is implemented with clear examples and documentation to help you understand when and how to use them.

0 commit comments

Comments
 (0)