$30 off During Our Annual Pro Sale. View Details »

LLM Meetup Tokyo #2 手続きを記憶するコマンド型エージェントの実装

Ryunosuke Iwai
May 19, 2023
3k

LLM Meetup Tokyo #2 手続きを記憶するコマンド型エージェントの実装

Ryunosuke Iwai

May 19, 2023
Tweet

Transcript

  1. ݱࡏ લ৬ גࣜձࣾϝϧΧϦ Microservices Platform CI/CD ࣾ಺ͷ৽CIγεςϜͷ։ൃɾҠߦ @ey_ryunosuke ࣗݾ঺հ Cloudbaseגࣜձࣾ

    ιϑτ΢ΣΞΤϯδχΞ Ϋϥ΢υηΩϡϦςΟαʔϏεͷ։ൃ AI Labͷ্ཱͪ͛ʢ1ਓʣ ٕज़ελοΫ: Golang, TypeScript, AWS Twitter: @ey_nosukeru
  2. ࣗ཯ܕΤʔδΣϯτͷۀ຿׆༻ʹ޲͚ͯ • ࣗ཯ܕΤʔδΣϯτ = ༩͑ΒΕͨπʔϧΛ࢖͍ͳ͕Βɺ ࣗ෼Ͱߟ͑ͯ৭ʑ΍ͬͯ͘ΕΔ܅ ◦ BabyAGI, AutoGPT ͳͲ͕࿩୊ʹ

    • ເͷΑ͏ͳٕज़͕ͩɺ՝୊΋ଟ͍ ◦ ಈ࡞ͷෆ҆ఆੑ ▪ ظ଴ͨ͠ग़ྗΛग़ͯ͘͠Εͳ͍ ▪ ແݶϧʔϓͯ͠Δ ◦ ͔͔࣌ؒΓ͗͢ɺτʔΫϯ৯΂͗͢ ◦ ίϯςΩετ௕ͷݶք https://github.com/yoheinakajima/babyagi
  3. Command Agent • ϕʔε͸ langchainͷΤʔδΣϯτ࣮૷ ◦ λεΫͱπʔϧΛ༩͑ͯɺthought, action, action inputΛ܁Γฦ͠ग़ྗͤ͞Δ

    • λεΫͱεςοϓΛςϯϓϨʔτԽ͍ͨ͠ → ม਺ͰύϥϝʔλԽ • Commandͱ͍͏ΞΫγϣϯ୯Ґ (≒ ؔ਺) 1. Ұ࿈ͷखଓ͖ΛύοέʔδԽͨ͠΋ͷ 2. ࣄલఆٛͨ͠֎෦πʔϧ (langchainͷToolͷϥούʔ) • ίϚϯυͱ࢖͏ม਺ΛܾΊΔPlannning Agentͱɺ࢖͏ม਺͔ΒίϚϯυͷೖྗΛ࡞Δ Command Executor
  4. ྫɿ[URL]ͷ಺༰Λ[NotionDB]ʹอଘ͢Δʢϓϥϯχϯάʣ • step1: ◦ Planning Agentʮ[URL]Λ࢖ͬͯɺGetURLContentΛ࣮ߦʯ ◦ Command ExecutorʮGetURLContent(url: [URL])ʯ

    • step2: ◦ Planning Agentʮ[NotionDB]Λ࢖ͬͯɺSearchNotionDatabaseΛ࣮ߦʯ ◦ Command ExecutorʮSearchNotionDatabase(database_name: [NotionDB])ʯ • step3: ◦ Planning Agentʮ[step1.output]ͱ[step2.output]Λ࢖ͬͯɺInsertNotionPageΛ࣮ߦʯ ◦ Command ExecutorʮInsertNotionPage(database_id: [step2.output.database_id], content: [step1.output])ʯ • step 4: ◦ Planning Agentʮ[step3.output]Λ࢖ͬͯɺReturnΛ࣮ߦʯ ◦ Command ExecutorʮReturn(page_url: step3.output)ʯˠಈ࡞׬ྃ
  5. ྫɿ[URL]ͷ಺༰Λ[NotionDB]ʹอଘ͢ΔʢίϚϯυ࣮ߦʣ • step1: ◦ Planning Agentʮ[URL]Λ࢖ͬͯɺGetURLContentΛ࣮ߦʯ ◦ Command ExecutorʮGetURLContent(url: [URL])ʯ

    • step2: ◦ Planning Agentʮ[NotionDB]Λ࢖ͬͯɺSearchNotionDatabaseΛ࣮ߦʯ ◦ Command ExecutorʮSearchNotionDatabase(database_name: [NotionDB])ʯ • step3: ◦ Planning Agentʮ[step1.output]ͱ[step2.output]Λ࢖ͬͯɺInsertNotionPageΛ࣮ߦʯ ◦ Command ExecutorʮInsertNotionPage(database_id: [step2.output.database_id], content: [step1.output])ʯ • step 4: ◦ Planning Agentʮ[step3.output]Λ࢖ͬͯɺReturnΛ࣮ߦʯ ◦ Command ExecutorʮReturn(page_url: step3.output)ʯˠಈ࡞׬ྃ