Skip to Content
生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス
book

生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス

by Valliappa Lakshmanan, Hannes Hapke, 中田 秀基
May 2026
Intermediate
520 pages
8h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from 生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス

4章知識を追加する:シンコペーション

本章のパターンは「3章 知識を追加する:ベースライン」で説明したRAGを基礎とし、その上に構築されている(図3-1参照)。本章を読む前に3章を読んで、すべてのRAGの根底にある基本概念を学んでおこう。RAGの可能性を理解すれば、個々のユースケースの特徴に応じて、RAGパイプラインを構成する各要素の実装を選択できる。本章ではこれらの要素を説明する。

4.1 パターン9:インデックスを用いた検索

チャンクに含まれるテキストとそのインデックス方法を理解すれば、基本的なRAG[パターン6]セマンティックインデキシング[パターン7]を改善できる。このパターンのどの構成要素を採用するべきなのかは、コンテンツの種類に依存する。

4.1.1 問題

RAGは次の2つを仮定している。(1)質問と類似性のあるチャンクを知識ベースから検索できる、(2)検索されたチャンクを使って答えを生成できる。しかし、いくつかの状況では1つ目の仮定が成立しない。質問が知識ベースに存在しない場合、知識ベースがユーザのクエリとは異なる技術用語を使用している場合、答えがチャンク内にあるが細かすぎてわからない場合、回答するためには複数のチャンクにまたがる全体的な理解が必要になる場合などだ。

4.1.1.1 知識ベースに質問がない場合

FAQやサポートチケット、ディスカッションフォーラムを知識ベースにしているのでもなければ、質問そのものは知識ベースに現れない。例えば、次のような質問だ。

What’s a historical attraction within a 2-hour train ride from Madrid?

マドリードから電車で2時間以内の歴史的観光スポットは?

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大規模データ管理 ―エンタープライズアーキテクチャのベストプラクティス

大規模データ管理 ―エンタープライズアーキテクチャのベストプラクティス

Piethein Strengholt, 村上 列

Publisher Resources

ISBN: 9784814401635Publisher Website