Docs: "Chat as a tool" multi-agent delegation recipe
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- python
調査の方向性
docs/tool-calling/how-it-works.qmd、近接する tool-calling のページ、docs/_quarto.yml、および chatlas/_chat.py の register_tool()、chat()、get_cost() の定義を確認してください。マルチエージェント委譲に関する、焦点を絞った記事または合意済みのセクションを追加し、適切な場合は issue #43 へ相互リンクし、例と文書化されているコスト計上の制限を現在の API に照らして検証してください。
索引モデルが issue の本文から書いたものです。
説明
Motivation
Pydantic AI's agent-delegation pattern — one agent calls another agent via a tool call — covers most of the practical value people reach for "multi-agent frameworks" for, without needing a graph/orchestration layer. chatlas can already do this today with zero new API: register one Chat's .chat() method (wrapped in a closure with a docstring, exactly like any other tool) as a tool on another Chat via register_tool() (chatlas/_chat.py). This pattern currently isn't documented anywhere — not in docs/tool-calling/ (how-it-works.qmd, displays.qmd, approval.qmd) nor docs/misc/.
Proposed approach
Add a docs article, e.g. docs/tool-calling/multi-agent.qmd (added as a 4th entry to the existing "Tool calling" section in docs/_quarto.yml's sidebar, alongside how-it-works.qmd/displays.qmd/approval.qmd — that section is the natural home since this is fundamentally a tool-calling pattern, not new API).
Minimal accurate example to include (verified against _chat.py's register_tool/chat signatures):
from chatlas import ChatOpenAI
sql_specialist = ChatOpenAI(
system_prompt="You are a SQL expert. Given a natural-language question and a "
"table schema, write a single correct SQL query. Return only the query.",
)
def ask_sql_specialist(question: str, schema: str) -> str:
"""
Delegate a natural-language question to a SQL-writing specialist.
Parameters
----------
question
The natural-language question to translate into SQL.
schema
The relevant table schema(s) as DDL or a plain-text description.
"""
return str(sql_specialist.chat(f"Schema:\n{schema}\n\nQuestion: {question}", echo="none"))
coordinator = ChatOpenAI(system_prompt="You help users explore their data.")
coordinator.register_tool(ask_sql_specialist)
coordinator.chat("How many orders were placed last week? (orders table: id, placed_at, status)")
Points to cover in the article:
- System-prompt separation: the specialist gets its own focused system prompt; the coordinator's stays general. This is the main value over "one chat with many tools."
- Cost accounting across chats: each
Chathas its ownget_cost()(_chat.py); there is no combined/rollup accounting across a coordinator + specialist(s) today. State this plainly as a limitation — anyone wanting a total spend needs to sumcoordinator.get_cost() + sql_specialist.get_cost()themselves. - When to prefer this over one chat with many tools: when a sub-task needs a materially different system prompt, tool set, or even a different/cheaper model, or when you want to cap what context a sub-task is exposed to.
- Note
register_tool'smodel=parameter for cases where the specialist call needs more structured input than plain strings.
Alternatives / prior art
Related: #43 (a gallery/collection of common tool-calling recipes) — this could live as one gallery entry there instead of/in addition to a standalone article; worth cross-linking either way.
Open questions
- Standalone article vs. a section added to an existing tool-calling page?
- Should this also mention
to_solver()/InspectAI as a tangential way to evaluate sub-agents, or keep scope tight to the delegation pattern itself?
Drafted from a competitive review of llm / Pydantic AI / LangChain / LiteLLM (July 2026); filed via Claude Code on behalf of @cpsievert.
- 主要言語
- Python
- スター
- 179
- フォーク
- 32
- 平均マージ
- 1日 3時間
- マージ済み PR(30日)
- 10
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
posit-dev/chatlas のほかの issue
-
A streaming text delta that repeats everything streamed so far is missing from the recorded turn対応中かも @cpsievert が 81 日前に担当しました。 オープンai-triage:done Priority: Medium
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
ai-triage:done Priority: Low
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 1 日以内に返信
-
ai-triage:done Priority: Medium
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
posit-dev/chatlas#432 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
posit-dev/chatlas の issue をすべて見る
似ている issue
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
country:US rating:6 request-theme type:TV SHOW
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
LizardByte/ThemerrDB#10501 · コメント 1 件 ·
-
triage/confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
agentscope-ai/agentscope#4563 ·
メンテナーはふだん 2 日以内に返信
-
comp/desktop desktop/chat P3 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
NousResearch/hermes-agent#164451 ·
メンテナーはふだん 1 日以内に返信
-
external integration integration-submission
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
langchain-ai/docs#8426 ·
メンテナーはふだん 1 日以内に返信