Skip to main content

Creating and Managing Knowledge Bases for AI Agents

Create, structure, and publish a knowledge base so your AI agents can answer questions using approved sources of truth.

Maria Cairns avatar
Written by Maria Cairns
Updated over a week ago

Why it matters

Knowledge bases give your agents reliable information to reference during chat and voice conversations. When you attach the right knowledge bases to an agent, responses are more consistent and grounded in your approved content.

Key Concepts

Knowledge base: A collection of pages that stores the information your agent is allowed to reference.

Page: A single item inside a knowledge base. Each page has a name and one information source type.

Information source types: The four page types you can add: Text content, Document upload, Single webpage, and Website.

Draft vs published: A knowledge base starts in draft. You must publish for agents to use the latest version.

Website paths: Rules that control which pages are included or excluded when using the Website source type.

Path rule types: Matching options for paths, including starts with, ends with, contains, exact match, and custom (regex).

Version history: Each page keeps versions when you edit and save changes, so you can track and roll back changes when needed.

Knowledge base selection: Agents can reference multiple knowledge bases, selected in the agent editor.

Step-by-Step: Create and publish a knowledge base

  1. Open Agents from the left sidebar.

  2. Click Knowledge to open the knowledge base manager.

  3. Click Create knowledge base.

  4. Enter a Name (and a description if needed).

  5. Click Create page.

  6. Enter a Page name.

  7. Select a Type (one of the four information source types).

  8. Add the page content based on the type you selected:

    1. Text content: Paste or write content into the rich text editor.

    2. Document upload: Drag and drop a file, or click to upload from your computer.

    3. Single webpage: Paste a full webpage URL for one page you want to include.

    4. Website: Enter the website URL, then configure include and exclude path rules (recommended).

  9. If you selected Website, configure path rules to control what is included:

    1. In Include paths, click Add path.

    2. Choose a match type: Starts with, Ends with, Contains, Exact match, or Custom (regex).

    3. Enter the path pattern. (Example: Ends with /blog to include blog pages that match that pattern.)

    4. Repeat to add multiple include rules as needed.

    5. In Exclude paths, add rules for content you do not want ingested. (Example: Exclude /contact or other non-support pages.)

    6. Use the trash icon to remove any include or exclude rule.

  10. Save the page.

  11. Repeat steps 5 to 10 to add more pages. (There is no limit to the number of pages.)

  12. Click Publish to publish the knowledge base.

  13. If you make changes later, enter edit mode to work in draft, then Publish again to apply updates.

Step-by-Step: Attach knowledge bases to an agent

  1. Open Agents and select the agent you want to update.

  2. Click Edit agent.

  3. Go to Step 6: Knowledge bases.

  4. Open the knowledge base dropdown.

  5. Check the boxes for one or more knowledge bases you want the agent to reference.

  6. Click Save.

  7. Use Preview to test the agent’s responses against the attached knowledge.

Tips and Best Practices

  • Keep each page focused on one topic so retrieval stays accurate.

  • Use clear page names that match how users ask questions (for example: “Reset password”, “Billing and invoices”, “Opening hours”).

  • For Document upload, upload one file per page. Create multiple pages for multiple files.

  • For Website sources, start by including only the sections you need (for example, your /help or /docs area), then add excludes for noise (for example, /blog).

  • Prefer Starts with for clean directory-based sites (for example, /help/) and use Exact match for one-off pages.

  • Use Contains sparingly; it can match more pages than expected.

  • Use Custom (regex) only if you need advanced pattern matching and you can validate the pattern.

  • Publish after changes so agents use the latest approved content.

  • If an agent becomes inconsistent, reduce overlap by attaching fewer, more relevant knowledge bases.

Troubleshooting

Issue

Possible Cause

Fix

Website page pulls in too much irrelevant content

Include paths are too broad (for example, using Contains with a common word)

Replace broad rules with Starts with (for example, /help/) or Exact match, then re-publish.

Website page does not include pages you expected

Include path pattern does not match the actual URL paths

Confirm the site’s path structure and adjust the rule type (for example, use Starts with /docs/ instead of Ends with /docs). Re-publish.

Important pages are missing from the website ingestion

An exclude rule is filtering them out

Review exclude paths for overlaps (for example, excluding /support when your docs live under /support/). Remove or narrow the exclude rule, then re-publish.

Only one section of the site is included

Include paths are too restrictive or only a single rule was added

Add additional include rules (for example, /help/ and /faq/) and re-publish.

Wrong pages included because of similar URLs

Rule type is too flexible (often Contains)

Use Exact match for specific pages, or Starts with for a directory. Avoid Contains unless necessary.

A path rule cannot be removed

You are not removing it from the rule list

Click the trash icon next to the include or exclude rule, save the page, then publish.

Agent answers with outdated webpage content

Webpage/website content is scraped at publish and may not refresh automatically

Re-publish the knowledge base after the site changes, or replace the page with updated content.

Agent references irrelevant info from the website

Too many website sections included, or multiple knowledge bases overlap

Narrow include paths, add excludes for non-support sections (for example, /blog), and detach unrelated knowledge bases from the agent.

Agent is not using the latest information

Knowledge base changes are still in draft

Publish the knowledge base after edits.

Did this answer your question?