Unit 5 / 12

Knowledge Base and RAG: How Bot and Agent Find the Correct Answer

Gains:

  • Understand how RAG (fragmentation, access, resource-dependent generation) works and how it reduces hallucination
  • Ability to increase the quality of answers by establishing a knowledge base that is current, clear, conflict-free and has a single correct source.
  • Ability to instruct the model 'if it is not in the source, tell me you don't know' and turn the questions it cannot answer into knowledge base improvement

The answer a bot or agent assistant gives is only as good as the information on which it is based. When the customer asks "Is the campaign continuing?", the correct answer is not in the model's memory, but in the current knowledge base of the institution. That's why the heart of call center artificial intelligence is knowledge base (KB): an up-to-date resource where products, policies, FAQs, procedures and rules are kept in writing. And the method that securely connects this knowledge base to artificial intelligence is called RAG: Retrieval-Augmented Generation — instead of making up the answer from its own memory, the model first retrieves the relevant pieces of information from the source (retrieval) and then generates the answer based on those pieces only (generation).

RAG is the most powerful method of preventing hallucination. The model does not generate a number in its head for the question "what is the loan interest rate?" It retrieves the current interest text from the knowledge base and answers based on it. In this unit we will see how to set up the knowledge base, how RAG works and how a good knowledge base determines the quality of answers.

How RAG works: four steps

Think of RAG like a librarian. The customer asks questions; The system first finds the relevant pages from the right shelf of the library, then reads those pages and writes the answer. The technical steps are as follows:

  1. Chunking: Long documents in the knowledge base are broken into small, meaningful pieces (e.g., each FAQ is a chunk). Because the model answers a question more accurately with related small parts.
  2. Embedding and indexing: Each piece is translated into a numerical form representing its meaning (embedding—a sequence of numbers representing the meaning of the text) and placed in a searchable database. Thus, it is not a "word match" but a "meaning match"; Even if the customer asks "when will my money be deposited?", the "refund period" part may be found.
  3. Retrieval: The parts closest in meaning to the customer's question are retrieved (e.g. the closest 3-5 parts).
  4. Generation: The model writes the answer based ONLY the drawn parts and indicates the source if possible.

The critical point is in step 4: the model is instructed to "just rely on the given pieces, or say you don't know." Without this instruction, RAG does not prevent the model from fitting.

Hint: RAG's golden rule: "If it's not in the source, there's no answer." A good RAG system will say "I don't know for sure about this" to a question that is not in the knowledge base; never fills the gap with guesswork. A bot's ability to say "I don't know" is a security feature, not a weakness.

A good knowledge base: the real source of answer quality

No matter how good the RAG is, if the knowledge base is bad, the answer is bad. Knowledge base quality is measured by:

feature

bad knowledge base

Good knowledge base

Currentness

Not updated for months

Updated immediately when changed

Clarity

Long, convoluted text

Short, single-topic articles

structure

Messy PDF pile

Labeled degradable substances

Consistency

Two conflicting answers

Single source of truth

Scope

There are many gaps

Covers frequently asked questions

ownership

Nobody is responsible

Every topic has an owner

The most dangerous problem in the call center context is contradiction: if two different return periods are written in the knowledge base, RAG will say whichever one it takes and an inconsistent answer will be sent to the customer. That's why the "single source of truth" principle is critical: information is kept up to date in one place; References to that source are used, not copies.

Step by step: building a RAG-supported response system

  1. Clean the knowledge base: Remove outdated, conflicting, duplicate articles. Make each article short and single-topic.
  2. Break it down and tag it: Add a topic tag and last update date to each article.
  3. Establish access: Connect a mechanism that pulls relevant parts when asked (enterprise RAG tools provide this).
  4. Write a strict prompt: Tell the model "only rely on the parts provided, cite the source, or say you don't know."
  5. Cite the source: Show the article on which the answer is based; It both gives confidence and facilitates verification.
  6. Watch for gaps: Collect questions where the bot says "I don't know"; These show the deficiencies in the knowledge base, feed from there.

Four copyable templates

1) Strict RAG answer prompt:

Answer BASED on the following [SOURCE] parts. Rules: (1) use only the information in the source, (2) if it is not in the source, say "I have no definite information about this, let me connect you to the representative", (3) state which article it is based on as [Source: item-no], (4) quote the amount/duration/condition exactly from the source, do not round/make up. [SOURCE]: <<pulled parts>>Question: "<<customer question>>"

2) Knowledge base article writing:

Convert the following scattered policy text into a FAQ article suitable for RAG. Format: Question (in customer's language) / Short answer (2-3 sentences) / Conditions (clause) / Date of last update / Topic tag. Mark any ambiguous points as "to be clarified", make-believe. Raw text: <<text>>

3) Scanning for contradictions and gaps:

Examine the following knowledge base articles. (1) Mark the pairs of articles that CONFLICT with each other (e.g. different return period). (2) Guess the topics that will be frequently asked but have NO answers. Look only at the given articles; producing new policy.Articles: <<list>>

4) Improvement from "I don't know" log:

Below are questions that the bot could not answer (could not find a source). Group them into topics and suggest the title of the article that should be added to the knowledge base for each group. Don't make up the answer content, just tell me which item is missing.Questions: <<list>>

Weak prompt / Strong prompt

Weak prompt:

Answer the customer's return question.

No source; The model may fit from memory, the amount/duration may be wrong, it cannot be verified.

Powerful prompt:

Answer only based on the return policy clause below. If it is not available in the source, say "I don't know for sure". Quote the period and condition verbatim, give reference in the form of [Source: RETURN-03].[SOURCE: RETURN-03]: "Unused product can be returned within 14 days. Personalized products are not within the scope of return." Question: "Can I return the personalized product I bought 20 days ago?"

Difference: source dependent, reference mandatory, fabrication ban clear; the model generates the correct answer ("14 days past and personalized, non-refundable") from the source.

three mini cases

Case 1 — Ending the hallucination. A telecom bot's answer accuracy to campaign questions was 71% in a no-RAG setup; The model sometimes made up old campaigns. When the current campaign pages were connected to RAG and the "don't say it if it's not in the source" rule was added, accuracy increased to 96% and complaints about "wrong campaign words" almost ended.

Case 2 — The price of contradiction. In the knowledge base of an e-commerce company, two different shipping costs were written on two pages (one current, one old forgotten page). The bot was randomly pulling someone and telling some of the customers the wrong price. When the old page was archived with the principle of single correct source, the inconsistency disappeared. Lesson: RAG does not resolve the contradiction, it propagates the contradiction as it is.

Case 3 — The value of the “I don't know” log. At one bank, the bot was saying "I don't know for sure" to ~4,000 questions a month. When these questions were grouped, it was seen that 40% were about "international card use"; There was no article about it. When the relevant items were added, these questions were solved and the turnover to people on that subject decreased by 55%. The fact that the bot said it didn't know became the road map for improvement.

Common mistakes

  • Answering without linking to the source. Without RAG, the model fits concrete information; Any concrete answer must depend on the source.
  • Turning off the "I don't know" option. Forcing the model to answer every question ensures fitting.
  • Not clearing conflicting/old information. RAG spreads contradiction; A single correct source is essential.
  • Neglecting to shred. Exporting large PDFs as is disrupts accurate access; Use short, single-topic articles.
  • Hiding the source. Not indicating what the answer is based on weakens verification and trust.
Caution: RAG improves accuracy but does not provide a 100% guarantee. The model can sometimes misinterpret the captured part. Therefore, financial, legal and security issues require human approval even if the source is cited; RAG reduces hallucination but does not remove responsibility.

In summary

The knowledge base and RAG are the foundation of the accuracy of call center AI. RAG largely prevents hallucination by preventing the model from fitting the answer from memory and relying solely on the current source. But RAG is only as good as its knowledge base: a knowledge base that is up-to-date, clear, structured, conflict-free and has a single source of truth is essential. Tell the model "if it's not in the source, tell me you don't know", point to the source, and use the questions the bot can't answer to improve its knowledge base. Maintain human consent despite source on high-stakes matters.

Application task

Write 8 real/realistic customer questions from your industry and 8 corresponding short knowledge base articles (each article: question, short answer, conditions, date, tag). Then test whether the model can say “I don't know” by using the “1) Tight RAG answer prompt” pattern and also asking a question, one of which is not in the knowledge base. Finally, check your articles with "3) Contradiction and gap scanning".

checklist

  • [ ] Every concrete answer given by the bot/assistant depends on the current knowledge base (via RAG).
  • [ ] I instructed the model "if it is not in the source, tell me you don't know" and tested it.
  • [ ] My knowledge base consists of up-to-date, clear, single-topic articles.
  • [ ] I cleared out the conflicting and old articles; There is only one correct source for all information.
  • [ ] Answers show which article it is based on (source).
  • [ ] I collect "I don't know" questions and feed the knowledge base.