Knowledge base

Documents your agents and flows answer from, how they're searched, and how to write them so answers come out right.

On this page

The knowledge base holds what your bots should know and not make up: your FAQ, menu and prices, policies, opening hours, product details. Agents search it before answering, and flows can search it with a Knowledge lookup step.

The Knowledge tab with four documents

Adding documents

In an agent's Knowledge tab, either give a document a title and paste its content, or upload a file: .txt, .md, .csv, .json, .pdf or .docx. Each document can hold up to about 100,000 characters; longer ones are cut there, so split big manuals into several documents.

Each document shows who uses it (this agent, or all agents) and how many times a search has returned it (hits). Documents that never come up may need clearer wording, or may not be needed.

How agents use it

A document can reach an agent in two ways:

Always in prompt (switch on)Searched (switch off, the default)
HowThe whole document is part of every prompt.The agent searches the knowledge base when a question needs it, and reads the best passages.
Good forShort, essential facts: opening hours, the three things it must always say.Everything else: FAQs, catalogues, policies.
CostsIts full length, on every reply.Only the passages found, only when searched.

To search, the agent needs the search_knowledge_base tool, in Skills & tools. The templates that answer from documents have it switched on.

How search works

Documents are cut into passages of a few paragraphs. A search looks for passages that contain the words of the question (or words starting with them: "refund" finds "refunds"), ranks them, and returns the best passage of each matching document, with its title. It matches words, not meaning, and works the same in any language.

That has consequences for how you write:

  • Use the words your customers use. If people ask about "delivery" and your document only says "shipping", add both.
  • One topic per document, with a clear title. "Opening hours", "Delivery areas and fees", "Refunds".
  • Short paragraphs. Each passage should make sense on its own, without the paragraph before it.
  • Write the answer, not just the fact. "We open Monday to Friday from 8 am to 6 pm; on Saturdays from 9 am to 1 pm" beats a table without context.

In flows

The Knowledge lookup step searches all of the workspace's documents (not just one agent's) and saves the best passages in a variable for the next steps, for example a message that quotes them or an AI step that answers from them.

Still stuck?

Ask us. We read every message.

Privacy