Skip to content

Knowledge Base Search Node

The Knowledge Base Search node retrieves information relevant to a search query from documents registered in a knowledge base. By passing the retrieved information to an LLM node, you can generate accurate answers grounded in your internal documents and manuals.

In this tutorial, we’ll build a workflow that answers employee questions based on an internal expense reimbursement manual.

Knowledge Base Search node

Create a new workflow in Studio. Select the Start node and add one input variable:

  • Variable name: question
  • Type: Text

This will be the input field that receives the user’s question.

Add a Knowledge Base Search node after the Start node and configure it as follows:

  1. Knowledge Base: Select the knowledge base containing your expense reimbursement manual (you can select multiple)
  2. Search Mode: Leave it on “Fast”
  3. Search Query: Enter the following
{{#start.question#}}

Add an LLM node after the Knowledge Base Search node. Copy and paste the following into the prompt field:

You are an internal helpdesk assistant.
Answer the employee's question based on the company manual excerpts below.
Rules:
- Only answer based on what is written in the manual
- If the manual does not cover the topic, reply: "This topic is not covered in the manual. Please contact the HR department for assistance."
- When possible, mention which section of the manual the answer is based on
## Company Manual
{{#knowledgeBase-1.context#}}
## Employee's Question
{{#start.question#}}

The final workflow looks like this:

Start → Knowledge Base Search → LLM → End

Overall workflow

Now you’re ready! Click the debug button to run the workflow.

Example questions to try:

  • “How do I submit a travel expense claim?”
  • “Do I need pre-approval for client entertainment expenses?”
  • “What should I do if I lost a receipt?”

You can choose a search mode depending on your needs.

ModeDescription
FastReturns quick answers with fewer search results. This is the default setting
CustomAllows fine-tuning of parameters like the number of results and similarity threshold

In Custom mode, the following settings are available:

  • Top K: Number of documents to retrieve (1–10)
  • Min Similarity: Similarity threshold for filtering results (0.0–1.0). Higher values return only more relevant results
  • Search Type: Similarity search or hybrid search

The Knowledge Base Search node has the following output variables. You can reference them in subsequent nodes using the format {{#knowledgeBase-1.variableName#}}.

VariableDescription
contextText containing the content of retrieved documents
sourcesMetadata about source documents (file name, similarity score, etc.)
queryThe actual query used for the search