Skip to content
Docs

Knowledge bases

A knowledge base stores text documents together with their embeddings, so flows and agents can search them by meaning instead of exact keywords. It is what an agent searches when it looks something up, and the storage half of a RAG (retrieval-augmented generation) pipeline: ingestion writes embedded chunks into a knowledge base, and query nodes or agents pull the most similar documents back out at answer time.

  1. Create one under Knowledge bases (see Creating a knowledge base).

  2. Put your documents in it. Upload them one at a time with Add document on its Documents page, keep a file store searchable in it, or build an ingestion flow for sources that change.

    The Add a document to this knowledge base dialog with a File drop zone for PDF, Word, Excel, markdown, HTML, text, CSV, JSON or XML, and an optional Source key
    The Add a document to this knowledge base dialog with a File drop zone for PDF, Word, Excel, markdown, HTML, text, CSV, JSON or XML, and an optional Source key
  3. Let the agent search it: add a Knowledge row to the agent’s Toolbox and pick the knowledge base. An agent made with New agent already has a Toolbox waiting for this row. Without a Toolbox, connect a Knowledge Base Query node to the agent’s Tools handle instead.

The agent then searches the knowledge base whenever a question calls for it. For a small knowledge base, reading it whole often answers better than searching it; see How to choose between searching and reading a knowledge base.

From Knowledge bases:

  1. Click New knowledge base.

  2. Fill in:

    • Name — how you will pick the knowledge base in node Instructions.
    • Dimensions — the length of the vectors this knowledge base stores. Default 1536. It must match the output dimension of the embedding model you plan to use (OpenAI text-embedding-3-small = 1536). Any dimension works; the value is fixed per knowledge base, not per platform.
    • Distance metric — how similarity is measured: Cosine (default) or L2 (Euclidean).
    • Model, under Embedding — the embedding model that writes and searches this knowledge base. It defaults to the workspace’s model; left empty, it is recorded from the first ingestion.
    The Create knowledge base form: Name, Dimensions 1536, Distance metric Cosine, the Embedding model recorded from the first ingestion with its API key, and the Retrieval and Reranking sections
    The Create knowledge base form: Name, Dimensions 1536, Distance metric Cosine, the Embedding model recorded from the first ingestion with its API key, and the Retrieval and Reranking sections
  3. Save.

The Knowledge bases list shows each one’s dimensions, distance metric, and current document count.

Click the Documents action on a knowledge base’s row to open a browser of its contents. Flows add documents, and so does Add document, which uploads a file. Each row shows:

  • Title — the document’s title from its metadata, or Untitled.
  • Content — the text of the chunk, searchable, with the full text in a tooltip.
  • Source — where the chunk came from. A web address opens in a new tab.
  • Ingested — when the document was written, newest first.

Two more columns, Source key and Raw metadata (the chunk’s metadata as compact JSON), are hidden until you turn them on, and both are searchable. Filter by Ingested to narrow the rows to a date range, or by No source key to find the chunks a re-ingest cannot replace. After a Test search, the rows are the nearest documents in order, with a Match column for how close each one is, until you select Clear search.

The table pages at 25 documents per page. Use Edit knowledge base in the header’s menu to jump back to the knowledge base’s settings.

The Sources page lists what a knowledge base holds, one row per source key with its number of chunks, and deletes a source with all of its chunks. Documents stored without a source key share one row there.

To remove sources from a flow, for example the articles a nightly sync no longer finds upstream, use Knowledge Base Delete.

A typical ingestion flow chains four RAG nodes:

  1. Read a File as Text: fetch the source text.
  2. Split Text: cut it into chunks.
  3. Embed: turn each chunk into an embedding via your chosen provider and model.
  4. Knowledge Base Insert: write the embedded chunks into the knowledge base you pick in its Instructions. The node outputs {"inserted": N, "collection_id": "..."}.
An ingestion flow on the canvas: Load carrier document, Split into chunks, Embed chunks and Store in knowledge base, one after another
An ingestion flow on the canvas: Load carrier document, Split into chunks, Embed chunks and Store in knowledge base, one after another

To keep the files of a file store in a knowledge base, you need no flow: set the store’s Keep searchable in and every file it writes is indexed, replaced and removed with the file. See Keep a store searchable.

When Knowledge Base Sources Change starts a flow when a source is added, replaced or deleted, from the Knowledge bases screens, the AI builder or a flow. The run gets each source’s key and how many chunks it holds now. The Triggers button on the Sources page shows which flows the knowledge base starts and what its recent changes started.

Knowledge Base Query embeds a search string and returns the nearest documents. Instructions:

  • Knowledge base: the knowledge base to search.
  • Search for: the text to search for. Expression-capable, so you can pass the user’s question via $prev or $start.
  • Number of results: how many of the nearest documents to return.
  • Under More settings, Embedding provider and Embedding model default to what the knowledge base was embedded with, and must match it (default model: text-embedding-3-small). Embedding credential is the embedding provider’s key, picked from your Secrets; leave it empty to use the knowledge base’s own.

The node outputs {"results": [{"text": "...", "metadata": {...}}, ...], "collection_id": "..."}. It also implements the tool contract, so you can wire it to an Agent node’s TOOL handle and let the model search the knowledge base on demand — see Build an agent.

  • Knowledge bases for support or documentation agents, ingested once and queried on every conversation turn.
  • Semantic search over product catalogues, tickets, or notes where keyword matching falls short.
  • Grounding LLM answers by retrieving the top-K relevant chunks and feeding them into the prompt.