Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon Bedrock Knowledge Basesに Data Autometion...

Amazon Bedrock Knowledge Basesに Data Autometionを導入してみた

【connpass】
https://fusic.connpass.com/event/344729/
【AsiaQuest×Fusic】AWSから表彰されたエンジニアが語る!2社コラボLT会

そのだ

March 17, 2025
Tweet

More Decks by そのだ

Other Decks in Technology

Transcript

  1. ©Fusic Co., Ltd. 1 CONFIDENTIAL Amazon Bedrock Knowledge Basesに Data

    Autometionを導入してみた! 2025.3.13 苑田 朝彰 @sonoda_mj AsiaQuest × Fusic
  2. ©Fusic Co., Ltd. 2 苑田 朝彰 Sonoda Tomotada - X:

    sonoda_mj - 2023 AWS Jr.Champions - 2024 AWS Community Builders (ML & GenAI) - 2024 Japan AWS Top Engineers (Services) - 甲賀流忍者検定(初級)/ スパルタン コメント 最近後輩が捌いたぶりを食べました。 自己紹介 はじめに 株式会社Fusic
  3. ©Fusic Co., Ltd. 5 Amazon Bedrock 内から基盤モデルをデータソースに接続して、検索拡張生成 (RAG) を行うことができる。 Amazon

    Bedrock Knowledge Basesとは Bedrock LLM Bedrock Embedding Model Vector DB Data Source or or or S3 様々なデータを入れる .txt, .md, .html, .doc/docx .csv, .xls/.xlsx, .pdf OpenSearch Serverless Aurora
  4. ©Fusic Co., Ltd. 6 RAGの仕組み Documents 前処理 チャンク分割 Embedding Vector

    Database Embedding Model ユーザーの問い合わせ ドキュメント検索 回答をもとに プロンプト作成 応答 Embedding Embedding Model テキスト生成 Text Model データ処理
  5. ©Fusic Co., Ltd. 7 RAGの仕組み Documents 前処理 チャンク分割 Embedding Vector

    Database Embedding Model ユーザーの問い合わせ ドキュメント検索 回答をもとに プロンプト作成 応答 Embedding Embedding Model テキスト生成 Text Model データ処理 解析戦略 • default • foundation models チャンキング戦略 • default • 固定サイズ • Hierarchical • セマンティック • カスタム(Lambda) 埋め込みモデル • Amazon Titan • Cohere ストアの種類 • OpenSearch Serverless • Aurora Serverless • MongoDB Atlas • Pinecone • Redis Enterprise Cloud 検索タイプ • ハイブリット検索 • セマンティック検索 高度なデータ操作 • メタデータフィルタリング(手動) • クエリ拡張 • クエリ分解 生成モデル • Amazon Titan • Anthropic Claude • その他 その他 • ガードレール • 評価 - new データソースの種類 • S3 • Web Crawler • Confluence • Salesforce • SharePoint データ取り込み • IngestionJob API
  6. ©Fusic Co., Ltd. 8 RAGの仕組み Documents 前処理 チャンク分割 Embedding Vector

    Database Embedding Model ユーザーの問い合わせ ドキュメント検索 回答をもとに プロンプト作成 応答 Embedding Embedding Model テキスト生成 Text Model データ処理 解析戦略 • default • foundation models • Data Automation -new チャンキング戦略 • default • 固定サイズ • Hierarchical • セマンティック • カスタム(Lambda) 埋め込みモデル • Amazon Titan • Cohere ストアの種類 • OpenSearch Serverless • Aurora Serverless • MongoDB Atlas • Pinecone • Redis Enterprise Cloud • Amazon Neptune Analytics - new • Amazon Redshift - new • Amazon Kendra GenAI Index - new 検索タイプ • ハイブリット検索 • セマンティック検索 高度なデータ操作 • メタデータフィルタリング(手動) • メタデータフィルタリング(自動) - new • クエリ拡張 • クエリ分解 • Reranking - new 生成モデル • Amazon Titan • Anthropic Claude • その他 • Amazon Nova - new その他 • ガードレール • 評価 - new • ストリーミング応答 - new データソースの種類 • S3 • Web Crawler • Confluence • Salesforce • SharePoint • Custom - new データ取り込み • IngestionJob API • IngestKnowledgeBaseDocumentsor - new
  7. ©Fusic Co., Ltd. 9 RAGの仕組み Documents 前処理 チャンク分割 Embedding Vector

    Database Embedding Model ユーザーの問い合わせ ドキュメント検索 回答をもとに プロンプト作成 応答 Embedding Embedding Model テキスト生成 Text Model データ処理 解析戦略 • default • foundation models • Data Automation -new チャンキング戦略 • default • 固定サイズ • Hierarchical • セマンティック • カスタム(Lambda) 埋め込みモデル • Amazon Titan • Cohere ストアの種類 • OpenSearch Serverless • Aurora Serverless • MongoDB Atlas • Pinecone • Redis Enterprise Cloud • Amazon Neptune Analytics - new • Amazon Redshift - new • Amazon Kendra GenAI Index - new 検索タイプ • ハイブリット検索 • セマンティック検索 高度なデータ操作 • メタデータフィルタリング(手動) • メタデータフィルタリング(自動) - new • クエリ拡張 • クエリ分解 • Reranking - new 生成モデル • Amazon Titan • Anthropic Claude • その他 • Amazon Nova - new その他 • ガードレール • 評価 - new • ストリーミング応答 - new データソースの種類 • S3 • Web Crawler • Confluence • Salesforce • SharePoint • Custom - new データ取り込み • IngestionJob API • IngestKnowledgeBaseDocumentsor - new
  8. ©Fusic Co., Ltd. 10 Amazon Bedrock Data Automation (以下BDA)は、ドキュメント、画像、音声、動画などの非構造化マルチモーダルコンテ ンツからデータを抽出することができる。

    Amazon Bedrock Data Automation Amazon Bedrock Data Automation 免許証 output.md 名前:田中太郎 免許番号:123456789 住所:hogehoge テキスト抽出 動画
  9. ©Fusic Co., Ltd. 16 RAGの仕組み Documents 前処理 チャンク分割 Embedding Vector

    Database Embedding Model ユーザーの問い合わせ ドキュメント検索 回答をもとに プロンプト作成 応答 Embedding Embedding Model テキスト生成 Text Model データ処理 解析戦略 • default • foundation models • Data Automation -new チャンキング戦略 • default • 固定サイズ • Hierarchical • セマンティック • カスタム(Lambda) 埋め込みモデル • Amazon Titan • Cohere ストアの種類 • OpenSearch Serverless • Aurora Serverless • MongoDB Atlas • Pinecone • Redis Enterprise Cloud • Amazon Neptune Analytics - new • Amazon Redshift - new • Amazon Kendra GenAI Index - new 検索タイプ • ハイブリット検索 • セマンティック検索 高度なデータ操作 • メタデータフィルタリング(手動) • メタデータフィルタリング(自動) - new • クエリ拡張 • クエリ分解 • Reranking - new 生成モデル • Amazon Titan • Anthropic Claude • その他 • Amazon Nova - new その他 • ガードレール • 評価 - new • ストリーミング応答 - new データソースの種類 • S3 • Web Crawler • Confluence • Salesforce • SharePoint • Custom - new データ取り込み • IngestionJob API • IngestKnowledgeBaseDocumentsor - new
  10. ©Fusic Co., Ltd. 17 前処理をする理由 前処理をしないとLLMがデータを解釈できない可能性がある 不具合報告書(サンプル) テキスト抽出した後のデータ LLMなしの前処理 製品不具合報告書

    文書番号DFT-2025-0142 社外秘 1.基本情報 項目 内容 製品名 産業用制御盤MCB5000 製造ロット LOT20250213A4 発生日 2025/2/20 報告者品質管理部山田 不具合検出工程 最終検査 2不具合内容 電源投入後制御基盤のTR24周辺が異常発熱(85度超)。 5台中2台で発生。樹脂部分変形の兆候あり。 システム診断でエラーE405表示。 <span style="color: green;">3.調査結果</span> 初期調査 ・TR24周辺の目視検査で異常なし ・C-E間電圧が規定値(3.3V±0.1V)超え4.2V ・X線検査で基盤内部に異常なし 根本原因分析 材料要因70% TR24のロット検査実施。5%の確率で特性値が仕様外 設計要因20% 回路シミュレーションで、特定条件下でTR24に過大電流 製造要因10% 2/13のはんだ付工程で使用の新ロットFXが原因でハンダ接合部の信頼性低下 4.対策 緊急対応 該当ロットの出荷停止 完了(2/20) どのテーブル情報か わからない 不要なタグが存在
  11. ©Fusic Co., Ltd. 18 前処理をする理由 前処理をしないとLLMがデータを解釈できない可能性がある 不具合報告書(サンプル) # 製品不具合報告書 **文書番号:

    DFT-2025-0142** **社外秘** ## 1. 基本情報 | 項目 | 内容 | |------|------| | 製品名 | 産業用制御盤 MCB-5000 | | 製造ロット | LOT-20250213-A4 | | 発生日 | 2025年2月20日 | | 報告者 | 品質管理部 山田太郎 | | 不具合検出工程 | 最終検査工程 | ## 2. 不具合内容 電源投入後に制御基板のトランジスタT24周辺が異常発熱(85℃超)。 5台中2台で発生。樹脂部品変形の兆候あり。システム診断で「温度センサーエラー(E-405)」表示。 ## 3. 調査結果 ### 初期調査 - トランジスタT24周辺の目視検査で異常なし - コレクタ-エミッタ間電圧が規定値(3.3V±0.1V)を超え4.2V - X線検査で基板内部に異常なし ### 根本原因分析 **材料要因 (70%)** トランジスタT24のロット検査を実施。5%の確率で特性値が仕様外(許容範囲: 0.4A〜0.6A、検出値: 最大0.8A) **設計要因 (20%)** 回路シミュレーションの結果、特定条件下でトランジスタT24に過大電流が流れる可能性を確認 **製造要因 (10%)** 2月13日のはんだ付け工程で使用された新ロットのフラックスが原因で、はんだ接合部の信頼性低下 ## 4. 対策 ### 緊急対応 | 対応項目 | 状況 | |---------|------| | 該当ロットの出荷停止 | 完了 (2/20) | テキスト抽出した後のデータ LLMによる 前処理 整理されたテーブル構造 わかりやすい階層構造
  12. ©Fusic Co., Ltd. 19 KBのParsing strategyで設定可能なData Automationを使用する。現状、.txt, .md, .html, .doc,

    .csv, .xls, .pdf, .jpeg/.pngしか 対応していない(はず) 1. KBに搭載されているData Automationを使用する Parsing strategyから 選択するだけ
  13. ©Fusic Co., Ltd. 20 KBのParsing strategyで設定可能なData Automationを使用する。現状、.txt, .md, .html, .doc,

    .csv, .xls, .pdf, .jpeg/.pngしか 対応していない(はず) 1. KBに搭載されているData Automationを使用する KBの結果 サンプルデータ
  14. ©Fusic Co., Ltd. 21 Data Automationを使用し、動画からテキストを抽出する。その後、抽出したデータをKBに取り込む。 2. Data Automationを使って、前処理したデータをKBで使用する S3

    AWS Lambda S3 AWS Lambda S3 OpenSearch Serverless Knowledge Bases 動画 Data Automation Json Markdown Data Automationで テキスト抽出 Jsonを整形してRAGが 使いやすい形に変更