複数のAIエージェントを管理し、複雑な会話を処理するための柔軟で強力なフレームワーク。
マルチエージェントオーケストレーターは、複数のAIエージェントを管理し、複雑な会話を処理するための柔軟なフレームワークです。クエリをインテリジェントにルーティングし、相互作用全体でコンテキストを維持します。
このシステムは、迅速な展開のために事前に構築されたコンポーネントを提供し、カスタムエージェントや会話メッセージストレージソリューションの簡単な統合も可能にします。
この適応性により、シンプルなチャットボットから洗練されたAIシステムまで、多様な要件に対応し、効率的にスケーリングする幅広いアプリケーションに適しています。
マルチエージェントオーケストレーターをすばやく感じるために、いくつかの基本エージェントを備えたデモアプリを提供しました。このインタラクティブなデモは、ユーザーフレンドリーなインターフェイスでオーケストレーターの機能を紹介します。デモアプリの設定と実行の詳細については、デモアプリのセクションを参照してください。
以下の画面録画では、6つの専門エージェントを使用するデモアプリの拡張バージョンを示します。
システムが、フライトの予約から天気のチェック、数学の問題の解決、健康情報の提供まで、多様なトピック間のコンテキストをシームレスに切り替えるのを見てください。クエリごとに適切なエージェントがどのように選択されているかに注意して、簡単なフォローアップ入力があっても一貫性を維持します。
デモは、コンテキストを維持し、さまざまなドメインで特殊なエージェントを活用しながら、複雑でマルチターンの会話を処理するシステムの能力を強調しています。
マルチエージェントオーケストレーターの感触をすばやく入手するには、デモアプリをご覧ください。追加のコードの例は、ドキュメントフォルダーとexamplesフォルダーの両方で利用できます。
多様な一連の例を通して、マルチエージェントオーケストレーターで実践的な体験を得る:
examplesフォルダーで実装の実装を調べます。chat-demo-app :複数の専門エージェントとのWebベースのチャットインターフェイスecommerce-support-simulator :AI搭載のカスタマーサポートシステムchat-chainlit-app :ChainLitで構築されたチャットアプリケーションfast-api-streaming :ストリーミングサポートを備えたFastAPI実装text-2-structured-output :構造化されたデータに対する自然言語bedrock-inline-agents :岩盤インラインエージェントサンプルすべての例は、PythonとTypeScriptの両方の実装で利用できます。マルチエージェントオーケストレーターのセットアップと使用に関する包括的なガイドのドキュメントをご覧ください!
マルチエージェントオーケストレーターの創造的な実装と多様なアプリケーションを発見してください。
「ボンジュール」から「搭乗券」まで:フライト予約用の多言語AIチャットボット
この記事では、マルチエージェントオーケストレーターフレームワークを使用して多言語チャットボットを構築する方法を示しています。この記事では、 Amazon Lex Botをエージェントとして使用する方法と、他の2つの新しいエージェントとともに、わずか数行のコードで多くの言語で機能させる方法について説明します。
自動レプリーを超えて:AI搭載のeコマースサポートシステムの構築
この記事では、自動化されたeコマースカスタマーメールサポートのためのAI駆動型マルチエージェントシステムを構築する方法を示しています。マルチエージェントオーケストレーターフレームワークを使用して、専門的なAIエージェントのアーキテクチャとセットアップをカバーし、自動処理と人間のループ監視を統合します。このガイドでは、電子メールの摂取、インテリジェントルーティング、自動化された応答生成、および人間の検証を調査し、AI効率とカスタマーサポートにおける人間の専門知識のバランスをとる包括的なアプローチを提供します。
Speak Up、AI:Amazon Connect、Lex、およびBedrockでエージェントを声に出します
この記事では、AIカスタマーコールセンターの構築方法を示しています。 Amazon ConnectとAmazon Lexを介してVoiceと対話するマルチエージェントオーケストレーターフレームワークを使用して、特殊なAIエージェントのアーキテクチャとセットアップをカバーしています。
npm install multi-agent-orchestrator次の例は、2つの異なるタイプのエージェントを備えたマルチエージェントオーケストレーターを使用する方法を示しています:Converse APIサポートを備えた岩盤LLMエージェントとLEXボットエージェント。これは、さまざまなAIサービスを統合する際のシステムの柔軟性を示しています。
import { MultiAgentOrchestrator , BedrockLLMAgent , LexBotAgent } from "multi-agent-orchestrator" ;
const orchestrator = new MultiAgentOrchestrator ( ) ;
// Add a Bedrock LLM Agent with Converse API support
orchestrator . addAgent (
new BedrockLLMAgent ( {
name : "Tech Agent" ,
description :
"Specializes in technology areas including software development, hardware, AI, cybersecurity, blockchain, cloud computing, emerging tech innovations, and pricing/costs related to technology products and services." ,
streaming : true
} )
) ;
// Add a Lex Bot Agent for handling travel-related queries
orchestrator . addAgent (
new LexBotAgent ( {
name : "Travel Agent" ,
description : "Helps users book and manage their flight reservations" ,
botId : process . env . LEX_BOT_ID ,
botAliasId : process . env . LEX_BOT_ALIAS_ID ,
localeId : "en_US" ,
} )
) ;
// Example usage
const response = await orchestrator . routeRequest (
"I want to book a flight" ,
'user123' ,
'session456'
) ;
// Handle the response (streaming or non-streaming)
if ( response . streaming == true ) {
console . log ( "n** RESPONSE STREAMING ** n" ) ;
// Send metadata immediately
console . log ( `> Agent ID: ${ response . metadata . agentId } ` ) ;
console . log ( `> Agent Name: ${ response . metadata . agentName } ` ) ;
console . log ( `> User Input: ${ response . metadata . userInput } ` ) ;
console . log ( `> User ID: ${ response . metadata . userId } ` ) ;
console . log ( `> Session ID: ${ response . metadata . sessionId } ` ) ;
console . log (
`> Additional Parameters:` ,
response . metadata . additionalParams
) ;
console . log ( `n> Response: ` ) ;
// Stream the content
for await ( const chunk of response . output ) {
if ( typeof chunk === "string" ) {
process . stdout . write ( chunk ) ;
} else {
console . error ( "Received unexpected chunk type:" , typeof chunk ) ;
}
}
} else {
// Handle non-streaming response (AgentProcessingResult)
console . log ( "n** RESPONSE ** n" ) ;
console . log ( `> Agent ID: ${ response . metadata . agentId } ` ) ;
console . log ( `> Agent Name: ${ response . metadata . agentName } ` ) ;
console . log ( `> User Input: ${ response . metadata . userInput } ` ) ;
console . log ( `> User ID: ${ response . metadata . userId } ` ) ;
console . log ( `> Session ID: ${ response . metadata . sessionId } ` ) ;
console . log (
`> Additional Parameters:` ,
response . metadata . additionalParams
) ;
console . log ( `n> Response: ${ response . output } ` ) ;
} # Optional: Set up a virtual environment
python -m venv venv
source venv/bin/activate # On Windows use `venvScriptsactivate`
pip install multi-agent-orchestratorこれは、岩盤LLMエージェントとLEXボットエージェントを使用したマルチエージェントオーケストレーターの使用を示す同等のPythonの例です。
import os
import asyncio
from multi_agent_orchestrator . orchestrator import MultiAgentOrchestrator
from multi_agent_orchestrator . agents import BedrockLLMAgent , LexBotAgent , BedrockLLMAgentOptions , LexBotAgentOptions , AgentCallbacks
orchestrator = MultiAgentOrchestrator ()
class BedrockLLMAgentCallbacks ( AgentCallbacks ):
def on_llm_new_token ( self , token : str ) -> None :
# handle response streaming here
print ( token , end = '' , flush = True )
tech_agent = BedrockLLMAgent ( BedrockLLMAgentOptions (
name = "Tech Agent" ,
streaming = True ,
description = "Specializes in technology areas including software development, hardware, AI,
cybersecurity, blockchain, cloud computing, emerging tech innovations, and pricing/costs
related to technology products and services." ,
model_id = "anthropic.claude-3-sonnet-20240229-v1:0" ,
callbacks = BedrockLLMAgentCallbacks ()
))
orchestrator . add_agent ( tech_agent )
# Add a Lex Bot Agent for handling travel-related queries
orchestrator . add_agent (
LexBotAgent ( LexBotAgentOptions (
name = "Travel Agent" ,
description = "Helps users book and manage their flight reservations" ,
bot_id = os . environ . get ( 'LEX_BOT_ID' ),
bot_alias_id = os . environ . get ( 'LEX_BOT_ALIAS_ID' ),
locale_id = "en_US" ,
))
)
async def main ():
# Example usage
response = await orchestrator . route_request (
"I want to book a flight" ,
'user123' ,
'session456'
)
# Handle the response (streaming or non-streaming)
if response . streaming :
print ( " n ** RESPONSE STREAMING ** n " )
# Send metadata immediately
print ( f"> Agent ID: { response . metadata . agent_id } " )
print ( f"> Agent Name: { response . metadata . agent_name } " )
print ( f"> User Input: { response . metadata . user_input } " )
print ( f"> User ID: { response . metadata . user_id } " )
print ( f"> Session ID: { response . metadata . session_id } " )
print ( f"> Additional Parameters: { response . metadata . additional_params } " )
print ( " n > Response: " )
# Stream the content
async for chunk in response . output :
if isinstance ( chunk , str ):
print ( chunk , end = '' , flush = True )
else :
print ( f"Received unexpected chunk type: { type ( chunk ) } " , file = sys . stderr )
else :
# Handle non-streaming response (AgentProcessingResult)
print ( " n ** RESPONSE ** n " )
print ( f"> Agent ID: { response . metadata . agent_id } " )
print ( f"> Agent Name: { response . metadata . agent_name } " )
print ( f"> User Input: { response . metadata . user_input } " )
print ( f"> User ID: { response . metadata . user_id } " )
print ( f"> Session ID: { response . metadata . session_id } " )
print ( f"> Additional Parameters: { response . metadata . additional_params } " )
print ( f" n > Response: { response . output . content } " )
if __name__ == "__main__" :
asyncio . run ( main ())これらの例は、次のことを示しています。
分類器および/またはエージェントに人類またはOpenaiを使用する場合は、関連する追加機能を備えたマルチエージェントオルチェストレーターを必ずインストールしてください。
pip install " multi-agent-orchestrator[anthropic] "
pip install " multi-agent-orchestrator[openai] "完全なインストール(人類およびOpenaiを含む)の場合:
pip install " multi-agent-orchestrator[all] " 貢献を歓迎します!詳細については、寄稿ガイドをご覧ください。
私たちの素晴らしい貢献者に大声で叫ぶ!このプロジェクトを改善してくれてありがとう! ?
バグフィックスと改善を提案する方法に関するガイドラインについては、寄稿ガイドをご覧ください。
このプロジェクトは、Apache 2.0ライセンスに基づいてライセンスされています - 詳細については、ライセンスファイルを参照してください。
このプロジェクトでは、SILオープンフォントライセンス1.1でライセンスされたJetBrainsmono NFフォントを使用しています。完全なライセンスの詳細については、font-license.mdを参照してください。