Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
knowledge base fot amazon bedrockを使って、格安でRAG作ってみた
Search
そのだ
January 27, 2024
Technology
2.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
knowledge base fot amazon bedrockを使って、格安でRAG作ってみた
【doorkeeper】
https://jawsug-saga.doorkeeper.jp/events/166448
そのだ
January 27, 2024
More Decks by そのだ
See All by そのだ
ぽこまち:DeepSeek 4.0 Flashの推論パフォーマンス改善
sonoda_mj
0
39
DGX Sparkを2台使って いろいろ動かす話
sonoda_mj
1
180
Codex Microで 開発体験は変わるのか?
sonoda_mj
1
110
DGX Sparkを2台つないで 最強ローカルLLM環境を動かしてみた話
sonoda_mj
0
270
AGENTS.mdとSkillsで始めるAIエージェント活用
sonoda_mj
3
290
Google_ADKのSub_AgentをAgentic_Workflowに移行し_遷移成功率を改善した話.pdf
sonoda_mj
1
180
仕事はAIに任せてラスベガスへ行きたいのでDSPyで自分のクローンを作った
sonoda_mj
1
190
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
2.9k
RAGの基礎から実践運用まで:AWS BedrockとLangfuseで実現する構築・監視・評価
sonoda_mj
1
2.4k
Other Decks in Technology
See All in Technology
USB PDを使ってスマホを労わりたい
raspython3
0
160
AI時代だからこそ推したい!Gitコマンド再入門
munakata
0
190
「事実」を「計測」して、「解釈」する 〜AWS Lambdaのメモリ最適解の見つけ方〜
maimyyym
0
140
10年後、Engineering 行為を剥奪されるとして、わたしたちは、どう、何を創ればいいだろうか。 / If Engineering Is Taken Away in 10 Years, How and What Should We Create?
bitkey
PRO
1
160
Kiro Crewをはじめよう
kizawa2020
1
150
Webの常識が通じないHTMLメールのダークモード
teamlab
PRO
0
100
TinyGoでオブザーバビリティ?OpenTelemetryはTinyGoで使えるのか / Is OpenTelemetry available in TinyGo environment?
ymotongpoo
2
140
子育てエンジニアの可処分時間が減っても成長を諦めない戦い方
sudoakiy
6
4.5k
Conditional PED-ANOVA: Hyperparameter Importance in Hierarchical & Dynamic Search Spaces
pfn
PRO
0
110
今さら理解するウェブフォントver.2026
takanorip
3
690
脆弱性診断って、何をしているの? 〜弱点を見つけて、会社の改善につなげるまで〜
keeg
0
890
実践!Cloud Run ハンズオン!! / Cloud Run handson
y0hgi
2
260
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
360
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
330
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
300
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
We Have a Design System, Now What?
morganepeng
55
8.4k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
850
Building Applications with DynamoDB
mza
96
7.2k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Transcript
Knowledge Base for Amazon Bedrockと Pineconeを使って、格安でRAG作ってみた 【オフライン】JAWS-UG佐賀 2024年新年会LT 〜佐賀のエンジニアで乾杯︕〜 2024.1.27
苑⽥朝彰 1
⾃⼰紹介 苑⽥ 朝彰 Sonoda Tomotada - ID - Github︓tomomj -
Twitter︓@sonoda_mj - Work at - 株式会社 Fusic (フュージック) 技術創造部⾨所属 - ソフトウェアエンジニアリング - 新卒3年⽬ - Skill - AWS/React(Native)/Ruby on Rails 2
⾃⼰紹介 苑⽥ 朝彰 Sonoda Tomotada - ID - Github︓tomomj -
Twitter︓@sonoda_mj - Work at - 株式会社 Fusic (フュージック) 技術創造部⾨所属 - ソフトウェアエンジニアリング - 新卒3年⽬ - Skill - AWS/React(Native)/Ruby on Rails 3
アジェンダ 4 l 背景 l 事前知識 l knowledge base for
amazon bedrockとPineconeを使って、格安で RAG作ってみた l まとめ
01 背景
RAG面白そうだから 作ってみたい!!
従来のAWSにおけるRAG 7 引用:https://aws.amazon.com/jp/blogs/news/quickly-build-high-accuracy-generative-ai-applications- on-enterprise-data-using-amazon-kendra-langchain-and-large-language-models/
従来のAWSにおけるRAG 8 引用:https://aws.amazon.com/jp/blogs/news/quickly-build-high-accuracy-generative-ai-applications- on-enterprise-data-using-amazon-kendra-langchain-and-large-language-models/ 試すにはちょっと 高い。。。
ほっ…ほなVectorDBだけ安くし て、処理部分を自分で作ろう!
コサイン類似度 Embedding Model
コサイン類似度 Embedding Model ML初心者にはしんどい
手軽に安く作れる方法 はないんか!!
None
なんか簡単に作れそう
これ使ってみよか〜
できるだけ工数やお金をかけずに RAGを作って遊びたい!!
02 事前知識
事前知識 18 l 検索拡張生成(RAG)とは l Knowledge Base For Amazon Bedrockとは
l Pineconeとは
事前知識 19 l 検索拡張生成(RAG)とは l Knowledge Base For Amazon Bedrockとは
l Pineconeとは
検索拡張⽣成(RAG)とは 20 Retrieval Augmented Generation(RAG) 生成系の言語 AI モデルに外部メモリをつけるというコンセプトのことを指す Vector Database
LLM 質問 検索 返答 検索結果 引用:https://github.com/aws-samples/jp-rag-sample
検索拡張⽣成(RAG)とは 21 事前に学習したデータに関しては返答することができる AWSについて教えて AWSってのはな・・・ LLM
検索拡張⽣成(RAG)とは 22 しかし、学習していない内容に関しては答えられない 苑田について教えて 誰やねん 私の知識はxxxx年まででぇ〜
検索拡張⽣成(RAG)とは 23 外部のデータベースなどを紐づけることで、新しい情報やプライベートの情報に関す る回答を生成することができる Vector Database 苑田について教えて 新しいデータをベクトル化 して格納
検索拡張⽣成(RAG)とは 24 外部のデータベースなどを紐づけることで、新しい情報やプライベートの情報に関す る回答を生成することができる Vector Database 近いベクトルを探す 「苑田について教えて」を ベクトル化
検索拡張⽣成(RAG)とは 25 外部のデータベースなどを紐づけることで、新しい情報やプライベートの情報に関す る回答を生成することができる Vector Database 検索結果を返す
検索拡張⽣成(RAG)とは 26 外部のデータベースなどを紐づけることで、新しい情報やプライベートの情報に関す る回答を生成することができる Vector Database 苑田ってのはな
事前知識 27 l 検索拡張生成(RAG)とは l Knowledge Base For Amazon Bedrockとは
l Pineconeとは
Bedrockとは 28 "*-BCTɺ"OUISPQJDɺ$PIFSFɺ.FUBɺ4UBCJMJUZ"*ɺ"NB[POͳͲͷେख "*اۀ͕ఏڙ͢Δ ߴੑೳͳج൫Ϟσϧ '. Λ୯Ұͷ "1*ͰબͰ͖ΔϑϧϚωʔδυܕαʔϏε ↓これらのmodelのAPIが使える
Knowledge Base for Amazon Bedrockとは 29 "NB[PO#FESPDLͷφϨοδϕʔεΛ༻͢Δͱɺ"NB[PO#FESPDL͔Β '.Λσʔλιʔ εʹଓͯ͠ݕࡧ֦ுੜ 3"(
Λߦ͏͜ͱ͕Ͱ͖Δɻ͜ΕʹΑΓɺ'.ͷطଘͷڧྗͳػೳΛ ֦ு͠ɺಛఆͷυϝΠϯ৫ʹؔ͢ΔࣝΛਂΊΔ͜ͱ͕Ͱ͖Δɻ 引用:https://aws.amazon.com/jp/bedrock/knowledge-bases/
データの前処理 30 引用:https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html • ドキュメントを管理しやすいチャンクに分割し、効率的に取得できるようにする • ドキュメントをEmbedding Modelを使用してベクトル化する • Vector
DBに格納する Cohere
ランタイム実⾏ 31 引用:https://docs.aws.amazon.com/bedrock/latest/userguide/knowledge-base.html • ユーザーのクエリをベクトル化する • ドキュメントのベクトルと比較し、意味的に類似したチャンクが検索される • 取得されたチャンクからの追加のコンテキストで拡張される Cohere
Claude
Knowledge Baseについて詳しく 32 or or Vector Database Data Source S3
Bedrock User LLM 様々な情報を入れる コードを書かなくとも一括で作成してくれる(S3以外) or
事前知識 33 l 検索拡張生成(RAG)とは l Knowledge Base For Amazon Bedrockとは
l Pineconeとは
Pineconeとは 34 ベクトルを保存するためのデータベース(freeプランを使用) 引用:https://www.pinecone.io/product/
03 knowledge base for amazon bedrock を使って、格安でRAG作ってみた
データソース 36 Fusicのメンバー紹介(全員分) 参考: https://fusic.co.jp/members/108
Slack Bedrock 苑田(webにない情報) って誰ですか?
Slack Bedrock 苑田って何ですか?
Slack Bedrock 苑田というのは。。。
Slack Bedrock 苑田というのは。。。
構成図 41
構成図 42 構築の手間がかからない
構成図 43 フリープランなら無料
構成図 44 モデル 入力トークン 1,000 個あたり 出力トークン 1,000 個あたり Claude
0.00800 USD 0.02400 USD Cohere(埋め込み — 多言語) 0.0001 USD 該当なし
構成図 45 モデル 入力トークン 1,000 個あたり 出力トークン 1,000 個あたり Claude
0.00800 USD 0.02400 USD Cohere(埋め込み — 多言語) 0.0001 USD 該当なし め っ ち ゃ 安 い !
デモ
04 まとめ
まとめ Knowledge Base for Bedrockを使⽤することで、簡単にRAGを構築することができた Point 2 Pineconeを使⽤することで、⽐較的安く構築することができた 48 Point
1 Point 3 SlackでRAGを簡単に使⽤することができた
ご清聴いただきありがとうございました Thank You We are Hiring ! https://recruit.fusic.co.jp/