Skip to Content
生産性のためのハンズオンRAG (Japanese Edition)
book

生産性のためのハンズオンRAG (Japanese Edition)

by Ofer Mendelevitch, Forrest Sheng Bao
May 2026
358 pages
5h 53m
Japanese
O'Reilly Media, Inc.
Content preview from 生産性のためのハンズオンRAG (Japanese Edition)

シャロン・チョウによる序文

私が初めて本番環境でRAGシステムの失敗を目にしたのは、誰かが文書を固定文字境界単位で単純にチャンク分けし、法律条項を半分に分割してしまったためだった。条項Aの一部と条項Bの一部が1つのチャンクに、条項Bの残りが別のチャンクに入っていた。問題は、2つ目のチャンクに有用な一般的な例外規定が含まれていたことだ。 RAGシステムはユーザの質問に基づいて最初のチャンクを検索したが、2つ目のチャンクを検索しなかった。そのため、残念ながらモデルは契約書の内容とは正反対の回答をユーザに返してしまった。考えてみてほしい。もしGoogle検索を通じて不完全な、あるいは誤った知識を与えられたとしたら、正しい答えを出すのは困難だろう。

システムを構築していた誰も、チャンク化の戦略について、真剣に考えていなかった。彼らはどのLLMを使うかについて議論するのに忙しかったのだ。だからこそ、LLMsやエージェントを用いて本番環境でRAGを構築している人々にとって、このような本は極めて重要なのである。

RAGは一見単純に見える:

  • ドキュメントをチャンク化しよう――簡単だ、文字列分割だ。
  • チャンクを埋め込む――簡単だ、forループ内の軽量なモデルAPI呼び出しだ。
  • 関連するチャンクを取得する――簡単だ、それは単に検索を使うだけのことだ。検索は現代のAIよりもずっと前から存在しているから、ある意味、ベストプラクティスはすでに組み込まれているはずだ。
  • それらのチャンクをLLMに渡す——簡単だ、それは単に文字列を別の文字列に追加してプロンプトを形成するだけだ。

言語モデルをワンショット学習させるだけで、動作するプロトタイプを構築できる。しかし……その一方で、解析、チャンキング、埋め込みモデルの選択、検索戦略、再ランク付け、評価、ガードレール、その他数え切れないほどある、目立たないが重要な決定事項に取り組むために、次の1年を費やすことにもなりかねない。これらは、あの法務アシスタントのようなものになるか、あるいはユーザの質問に対して堅牢性を持つ本番システムになるかを左右する決定事項だ。

メンデレヴィッチとバオは、そうした過ちを犯す前に警告するか、あるいは(もし犯してしまった場合、あるいは犯した時には)回復を助けるような本を執筆した。その目的は、時間と労力を節約し、言語モデルの知能をより多く活用できるようにすることにある。つまり、RAGが本番環境の生産性を損なうのではなく、体系的に支援するようにすることだ。

実在する人々が依存するRAGシステムを構築しているなら、この本は手始めに最適であり、その知識の一部を習得するのに役立つだろう。

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

The Human Factor in AI-Based Decision-Making

The Human Factor in AI-Based Decision-Making

Philip Meissner, Christoph Keding
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 0642572397647