Set Up a Knowledge Base — FAQ Assistant with RAG

Build an AI assistant that answers questions using your organization's documents, policies, and FAQs with retrieval-augmented generation.

Intermediate
7 min read

Set Up a Knowledge Base — FAQ Assistant with RAG

What You'll Accomplish

By the end of this tutorial, you'll have an AI-powered FAQ assistant that answers questions by searching your organization's documents. Instead of maintaining a static FAQ page, your assistant uses retrieval-augmented generation (RAG) to find relevant information in your uploaded files and deliver accurate, sourced answers in natural conversation.

What You'll Need

  • A Gravity Rail workspace
  • Documents to upload (PDFs, text files, or markdown) — policies, FAQs, handbooks, guides
  • A channel for users to access the assistant (web chat site recommended)

Step 1: Upload Your Documents

Organize and upload the files your AI will use to answer questions.

Create a folder structure

  1. Go to Knowledge > Files
  2. Create a top-level folder: "Knowledge Base"
  3. Inside it, create subfolders for each category:
    • "Policies & Procedures"
    • "Patient Information"
    • "Insurance & Billing"
    • "Services & Providers"

Upload your files

Upload documents to the appropriate folders. Good candidates include:

  • Office policies (cancellation policy, payment policy, privacy notice)
  • Patient handbooks or welcome packets
  • Insurance and billing FAQs
  • Service descriptions and provider bios
  • Frequently asked questions documents
  • Appointment preparation guides

You can drag and drop files or click Upload. Supported formats include PDF, DOCX, TXT, Markdown, and more. Maximum file size is 10 MB per file.

Tip: Break large documents into smaller, focused files. A file titled "Cancellation Policy" is more useful to the AI than page 47 of a 200-page employee handbook.

Set access levels

For each file or folder, set the access level:

  • Users: Visible to authenticated workspace members (recommended for most content)
  • Public: Accessible to anyone (use for public-facing FAQs)
  • Private: Admin only (use for internal-only documents)

For more on file management, see the Files guide.


Step 2: Enable Folder Indexing

Indexing enables semantic search — your AI can find relevant content by meaning, not just keyword matching.

  1. Open the "Knowledge Base" folder
  2. Click the folder settings or options menu
  3. Enable Indexing
  4. Wait for indexing to complete (this may take a few minutes depending on the number and size of files)

Repeat for each subfolder if they aren't automatically indexed with the parent.

Once indexed, your AI can search across all documents to find the most relevant passages when answering questions.


Step 3: Build the FAQ Workflow

Create a workflow that handles questions using your knowledge base.

Create the workflow

  1. Go to Workflows and click Create Workflow
  2. Name it "FAQ Assistant"
  3. Assign your agent

Add the File Access ability

  1. Open the workflow and go to the Abilities tab
  2. Add the File Access ability
  3. Configure it to access the "Knowledge Base" folder (and subfolders)
  4. Set permissions to Read

This gives your AI the ability to search and read your documents during conversations.

Add tasks

Task 1: Answer Questions (Starting Task)

  • Name: "Answer Questions"
  • Prompt:
    You are a helpful assistant for [Your Organization Name]. Answer the user's
    questions using the documents in your knowledge base. Follow these guidelines:
    
    1. Search your files before answering. Use the information you find — don't
       make up answers.
    2. If you find relevant information, provide a clear, concise answer and
       mention which document it came from (e.g., "According to our Cancellation
       Policy...").
    3. If you can't find the answer in your documents, say so honestly. Suggest
       the user contact the office directly and provide the contact information:
       [Phone Number] or [Email Address].
    4. Be friendly, professional, and concise. Most people want a quick answer,
       not a lecture.
    5. If a question is about something sensitive (billing disputes, medical
       advice, complaints), acknowledge the question and route to a human.
    
  • Goal: "User's question has been answered or they've been directed to the right resource"
  • Sub-Tasks: Escalate to Human

Task 2: Escalate to Human

  • Name: "Escalate to Human"
  • Prompt: "The user needs to speak with a human team member. Let them know someone will be in touch and collect their preferred contact method if we don't already have it."
  • Goal: "User has been notified that a human will follow up"

If you want your assistant to answer questions beyond your uploaded documents:

  1. Go to the Abilities tab
  2. Add the Web Search ability
  3. Update the task prompt to specify when to use web search vs. knowledge base (e.g., "Search your files first. Only use web search for general questions not covered in your documents.")

Step 4: Connect a Web Chat Channel

The fastest way to deploy your FAQ assistant is through a web chat site.

  1. Go to Channels > Sites
  2. Click Create Site
  3. Configure:
    • Name: "Help Center"
    • Default Workflow: "FAQ Assistant"
    • Brand Name: Your organization name
  4. Customize the appearance (colors, welcome message) to match your brand
  5. Save and visit the site URL

Your FAQ assistant is now live. Share the site URL with your team or embed it on your website.

Other channel options

You can also connect the FAQ workflow to:

  • Phone: Attach to a phone number for voice-based FAQ (see Phone & Voice)
  • SMS: Let people text questions to a phone number
  • Email: Send questions to an inbox for email-based FAQ responses

Step 5: Set Up Escalation Notifications

When the AI routes a conversation to the "Escalate to Human" task, notify your team.

  1. Go to Actions and click New Action
  2. Configure:
    • Trigger: Task Entered, targeting "Escalate to Human"
    • Action Type: Member Notify
    • Recipients: Your support team
    • Message: "A user needs human assistance. Question topic: check the chat for details."

Your team can then open the conversation in Chats and respond directly.


Step 6: Keep Your Knowledge Base Current

Your FAQ assistant is only as good as its source documents. Establish a process for keeping content up to date.

Adding new content

When you add or update files in the "Knowledge Base" folder, the index updates automatically. Your AI will start using the new content in future conversations.

Reviewing AI answers

Periodically review conversations in Chats:

  • Filter by the "FAQ Assistant" workflow
  • Look for conversations where the AI couldn't find an answer
  • Identify topics that need new or updated documents
  • Check that sourced answers are accurate

Content tips

  • One topic per file — "Cancellation Policy" is better than "All Policies"
  • Write for clarity — Simple, direct language helps the AI extract accurate answers
  • Include common phrasings — If patients ask "Can I cancel?" and your document says "Appointment modifications," add both phrasings
  • Date your documents — Include a "Last updated" date so the AI can note when information was last verified

Confirm the Result

  1. Ask a question your documents cover. Open the site and ask a question you know the answer to based on your uploaded documents. Verify the AI finds the right information and cites the source.

  2. Ask a question your documents don't cover. Verify the AI acknowledges it doesn't have the answer and directs the user to contact the office.

  3. Test escalation. Ask a sensitive question (e.g., "I want to dispute a bill") and verify the AI routes to the Escalate to Human task and your team receives a notification.

  4. Check answer quality. Ask several questions across different categories to verify the AI is searching the right folders and returning relevant content.

If the AI isn't finding relevant content, check that folder indexing is complete and that the File Access ability is configured to include all your knowledge base folders.


What's Next

  • Add more content over time. As you identify gaps from real conversations, upload new documents to fill them. The index updates automatically.
  • Create specialized workflows. For complex topic areas (insurance verification, referral processes), create dedicated workflows with targeted prompts and documents.
  • Track common questions. Use Labels to categorize question types (billing, scheduling, clinical) and track which topics get the most volume.
  • Embed on your website. Use the site embed code to add the FAQ assistant directly to your organization's website for instant patient access.