Share
Embed
Transcript
27 slides
-
LangGraphでできること • Chatbots (カスタマーサポート, 情報収集, コードアシスタント) • Multi-Agent Systems (Collaboration,
Supervision) • RAG(Adaptive RAG, Corrective RAG, Self-RAG) • Planning Agents(Plan-and-Execute) • Reflection & Critique • Evaluation • Competitive Programming -
LangGraphとFlow Engineering AIエージェント開発の時代の流れ zero shot, few shot →function calling, RAG
→agentic workflows(aka “flow engineering”) https://blog.langchain.dev/how-to-build-the-ultimate-ai-automation-with-multi-agent-collaboration/ -
LangGraphとFlow Engineering Flow Engineeringとは Flowは複数のエージェントが協力し、環境やお互いと対話してタスクを完了す る反復的なプロセスのこと Flow Engineeringはタスクをより小さなステップに分解し、LLMに回答を自 己改善するように促すことでプロンプトエンジニアリングを向上させ、精度と ポフォーマンスを向上させる
https://medium.com/@rohanbalkondekar/flow-engineering-is-all-you-need-9046a5e7351d https://arxiv.org/abs/2401.08500 -
“I think AI agent workflows will drive massive AI progress
this year — perhaps even more than the next generation of foundation models. This is an important trend, and I urge everyone who works in AI to pay attention to it.”(Andrew Ng) 訳: AIエージェントのワークフローは、今年のAIの大きな進歩をもたらすと考 えています。次世代の基盤モデルよりも大きな影響を与えるかもしれません。 これは重要なトレンドであり、AIに関わるすべての人が注目すべきだと強く思 います。 https://www.deeplearning.ai/the-batch/how-agents-can-improve-llm-performance/?utm_campaign=The+Batch&utm_source=hs_ email&utm_medium=email&_hsenc=p2ANqtz--9ARMthd09q0ABUi-abo6BH62BLbcwPo13LrXs9hUezs-L050Ay7b_rHdWuRIqB VOD6k_S deeplearning.aiにて教材もでている (2024 6/6) https://www.deeplearning.ai/short-courses/ai-agents-in-langgraph/ LangGraphとFlow Engineering -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration ・Agent ・Researcher 検索をさせたり、その結果を考察する ・Chart Generator 結果をグラフで可視化する
・Tool ・python_repl code生成、実行 ・tavily_tool AIエージェント専用の検索エンジン -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration model: gpt-4o ユーザーからの問い合わせ Fetch the UK’s
GDP for the last five years(2019-2023), then draw a line graph of it. Once you code it up, finish. Researcherがtavily APIを実行 query: UK GDP for the last five years 2019-2023 -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration Researcherがtavily APIの結果をフィードバック Here are the GDP
figures for the United Kingdom for the last five years based on the available data: **UK GDP in Billions (USD)** - 2019: $2,851.41B - 2020: $2,697.81B - 2021: $3,141.51B - 2022: (Data not provided explicitly in the search result) - 2023: (Data not provided explicitly in the search result) I'll use the available data to plot the line graph for the years 2019-2021. For 2022 and 2023, I will need to estimate or find the missing values. Let me search for the missing values for 2022 and 2023. 欠損値あり -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration Researcherがtavily APIの結果をフィードバック I found the GDP
data for 2022, but 2023 is not explicitly mentioned. Here is the updated data: **UK GDP in Billions (USD)** - 2019: $2,851.41B - 2020: $2,697.81B - 2021: $3,141.51B - 2022: (Not explicitly found, but I can use a reliable estimate or search more if needed) - 2023: (Not explicitly found, but I can use a reliable estimate or search more if needed) To complete the graph, I can estimate the values for 2022 and 2023 based on the available trend data or search further for more specific values. How would you prefer to proceed? 変わらず明確な値を取 ることができなかった 値を推定することに -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration 2022,2023年のGDPを推定 Let's estimate the GDP for
2022 and 2023 using a reasonable growth rate based on the past trends and available data, then plot the line graph. First, let's calculate the growth rates for the years we have data: **Growth Rates:** - From 2019 to 2020: \[ \text{Growth Rate} = \frac{2697.81 - 2851.41}{2851.41} \times 100 \approx -5.39\% \] - From 2020 to 2021: \[ \text{Growth Rate} = \frac{3141.51 - 2697.81}{2697.81} \times 100 \approx 16.45\% \] Assuming a moderate growth rate of around 3% per year for the next two years (2022-2023) due to recovery from the pandemic, we can estimate the GDP for the missing years. **Estimations:** - 2022: \[ 3141.51 \times 1.03 \approx 3235.75 \text{ billion USD} \] - 2023: \[ 3235.75 \times 1.03 \approx 3332.82 \text{ billion USD} \] -
LangGraphでのマルチエージェントの例 Basic Multi-agent Collaboration まとめ token 25,611 prompt tokens /
974 completion tokens 実行時間 264.10s やはりtoken消費量は多く、実行時間は長い 2022年のGDPに関しては検索したサイトに掲載されているのにも関わらず、エージェントは 値を検知することができず、推定を始めていた。(調整は必要) -
まとめ、展望 - LangGraphの概要、FLow Engineeringについて解説した - Productionで使われている事例が少ないので、今後も検証を回し慎重に導入したい - 実務でマルチエージェントを実装する場合は、精度を保ち、消費tokenを抑える工夫が必要 →Human-in-the-loop等
- マルチエージェントの実装をどのように評価していくかは今後の課題 - より直感的、効率的に開発するためにLangGraphアプリケーションを自然言語処理的に生 成、改善ができると良いのでは...(最初は最適な構成がわからない...) - GUI editorはほしい(https://github.com/langchain-ai/langgraph/discussions/513) - 他マルチエージェントフレームワークとの比較をしていきたい(AutoGen, langroid, crewAI)