Knowledge Base Reader Node
Last updated
Last updated
The knowledge base reader queries a permanent semantic database (a vector database) containing your files, scraped URLs, and / or synced integrations (e.g., Google Drive).
Knowledge bases are important because they are able to retrieve the most relevant pieces of data based on a query. The most relevant data can then be passed to a LLM so that the LLM generates responses that are relevant to the data.
Search Query: The query that will be used to search the knowledge bases for relevant pieces.
Type: Text
Face of the node
Knowledge Base: Select an existing knowledge base
In the gear:
Max chunks per query: the maximum number of pieces of data to be returned per query
Enable Filter: enable the ability to write a metadata filter
Enable Context: enable a text field to provide additional context for the search query
Re-rank documents: Performs an additional reranking step to reorder the documents by relevance to the query.
Score Cutoff: The minimum relevancy score (between 0 and 1) that each piece of data will have semantically to the query
Retrieval Units: Return the most relevant chunks (text content) or Documents (will return document metadata)
Transform Query: Transform the query for better results
Answer Multiple Questions: Extract separate questions from the query and retrieve content separately for each question to improve search performance
Expand Query: Expand query to improve semantic search
Do Advanced QA: Use additional LLM calls to analyze each document to improve answer correctness
Show Immediate Steps: Display the process the knowledge base is conducting at a given time in the chatUI
Format Context for a LLM: Do an additional LLM call to format output
Chunks: Semantically similar chunks retrieved from the knowledge base
Type: List of text
Example usage: {{knowledge_base_0.chunks}}
Citation Metadata: Citation metadata for knowledge base outputs, used for showing sources in LLM responses
If Do Advanced QA is checked:
Response: the response of the additional LLMs calls conducted on each document
Use a Knowledge Base Reader node when you want to query previously loaded data that has already been loaded. Use a Semantic Search node when your pipeline loads new data at run time for querying.
If the knowledge base is not returning relevant information to a query, try increasing the number of max chunks per query in the gear of the knowledge base
For debugging purposes, you may attach an output node to the knowledge base to view the chunks that are returned for the query
The below example is a pipeline for chatting with a knowledge base. The input node (representing the user message) is utilized in the Search Query input. The knowledge base reader node returns chunks, which is utilized in the prompt of the LLM.