Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Amazon BedrockとOpenSearch Serviceでなんでも答えられる社内RA...
Search
とすり
July 31, 2024
Technology
0
280
Amazon BedrockとOpenSearch Serviceでなんでも答えられる社内RAGを作成する!!
とすり
July 31, 2024
Tweet
Share
More Decks by とすり
See All by とすり
Amazon BedrockでサーバレスなAIお料理ボットを作成する!!
tosuri13
0
36
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
370
Radix UI & shadcn/uiのススメ
tosuri13
0
87
Other Decks in Technology
See All in Technology
OCI コスト管理
ocise
1
160
RAGHack: Kickoff and RAG 101
pamelafox
0
270
ビジネスとエンジニアリングを繋ぐプロダクトを中心とした組織づくりの実践
sansantech
PRO
1
130
Functional TypeScript
naoya
10
4.1k
Oracle Database Backup Service:サービス概要のご紹介
oracle4engineer
PRO
0
4k
音声AIエージェントの世界とRetell AI入門 / Introduction to the World of Voice AI Agents and Retell AI
rkaga
4
850
Oracle Exadata Database Service(Dedicated Infrastructure):サービス概要のご紹介
oracle4engineer
PRO
0
9.4k
Azure SQL Database Hyperscale HA レプリカの監視
sansantech
PRO
0
220
エンジニア向け会社紹介資料
caddi_eng
15
250k
Eventual Detection Engineering
ken5scal
0
1k
ロリポップ! for Gamersを支えるインフラ/lolipop for gamers infrastructure
takumakume
0
100
ロボットアームを遠隔制御の話 & LLMをつかったIoTの話もしたい
soracom
PRO
1
230
Featured
See All Featured
Large-scale JavaScript Application Architecture
addyosmani
508
110k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
326
21k
A better future with KSS
kneath
235
17k
Visualization
eitanlees
142
15k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
Design by the Numbers
sachag
277
19k
Fireside Chat
paigeccino
31
2.9k
BBQ
matthewcrist
83
9.1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
123
18k
Git: the NoSQL Database
bkeepers
PRO
425
64k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
88
16k
Designing with Data
zakiwarfel
98
5k
Transcript
Am a zon BedrockͱOpenSe a rch Service ͰͳΜͰ͑ΒΕΔࣾRAGΛ࡞͢Δ!! @tosuri13
@tosuri13 ࣗݾհ ͱ͢Γ @tosuri13 MOTEXגࣜձࣾ ॴଐ 🐧 Μ͗Μ͕͖Ͱ͢
@tosuri13 ࠔ͍ͬͯͨ͜ͱ Γ͍ͨ͜ͱ͕ॻ͔Ε͍ͯΔࢿྉΛύοͱݟ͚ͭΒΕͳ͍!! ɹˠ طଘͷRAGιϦϡʔγϣϯϑϧϚωʔδυͳAWSαʔϏεɺυΩϡϝϯ τॲཧͷॊೈੑίετ໘Ͱؾܰʹࢼͮ͠Β͍… ɹˠ ࣗͨͪͰࣾͷυΩϡϝϯτΛݕࡧͯ͠AIʹճͯ͠Β͏ಠࣗͷRAGΞ ϓϦέʔγϣϯΛ࡞Ζ͏!!
@tosuri13 RAGͱ? RAG(Retriev a l Augmented Gener a tion)ͱɺ֎෦͔Βऔಘͨ͠ճͷࢀߟͱͳ ΔใΛLLMʹࢀরͤͯ͞ճΛੜ͢Δख๏Ͱ͢ɻ
RAGΛ͏͜ͱʹΑͬͯɺLLM͕ຊདྷΓಘͳ͍ใΛิͯ͠ճΛੜͤ͞ Δ͜ͱ͕Ͱ͖ΔΑ͏ʹͳΓ·͢!! ֎෦DB LLM AIΛ༻͍ͯݕࡧ ྨࣅ͢ΔใΛ͢ औಘͨ͠ใΛ ࢀরͯ͠ճ
@tosuri13 ϕΫτϧݕࡧʹ͍ͭͯ ·ͨɺࢀߟใͱ͍ͯͨ͠͠υΩϡϝϯτΛݕࡧ͢ΔͨΊʹɺϕΫτϧݕࡧ ͱ͍͏ख๏͕RAGγεςϜͰ͘࠾༻͞Ε͍ͯ·͢ɻϕΫτϧݕࡧʹΑΓࣗવ ݴޠΛ༻͍ͨυΩϡϝϯτͷݕࡧ͕Ͱ͖ΔΑ͏ʹͳΓ·͢!! ϕΫτϧετΞ [0.8, 0.3, 0.1 …
] [0.4, 0.4, 0.3 … ] [0.5, 0.7, 0.8 … ] େྔͷυΩϡϝϯτ ࣭ [0.8, 0.3, 0.2 … ] ࣭ϕΫτϧԽͯ͠ ࣅ͍ͯΔϕΫτϧΛݕࡧ͢Δ!! υΩϡϝϯτΛϕΫτϧԽͯ͠ ྨࣅ͢ΔจষΛ୳͘͢͢͠Δ!!
ૣRAGΞϓϦέʔγϣϯΛAWSͰ࡞ͬͯΈͨ!! @tosuri13
@tosuri13 ༻͢ΔAWSαʔϏεΛϐοΫΞοϓ!! ɾAm a zon Bedrock ɹˠ ճϕΫτϧͷੜʹ༻͠·͢ɻ༻͢Δج൫ϞσϧҎԼͷ2ͭͰ͢ɻ ɹɹ- Cl
a ude 3.5 Sonnet (ճੜ༻) ɹɹ- Tit a n Text Embedding v2 (ϕΫτϧੜ༻) ɾAm a zon OpenSe a rch Service ɹˠ ϕΫτϧΛ֨ೲͯ͠ηϚϯςΟοΫݕࡧΛߦ͏ϕΫτϧετΞͱͯ͠༻͠·͢ɻ ɾAm a zon S3 ɹˠ ݩͷυΩϡϝϯτͱࣝผࢠࢀরݩURLͳͲͷϝλσʔλΛอ͠·͢ɻ
@tosuri13 RAGΞϓϦέʔγϣϯͷAWSߏਤ νϟοτΞϓϦ ཧऀ API G a tew a y
L a mbd a SNS Bedrock L a mbd a OpenSe a rch L a mbd a S3 Bedrock ճ ͷ ฦ ৴ ճͷੜ ϕΫτϧετΞ υΩϡϝϯτཧ ϕΫτϧม ॳճԠ (λΠϜΞτରࡦ) WebhookͰ࣭Λૹ৴
@tosuri13 ԿͰฉ͚ΔΑ͏ʹͳͬͨ!! ࣮ࡍͷճΛ͓ݟͤ͢Δ͜ͱͰ͖·ͤΜ͕ɺνϟοτΞϓϦΛ༻ͯ͠ҎԼͷ Α͏ͳΠϝʔδͰճͯ͠Β͏͜ͱ͕Ͱ͖ΔΑ͏ʹͳΓ·ͨ͠!! RAGΞϓϦέʔγϣϯ ࠔ͍ͬͯΔࣾһ ͜ͷAPIͬͯͲ͏͍͏Ϩεϙϯε ฦ͢Μ͚ͩͬ… ઃܭࢿྉʹΑΔͱ͜ͷΑ͏ͳεΩʔϚͷ Ϩεϙϯε͕ฦ͞ΕϚεɻ
ɹ{JSONεΩʔϚ} ɾAPIઃܭࢿྉͷURL ɾAPIઃܭ࣌ͷMTGࢿྉͳͲͷURL νϟοτͰ࣭
ࡉ͔͍࣮ͨ͠ϙΠϯτ!! @tosuri13
@tosuri13 ᶃ νϟϯΫͷׂํ๏ νϟοτΞϓϦ ཧऀ API G a L a
SNS Bedrock L a OpenSe a rch L a mbd a S3 Bedrock ճ ͷ ฦ ৴ ճͷੜ ϕΫτϧDB υΩϡϝϯτཧ ϕΫτϧม ॳճԠ (λΠϜΞτରࡦ) WebhookͰ࣭Λૹ৴
@tosuri13 ᶃ νϟϯΫͷׂํ๏ ϕΫτϧΛੜ͢ΔݩͱͳΔจࣈྻɺա͗ͯա͗ͯճͷਫ਼͕ѱԽ ͯ͠͠·͏Մೳੑ͕͋Γ·͢ɻ ɾจࣈྻ͕ա͗Δ → LLMʹஅยతͳใ͔͠༩͑ΒΕͳ͍ ɾจࣈྻ͕ա͗Δ →
ॏཁͳจ຺͕΅͚ͯ͠·͍ɺਖ਼͘͠ݕࡧ͞Εͳ͍Մೳੑ͕ߴ·Δ ɹˠ దʹυΩϡϝϯτΛνϟϯΫׂͯ͠ϕΫτϧԽ͢Δඞཁ͕͋Δ!!
@tosuri13 ᶃ νϟϯΫͷׂํ๏ ͲͷυΩϡϝϯτ౷ҰతʹM a rkdownʹมΛߦ͍ɺH1H2λά͝ͱʹׂ͢ Δ͜ͱͰɺదͳαΠζ͔ͭจ຺Λอ࣋ͨ͠ঢ়ଶͰνϟϯΫׂΛ͍ͯ͠·͢ɻ htmlɾcsvɾtxtͳͲ M a
rkdown # ேྱMTGϝϞ ## ਐḿ֬ೝ ɹ- A͞Μ: ͍͢͝ਐΜͰΔɺେৎͦ͏ ɹ- B͞Μ: શવਐΜͰͳ͍ɺࠔͬͨ… ## ࠓͷλεΫ ɹ- Xࣾͱͷଧͪ߹Θͤ ɹ- ์ஔ͞Ε͍ͯΔίϯϑϦΫτΛमਖ਼͢Δ S3͔ΒͷΠϕϯτ௨Λड͚औͬͯ M a rkdownʹม!! ҎԼͷΑ͏ͳΠϝʔδͰνϟϯΫׂ!!
@tosuri13 ᶄ Tool useʹΑΔCit a tions νϟοτΞϓϦ ཧऀ API G
a L a SNS Bedrock L a mbd a OpenSe a rch L a S3 Bedrock ճ ͷ ฦ ৴ ճͷੜ ϕΫτϧDB υΩϡϝϯτཧ ϕΫτϧม ॳճԠ (λΠϜΞτରࡦ) WebhookͰ࣭Λૹ৴
@tosuri13 ᶄ Tool useʹΑΔCit a tions ϕΫτϧݕࡧʹΑΓऔಘͨ͠υΩϡϝϯτʹɺඞͣؔ͠࿈͢ΔใͷΈؚ͕ ·Ε͍ͯΔͱݶΓ·ͤΜɻͦͷͨΊɺҾ༻ݩͱͳΔURLΛฦ͢߹࣭ͱؔ ͷͳ͍URLؚ͕·Εͯ͠·͏ͳͲ͕͋Γ·͢ɻ RAGΞϓϦέʔγϣϯ
༗څͷਃํ๏Λڭ͑ͯ!! ͍͔ͭ͘ݟ͚͖ͭͯ·γλɻ ɾ{ܦඅਃํ๏ͷURL} ɾ{༗څਃํ๏ͷURL} ɾ{ೖୀࣨਃํ๏ͷURL} ٳΈ͍ͨࣾһ ؔͷͳ͍URL ճʹؚΊͯ΄͘͠ͳ͍
@tosuri13 ᶄ Tool useʹΑΔCit a tions LLM͕ࢀߟʹͨ͠༰ͷΈΛฦ͢ϓϩϯϓτΤϯδχΞϦϯάͷख๏ΛCit a tions ͱ͍͍ɺAm
a zon BedrockͷConverse APIʹࡌ͞Ε͍ͯΔTool use (Function C a lling)Λ༻࣮ͯ͠͠·ͨ͠ɻ Ϩεϙϯεͷܗࣜઆ໌Λهࡌͨ͠ πʔϧͷεΩʔϚΛఆٛͯ͢͠ εΩʔϚ LLM ߏԽ͞Εͨঢ়ଶͰʮԿΛࢀߟʹͨ͠ͷ͔?ʯΛड͚औΕΔ!!
@tosuri13 ᶄ Tool useʹΑΔCit a tions ·ͨɺఏڙ͞ΕͨπʔϧΛ͏͔൱͔LLM͕அͯ͠ϨεϙϯεΛฦͨ͢Ίɺ ࢀߟʹͳΔใ͕શ͘ͳ͔ͬͨ߹ͳͲʹϋϧγωʔγϣϯΛ͑ΔΑ͏ͳ͜ͱ Ͱ͖·͢!! RAGΞϓϦέʔγϣϯ
৯͍͠Μͳࣾһ େࡕपลͷඒຯ͍͠ ͓Έম͖ͷ͓ళΛڭ͑ͯ!! ͋ͳͨͷΦϑΟεʹʮܦඅਃʯ ͱ͍͏໊લͷ͓Έম͖͞Μ͕ ซઃ͞Ε͍ͯΔΑ͏σεɻ ɾ{ܦඅਃํ๏ͷURL} ࢀߟใΛݩʹӕͷ༰Λ ճ͢ΔΑ͏ͳ͜ͱΛ͛Δ!!
·ͱΊ @tosuri13
@tosuri13 ·ͱΊͱײ Am a zon BedrockͱOpenSe a rchΛ͏͜ͱͰɺؾܰʹRAGΞϓϦέʔγϣϯΛ ߏங͢Δ͜ͱ͕Ͱ͖·ͨ͠!!·ͨɺಠࣗͰRAGΛ࣮͢Δ͜ͱʹΑΓɺAIγεςϜ ͷࣝؔ࿈͢ΔAWSαʔϏεͷཧղ͕ਂ·Γ·ͨ͠!!
ࢲͷLTΛฉ͍ͯRAGʹڵຯΛ࣋ͬͨํ͕͍Εɺͥͻࣗ͝Ͱ࣮ͯ͠ࢼͯ͠Έ ͯ΄͍͠ͱࢥ͍·͢!!
@tosuri13 ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠!!