Skip to content
Why LLMs Need External Knowledge Bases: RAG Explained with a Vineyard Case Study

Why LLMs Need External Knowledge Bases: RAG Explained with a Vineyard Case Study

This article explains Retrieval-Augmented Generation (RAG) using a vineyard example, showing why large language models need external knowledge bases to avoid hallucinations, how passive retrieval works, the importance of updating knowledge bases, and why retrieved content must be verified for relevance and accuracy before generating answers.

Code of Duty
Code of Duty
Code of Duty

Asking Again Won't Yield More References

The previous article discussed Tool Calling, which lets models propose calling external capabilities, but execution remains in the program. A weather tool can report continuous rain, but specific disease prevention still requires agricultural references and orchard records. This article explains how to feed such internal knowledge to the model before generating an answer.

We use a grape orchard as an example. Suppose a user asks an agricultural assistant:

Continuous rainy weather, how to prevent grape black powdery mildew?

The model quickly produces causes and prevention steps. When pressed for sources, it adds a few reasons. However, the response does not clarify whether the advice matches the actual disease or suits the current orchard's conditions.

Retrieve Materials First, Then Call the Model

The backend first ingests agricultural documents and orchard records into a retrieval system, splitting them by content while preserving source, applicable target, and update time. This "knowledge base" is simply a set of documents the program can search.

The minimal flow is as follows, illustrated in the diagram:

RAG flow diagram
RAG flow diagram

"Injection" means placing the retrieved references into the context — the information the model can read during this call — not retraining the model.

Assume retrieval returns two types of references. The content passed to the model can be organized like this:

[Question] Continuous rainy weather, how to prevent grape black powdery mildew?
[Reference A] Grape black spot disease is related to rainy and humid conditions.
[Reference B] Study on biological control of grape post-harvest black aspergillus, research scenario is storage period.
[Requirement] Distinguish disease and applicable stage; do not fabricate unsupported conclusions.

Reference B indeed has corresponding research, but its subject is black aspergillus during grape post-harvest storage. It cannot directly become a field prevention plan for continuous rain. A proper response should first state what the references support and what information is still missing — for example, confirming the exact disease, affected part, and whether harvest has occurred; the suitability of measures for the current orchard still needs verification.

This article adopts passive retrieval: every time the agricultural Q&A endpoint receives a question, the program automatically queries references first, then calls the model. Whether to trigger retrieval is fixed by the process; the model does not decide.

Knowledge Base Updates Enable Answer Updates

Agricultural references get revised, and orchard records change. RAG does not require retraining the generation model each time, but the retrieval system must sync new content. If files are updated but retrieval segments remain on old versions, the model may still give outdated answers.

Even with new references, disease names may mismatch or applicable stages may differ. The model may also fabricate details beyond the source. Such plausible but unsupported content is often called hallucination .

RAG provides grounding, but cannot guarantee every sentence is correct. The core problem is not just "the model doesn't know", but "the model doesn't know and must not fabricate." The agricultural assistant can explain references, but cannot package another disease's materials as a definitive conclusion for the current orchard.

Why Answers Can Still Be Wrong Despite Citations

Suppose during debugging the assistant answers: "According to this orchard's 'Black Powdery Mildew Prevention Protocol', after continuous rain a fixed prevention plan should be executed." But the orchard has no such document.

Troubleshooting found retrieval only returned black spot disease references. The program did not verify applicability, so the model treated the similar name as the same disease and fabricated an internal protocol to support the answer.

When fixing, retain the original titles of retrieved fragments and verify whether the answer is supported by those fragments. If materials are insufficient, explicitly respond: "Retrieved black spot disease references, cannot answer black powdery mildew prevention. Please supplement disease symptoms and stage, then verify applicable references." If no relevant references are found, state that clearly; do not substitute a seemingly similar result.

Simply appending sources at the end does not prove applicability. RAG lets the model answer with internal materials while clarifying what those materials actually support.

In real production scenarios, intent recognition and whether to query often need model involvement; querying wrong materials can mislead more than not querying. Wrong retrieval timing turns even accurate retrieval into noise. The next article will discuss how to let an Agent decide whether to query.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LLMRAGKnowledge BaseRetrieval-Augmented GenerationHallucinationExternal KnowledgePassive RetrievalVineyard Example
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.