Skip to content

Commit 75aab4d

Browse files
committed
update docs
1 parent 0892592 commit 75aab4d

File tree

5 files changed

+249
-78
lines changed

5 files changed

+249
-78
lines changed

docs/deployment.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
## Deployment instructions
1+
# Deployment instructions
22

3-
### Azure resources
3+
## Azure resources
44

55
To deploy Azure resources for this project, you can use the provided [Bicep template](https://github.com/ks6088ts-labs/baseline-environment-on-azure-bicep/tree/main/infra/scenarios/template-langgraph). This template sets up the necessary resources for running the LangGraph application.
66

77
To quickly deploy the application, [Deploy to Azure button](https://learn.microsoft.com/azure/azure-resource-manager/templates/deploy-to-azure-button) is available. By clicking the following button, you can deploy the resources directly from the Azure portal:
88

99
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fks6088ts-labs%2Fbaseline-environment-on-azure-bicep%2Frefs%2Fheads%2Fmain%2Finfra%2Fscenarios%2Ftemplate-langgraph%2Fazuredeploy.json)
1010

11-
### Create index
11+
## Create index
1212

13-
#### On Azure
13+
### On Azure
1414

1515
```shell
1616
# Cosmos DB
@@ -20,7 +20,7 @@ make create-cosmosdb-index
2020
make create-ai-search-index
2121
```
2222

23-
#### On Docker
23+
### On Docker
2424

2525
```shell
2626
rm -rf assets/
@@ -33,11 +33,14 @@ make create-qdrant-index
3333

3434
# Elasticsearch
3535
make create-elasticsearch-index
36+
37+
# (Optional) Azure services
38+
# Cosmos DB / Azure AI Search are also supported via Make targets above.
3639
```
3740

38-
### Agents
41+
## Agents
3942

40-
#### Create agent graph in png format
43+
### Create agent graph in png format
4144

4245
```shell
4346
## Draw agent graph
@@ -56,7 +59,7 @@ done
5659
wait
5760
```
5861

59-
#### Run agents
62+
### Run agents
6063

6164
```shell
6265
NAME_QUESTION_ARRAY=(
@@ -70,6 +73,12 @@ for NAME_QUESTION in "${NAME_QUESTION_ARRAY[@]}"; do
7073
echo "Running agent: $AGENT_NAME with question: $QUESTION"
7174
uv run python scripts/agent_operator.py run --name "$AGENT_NAME" --verbose --question "$QUESTION"
7275
done
76+
77+
# Or use Make targets:
78+
# make run-chat-with-tools-agent
79+
# make run-issue-formatter-agent
80+
# make run-kabuto-helpdesk-agent
81+
# make run-task-decomposer-agent
7382
```
7483

7584
### Docker Hub

docs/development.ja.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ make test
1616

1717
# CIテストを実行
1818
make ci-test
19+
20+
# 任意: LangGraph Studio / FastAPI / Streamlit を起動
21+
make langgraph-studio
22+
make fastapi-dev
23+
make streamlit
1924
```
2025

2126
## テスト
@@ -36,4 +41,18 @@ make docker-run
3641

3742
# DockerコンテナでCIテストを実行
3843
make ci-test-docker
44+
45+
```
46+
47+
## ドキュメント
48+
49+
ローカルでドキュメントをビルド/起動:
50+
51+
```shell
52+
make install-deps-docs
53+
make docs-serve
54+
```
55+
56+
```
57+
3958
```

docs/development.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## Development instructions
1+
# Development instructions
22

3-
### Local development
3+
## Local development
44

55
Use Makefile to run the project locally.
66

@@ -16,16 +16,21 @@ make test
1616

1717
# run CI tests
1818
make ci-test
19+
20+
# optional: run LangGraph Studio / FastAPI / Streamlit
21+
make langgraph-studio
22+
make fastapi-dev
23+
make streamlit
1924
```
2025

21-
### Testing
26+
## Testing
2227

2328
```shell
2429
# Run all tests for AI agents
2530
bash scripts/test_all.sh
2631
```
2732

28-
### Docker development
33+
## Docker development
2934

3035
```shell
3136
# build docker image
@@ -36,4 +41,14 @@ make docker-run
3641

3742
# run CI tests in docker container
3843
make ci-test-docker
44+
45+
```
46+
47+
## Documentation
48+
49+
Build and serve docs locally:
50+
51+
```shell
52+
make install-deps-docs
53+
make docs-serve
3954
```

docs/index.ja.md

Lines changed: 96 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -94,43 +94,32 @@ uv run python scripts/elasticsearch_operator.py create-index \
9494

9595
### エージェントの例(`template_langgraph/agents/`
9696

97-
このプロジェクトには、それぞれ異なる LangGraph パターンを実演する複数のエージェント実装が含まれています:
97+
本プロジェクトには、各種 LangGraph パターンを示すエージェント実装が含まれます。CLI でグラフを PNG 出力(Deployment 参照)したり、ターミナル/Makefile から実行できます。
9898

99-
#### 1. `kabuto_helpdesk_agent/` - **ここから始めよう!**
100-
101-
LangGraph の事前構築された`create_react_agent`関数を使用したシンプルなエージェント。基本を理解するのに最適な出発点です。
102-
103-
**主要概念:** ReAct パターン、ツール呼び出し、事前構築エージェント
104-
105-
#### 2. `chat_with_tools_agent/` - **コア実装**
106-
107-
ヘルプデスクエージェントと同じロジックの手動実装で、LangGraph ワークフローがゼロから構築される方法を示しています。
108-
109-
**主要概念:** グラフ構築、状態管理、ノード関数、エッジ
110-
111-
#### 3. `issue_formatter_agent/` - **構造化出力**
112-
113-
Pydantic モデルを使用して AI 応答から構造化データを取得する方法を実演しています。
114-
115-
**主要概念:** 構造化出力、データ検証、レスポンス形式設定
116-
117-
#### 4. `task_decomposer_agent/` - **計画と分解**
118-
119-
複雑なタスクを小さく管理可能なステップに分解する方法を示しています。
120-
121-
**主要概念:** タスク計画、マルチステップ推論、条件付きワークフロー
122-
123-
#### 5. `supervisor_agent/` - **マルチエージェント協調**
124-
125-
1 つのエージェントが複数の専門エージェントを協調させるスーパーバイザーパターンを実装しています。
126-
127-
**主要概念:** マルチエージェントシステム、エージェント協調、スーパーバイザーパターン
99+
- `kabuto_helpdesk_agent/` — 入門に最適。`create_react_agent` による ReAct エージェント。主要概念: ReAct、ツール呼び出し、プリビルト。
100+
- `chat_with_tools_agent/` — コア実装。ヘルプデスク相当の手組みグラフ。主要概念: グラフ構築、状態管理、ノード/エッジ。
101+
- `issue_formatter_agent/` — 構造化出力。Pydantic で構造化データ抽出。主要概念: 構造化出力、検証、整形。
102+
- `task_decomposer_agent/` — 計画と分解。複雑タスクを段階的に分解。主要概念: 計画、マルチステップ推論、条件分岐。
103+
- `supervisor_agent/` — マルチエージェント協調。スーパーバイザーが複数の専門エージェントを調整。主要概念: 協調。
104+
- `news_summarizer_agent/` — Web/YouTube 要約。取得 → 要約 → 通知。主要概念: 扇形サブタスク、Notifier/Scraper/Summarizer を差し替え。
105+
- `image_classifier_agent/` — 画像分類。ローカル画像を分類し通知。主要概念: 画像 ×LLM、並列サブタスク。
128106

129107
### サポートモジュール
130108

131-
- **`template_langgraph/llms/`** - LLM API ラッパー(Azure OpenAI など)
132-
- **`template_langgraph/tools/`** - 検索、データ取得用ツール実装
133-
- **`template_langgraph/internals/`** - 内部ユーティリティとヘルパー関数(CSV/PDF ローダー、Otel ラッパーなど)
109+
- `template_langgraph/llms/`: LLM ラッパー(Azure OpenAI など)
110+
- `template_langgraph/tools/`: ツール実装
111+
- Azure AI Search(`ai_search_tool.py`
112+
- Azure Cosmos DB Vector Search(`cosmosdb_tool.py`
113+
- Dify Workflow(`dify_tool.py`
114+
- Elasticsearch 全文検索(`elasticsearch_tool.py`
115+
- MCP クライアント(`mcp_tool.py`
116+
- Qdrant ベクター検索(`qdrant_tool.py`
117+
- SQL Database ツールキット(DSN 指定時のみ有効、`sql_database_tool.py`
118+
- `template_langgraph/internals/`: 内部ユーティリティ
119+
- Notifier(Mock/Slack)
120+
- Scraper(Mock/HTTPX/YouTube transcript)
121+
- Summarizer(Mock/LLM 構造化出力)
122+
- Loader(CSV/PDF)、OTEL ヘルパー
134123

135124
## サンプルコードの実行
136125

@@ -224,6 +213,37 @@ Streamlit アプリのデモ:
224213

225214
[![streamlit.png](./images/streamlit.png)](https://youtu.be/undxBwyJ3Sc)
226215

216+
### 追加の実行例
217+
218+
- Issue formatter(構造化出力):
219+
220+
```shell
221+
uv run python scripts/agent_operator.py run \
222+
--name issue_formatter_agent \
223+
--question "KABUTO にログインできない…(省略)" \
224+
--verbose
225+
```
226+
227+
- News summarizer(URL 扇形展開):
228+
229+
```shell
230+
uv run python scripts/agent_operator.py news-summarizer-agent \
231+
--prompt "日本語で3行に要約してください" \
232+
--urls "https://example.com/a,https://example.com/b" \
233+
--verbose
234+
```
235+
236+
- Image classifier(ローカル画像を分類):
237+
238+
```shell
239+
uv run python scripts/agent_operator.py image-classifier-agent \
240+
--prompt "画像の内容を3行で説明してください" \
241+
--file-paths "docs/images/fastapi.png,docs/images/streamlit.png" \
242+
--verbose
243+
```
244+
245+
Makefile のショートカット(例: `make run-chat-with-tools-agent`, `make run-issue-formatter-agent`, `make run-news-summarizer-agent`, `make run-image-classifier-agent`)も用意しています。
246+
227247
## 実演されている主要概念
228248

229249
### 1. **ReAct パターン**(推論 + 行動)
@@ -261,13 +281,56 @@ LangGraph が複数のインタラクションステップにわたってコン
261281

262282
この架空のデータには目的があります:AI エージェントが LLM の訓練データにない情報で動作できることを証明し、検索拡張生成(RAG)の価値を実演しています。
263283

284+
## ツールと設定
285+
286+
既定のツールセットは `template_langgraph/tools/common.py` で定義され、検索/ベクター/ワークフロー/SQL(任意)/MCP などを含みます。`.env` の環境変数で有効化・設定します(`.env.template` 参照)。
287+
288+
- Azure OpenAI
289+
- `AZURE_OPENAI_ENDPOINT`, `AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_API_VERSION`
290+
- `AZURE_OPENAI_MODEL_CHAT`, `AZURE_OPENAI_MODEL_EMBEDDING`, `AZURE_OPENAI_MODEL_REASONING`
291+
- Entra ID 認証の任意設定: `AZURE_OPENAI_USE_MICROSOFT_ENTRA_ID=true`
292+
- Azure AI Search
293+
- `AI_SEARCH_ENDPOINT`, `AI_SEARCH_KEY`, `AI_SEARCH_INDEX_NAME`
294+
- Azure Cosmos DB(ベクター)
295+
- `COSMOSDB_HOST`, `COSMOSDB_KEY`, `COSMOSDB_DATABASE_NAME`, `COSMOSDB_CONTAINER_NAME`, `COSMOSDB_PARTITION_KEY`
296+
- Elasticsearch
297+
- `ELASTICSEARCH_URL`(既定 `http://localhost:9200`
298+
- Qdrant
299+
- `QDRANT_URL`(既定 `http://localhost:6333`
300+
- SQL Database(任意)
301+
- `SQL_DATABASE_URI`(未設定なら無効)
302+
- Dify
303+
- `DIFY_BASE_URL`, `DIFY_API_KEY`
304+
- MCP(Model Context Protocol)
305+
- `MCP_CONFIG_PATH`(JSON 設定。動的にツールをロード)
306+
- Notifier/Scraper/Summarizer 切替
307+
- `NOTIFIER_TYPE``mock`/`slack`)、`NOTIFIER_SLACK_WEBHOOK_URL`
308+
- `SCRAPER_TYPE``mock`/`httpx`/`youtube_transcript`
309+
- `SUMMARIZER_TYPE``mock`/`llm`
310+
311+
### MCP ツールのクイックスタート
312+
313+
`MCP_CONFIG_PATH` を指定すると、MCP サーバーのツールが自動的にロードされます。ローカル検証:
314+
315+
```shell
316+
make mcp-inspector
317+
```
318+
264319
## 次のステップ
265320

266321
1. **基本から始める**: `kabuto_helpdesk_agent`の例を実行
267322
2. **実装を理解する**: `chat_with_tools_agent`と比較
268323
3. **高度なパターンを探索**: タスク分解器とスーパーバイザーエージェントを試す
269324
4. **独自のものを構築**: このテンプレートをあなたのユースケースの出発点として使用
270325

326+
## 可観測性(任意)
327+
328+
OpenTelemetry 用のヘルパーがあります(`template_langgraph/internals/otel_helpers.py`)。簡易スパン動作確認:
329+
330+
```shell
331+
uv run python scripts/otel_operator.py run -q "health check" -v
332+
```
333+
271334
## 学習リソース
272335

273336
- [LangGraph 公式ドキュメント](https://langchain-ai.github.io/langgraph/)

0 commit comments

Comments
 (0)