Retrieval-Augmented Generation: External Knowledge, Embeddings and Search

Matthew Berman introduces RAG using customer-service, company-document and automotive-manual examples, then explains vector retrieval and agents.

MBMatthew Berman登壇者 · Forward Future
チャンネル
Matthew Berman
公開日
2024年7月3日
動画
14:30
読了時間
5 分
スライド
6
原文
英語
YouTube で開く
スクロールすると動画は右下に小さくなって再生を続けます。字幕は閲覧言語に合わせて切り替わります。
閲覧言語2 言語で読めます
この記事はまだ日本語に翻訳されていないため、英語の原文を表示しています。
要約

30 秒でわかる

In this July 2024 sponsored introduction, Matthew Berman explains how retrieval can add selected external material to a language-model prompt. He uses a vector database workflow, a vehicle manual and a multi-step agent example to show the idea. RAG does not require a particular vendor or vector database and does not guarantee accuracy; Pinecone sponsored the video and was his exclusive channel partner.

  1. 1Retrieval and fine-tuningBerman distinguishes adding external context from altering model behavior, though fine-tuning has broader uses than tone alone.
  2. 2The context budgetA model has a limited token budget; historical model examples illustrate why repeatedly inserting entire collections can be costly.
  3. 3Relevant passagesA recent earnings report can be indexed and relevant passages retrieved for a question, rather than included in full each time.
  4. 4Embeddings and retrievalA model converts text into numerical vectors; a query can be embedded and matched to indexed passages.
  5. 5Multi-step searchAn illustrative agent searches for Apple Remote and then Front Row to answer a multi-hop question.
  6. 6Vendor and alternativesPinecone offers vector storage and search, but search can also use lexical or structured methods, with performance depending on implementation.

ポイント

  1. RAG retrieves external information and supplies selected context to a model at generation time rather than necessarily changing its weights.
  2. Context limits and repeated input costs can make including a complete document collection in every prompt impractical.
  3. Embeddings and vector similarity are one retrieval strategy; keyword, structured and hybrid search are also possible.
  4. Fine-tuning can change style or task behavior and can encode knowledge, but it is not a reliable substitute for a maintained external source.
  5. Retrieved material can be irrelevant, outdated or misused, so RAG can reduce hallucinations without eliminating them.
  6. Pinecone is a sponsor and one vector database option, not a requirement for RAG.
全文

チャプターごとに整えた全文を読む

文字起こしのみ
01

What RAG adds

Berman contrasts external retrieval with fine-tuning and discusses limited context windows. He discloses Pinecone’s sponsorship.

I want to explain retrieval-augmented generation, or RAG, and why it helps applications use external information. Pinecone sponsors this video and is my exclusive channel partner; its vector database is one product used in the workflow I describe, not a prerequisite for RAG.

People often assume fine-tuning is the straightforward way to add documents to a model. I suggest retrieval is frequently a better fit for supplying changing information. My “nine out of ten” estimate is a personal rule of thumb, not a measured result; fine-tuning can do more than change tone and can also affect knowledge and task performance.

RAG retrieves relevant outside material and adds it to the context used to answer a question. It can give an application access to stored information or conversation history, although the model’s weights are not automatically updated and reliable long-term memory requires an actual storage and retrieval design.

A model cannot automatically know everything that happened after its training cutoff. You can put new information directly in a prompt, but sending a large collection repeatedly can be inefficient; retrieval is one way to choose a smaller set of relevant material.

The context window is a token budget for a model’s input and output, with exact limits and accounting depending on the model and interface. I cite roughly 8,000 tokens for the original Llama 3 and 128,000 for GPT-4o as examples from 2024, not current limits or limits for every variant.

Context-window illustration
スライド 1 / 6Context-window illustrationThe slide describes a context budget; exact input and output limits depend on the model and interface.

Even when the window is large, repeatedly sending extensive context may incur cost and latency. Retrieval also has indexing and search costs, so whether it saves money or time depends on the workload and implementation.

02

Conversation history and company documents

He considers customer-service memory, private documents and recent financial reports. Retrieval selects passages to add to a prompt.

Imagine a customer-service assistant that needs to use previous conversations. Sending the entire history on every turn would eventually consume much of the available context, while only some previous exchanges may matter for the current question. A retrieval system can select relevant records, subject to privacy, retention and access controls.

The same issue arises with private company documents. A general model may not have been trained on them, and putting every document into every prompt is impractical at scale. An authorized retrieval layer can find relevant passages without sending the full collection each time.

Consider a new Tesla earnings report that postdates a model’s training information. The application can index the report, retrieve passages relevant to a question and include them with the question in the prompt. The document must actually be available and indexed; for a quarterly report, the relevant filing may be a 10-Q rather than the annual 10-K mentioned in the example.

Retrieval process
スライド 2 / 6Retrieval processA simplified diagram places a query, external knowledge and database in the retrieval workflow.

With reports from many companies, retrieval aims to select information about the company and period requested rather than repeatedly adding every filing. Retrieval quality and document freshness matter: the closest-looking passage is not always the right or most recent source.

03

From manuals to vector search

A vehicle-manual example illustrates indexing, embeddings and query-time retrieval. Grounding does not guarantee correctness.

I show Pinecone’s example of a question about a Volvo XC60 manual. The illustration contrasts an unsupported answer with one generated using retrieved documentation. An unsupported response may hallucinate, but it need not always do so; consult the manual for the exact vehicle and model year when dealing with a safety-related feature.

To prepare the illustrated system, documents are sent through an embedding model and stored with metadata in a vector database. In practical implementations, documents are often divided into passages, and the original text or a reference to it must remain available for inclusion in the prompt.

Indexing a manual
スライド 3 / 6Indexing a manualThe diagram shows documents sent to an embedding model and stored with metadata in a vector database.

An embedding is a numerical vector representing text. The two-dimensional diagram is a simplification of a higher-dimensional space; an embedding model and similarity metric determine what counts as nearby, and closeness is an imperfect proxy for relevance or truth.

Embedding-space visualization
スライド 4 / 6Embedding-space visualizationNearby positions illustrate similarity in an embedding space; the graphic is a simplified projection.

At query time, the system embeds the user’s question, searches for similar indexed passages and sends the selected context with the original question to the language model. The model can then use the passages to formulate an answer, though the retriever or generator can still make mistakes.

Retrieval and generation
スライド 5 / 6Retrieval and generationThe workflow embeds a query, retrieves context and supplies it to a generative model.

The manual example illustrates how grounding might reduce unsupported responses; it does not prove RAG eliminates hallucination or guarantees accurate instructions. Retrieved passages may be incomplete, misleading or outdated, and the model can misinterpret them.

04

Agents and implementation

A multi-step search example and a vector-database overview show how retrieval can support applications. The presenter highlights sponsor Pinecone.

I then show a multi-step example involving Apple Remote. A direct model answer in the illustration is iPod, while the search-based workflow looks up the remote, identifies Front Row and searches for another control method, arriving at keyboard function keys. The steps illustrate a particular example, not a guarantee of general agent reliability.

Multi-step search example
スライド 6 / 6Multi-step search exampleThe illustrated agent searches for Apple Remote and Front Row before arriving at a keyboard-related answer.

The reasoning and search steps can be organized in different ways, including one agent making multiple tool calls; each step need not be a separate agent. Such workflows can retrieve and combine sources iteratively, while still requiring verification of the result.

Pinecone stores and searches high-dimensional vectors at scale, and I describe it as fast. Those are sponsor-related product claims: actual latency, cost and capacity depend on configuration and workload. A vector database is one option rather than a requirement for RAG.

I compare vector similarity search with ordinary search. Many search systems use lexical matching, structured queries or hybrid methods as well as embeddings; proximity in vector space is not how all search works and does not itself guarantee relevance.

A basic implementation creates embeddings for documents, stores them with the relevant data, embeds a query and retrieves matching context. Pinecone offers one hosted implementation; teams still need to choose models, handle document updates and permissions, and evaluate retrieval and answers for their use case.

I close by offering to make a more detailed tutorial on preparing documents, embeddings and a Pinecone account, and thank Pinecone for sponsoring the video. The lesson is the retrieval-and-generation workflow, with its actual quality dependent on sources and evaluation.

同じチャンネルの記事

スライド 12 枚34:21EN
Matthew Berman· 2026年10月27日Matthew Berman Examines Anthropic’s IPO Filing, AI Growth and GovernanceMatthew Berman, Sam Altman · Forward FutureThe presenter reviews the S-1’s financial metrics, compute strategy and voting structure while questioning the tension between rapid AI development and safety.AnthropicAI Safetyエンタープライズ AI+2
0:26EN
Matthew Berman· 2026年10月25日Sam Altman on Human Values and Problem-Solving in an AI WorldSam Altman · OpenAIIn a short interview excerpt, Altman considers the enjoyment of solving hard problems and the human role in interpreting results.Human-AI CollaborationFuture of WorkAI Strategy
スライド 2 枚0:36EN
Matthew Berman· 2026年10月25日Kimi K3.1 and a Rubik’s Cube Solver DemonstrationMatthew Berman · Forward FutureMatthew Berman shows a scrambled virtual cube being solved and gives the Kimi K3.1 test a favorable assessment.評価(Evals)コーディングエージェントOpen-weight models
スライド 2 枚0:21EN
Matthew Berman· 2026年10月24日An AI-Generated Kimi Benchmark Chart Used Invented ScoresMatthew Berman · Forward FutureMatthew Berman asks for a graph of Kimi K3.1 Pro benchmarks, then discovers that the displayed figures are illustrative placeholders.Benchmarks評価(Evals)Generative media
スライド 6 枚25:50EN
Matthew Berman· 2026年10月24日Kimi K3.1 Pro Tested: Strong 3D Demos, Uneven Results and Competitive PricingMatthew Berman · Forward FutureMatthew Berman tests the open-weight model on coding, 3D rendering and visual explanations, then compares benchmark results and prices.Open-weight modelsBenchmarksAI cost & performance+1
スライド 2 枚32:20EN
Matthew Berman· 2026年10月23日Who Is Local AI For? The Costs, Trade-offs and a Hybrid FutureMatthew Berman · Forward FutureMatthew Berman weighs data control and independence against hardware cost, setup complexity and inference speed.Local inferenceOpen-weight modelsAI cost & performance+1