Insights

Data Foundations for AI Agents

How to Ground an AI Agent in Knowledge Articles and PDFs (RAG Explained)

Akshit KandiDecember 6, 2026 5 min read

Short answer

To ground an AI agent in knowledge articles and PDFs, index the content so the agent can retrieve relevant passages at answer time (retrieval-augmented generation), then pass those passages to the model with the question. Quality depends mostly on content: remove outdated versions, split long documents by topic, add metadata and test with real customer questions.

  • →RAG retrieves your content at answer time; it does not retrain the model.
  • →Content hygiene matters more than search technology: retire old versions before indexing.
  • →Split long PDFs by topic and keep effective dates in the text.
  • →Test retrieval with real past questions and check which passages come back.

Structured data tells an agent who the customer is and what they bought. It does not tell the agent your returns window, your warranty terms or how to reset a device. That lives in knowledge articles, PDFs, manuals and policy documents. Getting an agent to answer from those sources, and only those sources, is called grounding, and it is where many agents that demo well start to fail in production.

What is RAG, and how is it different from training?

Retrieval-augmented generation (RAG)

A pattern where the system searches your content for passages relevant to a question, then gives those passages to the model alongside the question so the answer is based on your material.

RAG does not change the model. Nothing is “learned” permanently. Each answer retrieves fresh content, which is exactly what you want: when a policy changes, you update the document and the next answer reflects it. Fine-tuning a model on your documents is rarely the right choice for customer-facing knowledge, because it is slow to update and cannot cite its sources.

Grounding also makes answers checkable. Because each answer is built from specific retrieved passages, you can log which passages were used and trace a wrong answer back to the document that caused it. That traceability is what lets a reviewer fix the source rather than argue with the model, and it is the evidence compliance teams ask for when an agent quotes policy to a customer.

How does grounding work on Salesforce?

On Salesforce, unstructured content such as knowledge articles and files can be indexed in Data 360 (formerly Data Cloud) or through an Agentforce data library. The content is split into chunks, converted into vector embeddings for semantic search (often combined with keyword search), and exposed to the agent through a retriever. When a customer asks a question, the retriever finds the most relevant chunks and the agent’s prompt includes them. Feature names, file types supported and limits change between releases, so check your edition and the current release notes. If you run Claude agents outside Agentforce, the same pattern applies with your own index, and the content advice below is identical.

Customer question
Retriever searches index
Top passages selected
Model answers with sources
Answer logged

Why does content matter more than technology?

Retrieval returns whatever scores highest. If your index holds the 2024 returns policy and the 2026 one, the agent may quote either. If a 90-page PDF covers six products, a chunk about product A may be retrieved for a question about product B. If internal notes sit next to customer-facing articles, the agent may share them. None of these are search failures. They are content failures, and better embeddings will not fix them.

Content problemEffect on answersFix
Superseded versions indexedQuotes old rulesRetire before indexing; one version per topic
Long multi-topic PDFsMixes up products or regionsSplit by section with clear headings
No effective datesCannot tell current from pastPut “effective from” in the text
Internal notes mixed inDiscloses internal guidanceSeparate index or exclude by metadata
Tables and scanned imagesGarbled or missing textConvert to clean text or structured data
Gaps in coverageModel fills in from general knowledgeInstruct to hand off; write the missing article

How do you prepare content for an agent?

  1. 01

    Inventory

    List every source in scope, with owner, audience (customer or internal) and last review date.

  2. 02

    Retire

    Archive superseded and duplicate content. Agree a single source of truth per topic.

  3. 03

    Restructure

    Break long documents into topic-sized sections with descriptive headings. Keep each section self-contained.

  4. 04

    Add metadata

    Tag product, region, language, audience and effective date so the retriever can filter.

  5. 05

    Write the gaps

    Use real customer questions to find topics with no good answer, and write them.

  6. 06

    Test retrieval

    For 50 to 100 real questions, check which passages come back before judging the final answers.

Testing retrieval separately from answers is a useful habit. If the right passage was not retrieved, no prompt will save the answer; fix content or metadata. If the right passage was retrieved and the answer was still wrong, look at instructions and model behavior. This split saves weeks of prompt tweaking aimed at the wrong problem.

SkySync practice

We run a content inventory and retirement pass before indexing anything, and we score retrieval and answer quality separately in test sets built from real conversations. Each grounded source gets a named owner and review date, and content retirement becomes part of the client’s policy change process. The full 5C model is in the data foundation whitepaper.

How should you split a long PDF for retrieval?

Chunking is how a document is cut into retrievable pieces. Most platforms do it automatically by length, which is a reasonable default and a poor fit for policy documents, where a rule and its exceptions may sit three pages apart. A few habits improve results considerably:

  • Split on meaning, not page count. One section per topic, such as “Returns for damaged items,” with its exceptions inside it.
  • Repeat the context. Start each section with the product, region and effective date, because a retrieved chunk arrives without the document around it.
  • Turn tables into sentences or structured data. Eligibility tables and rate grids often lose their structure in extraction.
  • Drop boilerplate. Headers, footers, legal disclaimers and tables of contents add noise that competes in search.
  • Keep a link back. Store the source document and section so answers can cite where they came from and reviewers can check.
Illustrative example
Search index entry · One well-formed chunk from a policy PDF
json 1{ 2  "chunk_id": "returns-policy-v3-s2.1", 3  "title": "Returns for damaged items", 4  "source": "Returns Policy v3.pdf, section 2.1", 5  "effective_from": "2026-09-01", 6  "supersedes": "returns-policy-v2-s2.1", 7  "region": "US", 8  "audience": "customer", 9  "owner": "Head of Service",10  "review_by": "2027-03-01",11  "text": "Damaged items can be returned within 30 ..."12}
Illustrative. One topic per chunk, with dates, region, audience and an owner so retrieval can filter and retire it.

A practical test: read a single chunk on its own. If a new employee could not answer a customer correctly from that chunk alone, the agent probably cannot either.

How do you keep grounding accurate after launch?

  • Policy and product launches include updating or retiring agent content the same day
  • Every source has an owner and a review date, and overdue items are reported weekly
  • Questions the agent could not answer are logged and turned into new content
  • A sample of answers is checked for correct source citation each week
  • Index refresh schedules match how often content changes

Unanswered questions are your best content roadmap. Each one is a real customer telling you what is missing. For data governance around grounded content, including excluding personal data from indexes, see governance and masking for AI grounding. For the operating rhythm, see the agent lifecycle guide.

Frequently asked questions

Can I just upload all our PDFs and let the agent figure it out?

You can, and it will demo well, but it will produce inconsistent answers in production because old versions, overlapping documents and internal notes all compete in retrieval. A focused inventory and retirement pass before indexing is the single highest-value step in grounding work.

How do I stop the agent answering from general knowledge?

Instruct the agent to answer only from retrieved content and to hand off or say it does not know when nothing relevant is found. Then test with questions outside your content to confirm it behaves. Filling content gaps reduces how often this happens.

Should past cases and emails be used for grounding?

Use them carefully. They are valuable for finding common questions and good phrasing, but they contain personal data and inconsistent, sometimes wrong, answers given by individuals. Prefer approved articles as the factual source, and mask or exclude personal data if historical text is indexed.

How often should the index refresh?

Match refresh to how often content changes and how costly a stale answer is. Policies that change rarely can refresh on publish. Fast-moving content such as stock or promotions is usually better served from structured data than from documents.

Go deeper

The Data Foundation AI Agents Need: Data 360, Snowflake and Identity

What to connect, unify, clean and lock down before a customer-facing agent goes live

  • ✓The 5C Data Foundation: Connected, Clean, Consolidated, Contextual and Controlled
  • ✓Who does what between your CRM, Data 360 and Snowflake, in one layered picture
  • ✓A decision matrix for when to federate Snowflake data with zero-copy and when to ingest it
  • ✓Identity resolution rules that let an agent recognize a returning customer on any channel
Free whitepaper

Download the whitepaper

By continuing you agree to be contacted by SkySync about this material.

More on Data Foundations for AI Agents