Agent Using Knowledge Base: Building a Document-Grounded Hotel Assistant

Artificial Intelligence is transforming customer service, but one major concern remains — accuracy. Businesses want
AI agents that respond based strictly on official company information, not assumptions. Instead of designing rule-based chat flows, we can build an AI-powered Service Agent that answers questions directly from an official document stored in a Knowledge Base.

In this blog, we will build a Hotel Information Assistant that answers guest queries using an uploaded document stored in a Data Library (Knowledge Base) inside Salesforce Service Cloud, powered by Einstein AI.

The agent uses a General FAQ topic with the action “Answer Question with Knowledge”, supported by a Dynamic Retriever to generate grounded responses from the uploaded document.

The Use Case

The objective was to create a Hotel Information Assistant that:

  • Answers guest queries using an official hotel guide (PDF)
  • Provides accurate and consistent responses
  • Avoids hallucinated or external information
  • Requires minimal manual configuration

The uploaded document contains complete hotel information including:

  • Room types and pricing
  • Facilities and amenities
  • Policies and services

The solution is a Knowledge Base–grounded AI agent.

What Is a Knowledge Base (Data Library)?

A Knowledge Base, also referred to as a Data Library in agent configuration, is a repository where organizations upload structured documents such as:

  • PDF files
  • DOCX files
  • Text documents

These documents become the trusted source of truth for the AI agent.

Unlike traditional chatbots that rely on scripted flows:

  • The agent searches within uploaded documents
  • It retrieves relevant sections
  • It generates responses based strictly on retrieved content

This ensures reliability and consistency.

Data Library

How Uploading the File Works

The process is simple:

  • Open Agent Builder
  • Navigate to Data Library / Knowledge Source
  • Click “Add Data Source”
  • Upload the hotel FAQ document (PDF/DOCX)
  • Enable “Use for Grounded Responses”

Once uploaded, the backend processing begins automatically.

Agent Configuration

1. Service Agent Creation

A Service Agent was created in Agent Builder with generative capabilities enabled.

2. Uploading the Hotel Guide

The hotel guide was uploaded in PDF format to the Data Library (Knowledge Base).

Once uploaded, the platform automatically:

  • Extracts text from the PDF
  • Breaks the content into smaller sections (chunking)
  • Converts each section into embeddings
  • Stores embeddings in a vector index for semantic retrieval

This prepares the document for intelligent search and response generation.

3. Creating the General FAQ Topic

A General FAQ topic was created to handle user queries.

Inside this topic:

The action “Answer Question with Knowledge” was added. This action uses a prompt template. A Dynamic Retriever was configured inside the prompt.

General FAQ

Dynamic Retriever

How the Dynamic Retriever Works

When a user asks a question:

  • The user query is converted into an embedding.
  • The Dynamic Retriever searches the vector index.
  • The most relevant document chunks are retrieved.
  • The retrieved content is passed to the prompt.
  • The AI generates a response strictly based on that retrieved content.

This process ensures:

  • Context-aware answers
  • Document-grounded responses
  • No dependency on general AI knowledge

This architecture follows the Retrieval-Augmented Generation (RAG) approach.

End-to-End Flow

User → General FAQ Topic → Answer Question with Knowledge → Dynamic Retriever → Retrieve Relevant PDF Content → AI Generates Grounded Response → User Receives Answer

Demonstration

Below is how the agent behaves using the uploaded hotel guide document.

User Question 1:

What types of rooms are available and what are their prices?

Agent Response:

The hotel offers three types of rooms:

  • Deluxe Room priced at ₹7,500 per night.
  • Executive Suite priced at ₹12,000 per night.
  • Presidential Suite priced at ₹25,000 per night.

Conversation Preview

User Question 2:

What facilities does the hotel provide?

Agent Response:

The hotel provides facilities including a rooftop swimming pool, spa and wellness center, 24/7 gym access, free parking, high-speed Wi-Fi, business conference hall, and airport shuttle service.

Agent Response

In both cases:

  • The Dynamic Retriever located the relevant sections in the PDF.
  • The prompt generated the answer using only the retrieved content.
  • No external information was added.

Key Benefits

  • Accurate and document-grounded responses
  • Easy document replacement for updates
  • No need for manual chatbot flows
  • Scalable for multiple properties
  • Enterprise-ready architecture

Conclusion

An Agent using Knowledge Base ensures that AI responses remain trustworthy and aligned with official company documentation.

By combining a Service Agent, Knowledge Base (Data Library), the “Answer Question with Knowledge” action, and a Dynamic Retriever, we successfully built a document-grounded hotel assistant.

If needed, this architecture can easily scale to support multiple hotels, multilingual documents, or integration with booking systems. This approach ensures that the AI agent delivers reliable, controlled, and professional responses directly from the uploaded hotel guide, making it ideal for real-world service use cases.

To explore more use cases, capabilities, and real-world implementations, visit our Agentforce page.