Knowledge Base
Learn how to use the Knowledge Base node in StackAI to search and retrieve information from your indexed documents, including input, configuration, and output details.
The Knowledge Base Node in StackAI allows you to search and retrieve information from your indexed documents. It is designed to help AI workflows access relevant content from your organization's knowledge repositories, making it easy to build intelligent document search, retrieval-augmented generation (RAG), and automated Q&A solutions.
How to use it?
To use the Knowledge Base node, connect it within your StackAI workflow where you want to enable document search or retrieval. The node can be configured to search specific knowledge bases, filter results, and control the number and type of results returned. It is typically used in conjunction with LLM nodes to provide context-aware answers or summaries based on your indexed content.
Example of Usage
Suppose you want to build a chatbot that answers user questions using your company’s internal documentation. You would add the Knowledge Base node to your workflow, configure it to search your indexed documents, and connect its output to an LLM node. When a user asks a question, the Knowledge Base node retrieves relevant document snippets, which the LLM then uses to generate a precise answer.
Available Actions
Below are the most commonly used actions for the Knowledge Base node:
1. Search Knowledge Base
Description: Searches your indexed knowledge base for relevant documents or content based on a query.
Inputs:
query (Required): The search string or question to look up in your knowledge base.
knowledge_base_id (Required): The unique identifier of the knowledge base to search.
filters (Optional): Metadata or tag filters to narrow down the search results.
top_k (Optional): The maximum number of results to return (default is 10).
advanced_rag (Optional): Boolean to enable advanced retrieval-augmented generation features.
Configurations:
connection_id (Required if your knowledge base requires authentication): The connection ID for accessing the knowledge base provider.
Outputs:
results (Required): An array of relevant document snippets or content chunks.
metadata (Optional): Additional information about each result, such as source, date, or tags.
Example:
Input:
query: "What is the company’s refund policy?"
knowledge_base_id: "630eed87-31bf-4e64-9399-a1d298ca8a45"
top_k: 5
Output:
results:
"Our refund policy allows returns within 30 days of purchase..."
"Refunds are processed within 5 business days after approval..."
How to Use in a Workflow
Add the Knowledge Base node to your StackAI workflow.
Set the required inputs, such as the query and knowledge base ID.
(Optional) Add filters or adjust the number of results.
Connect the output to an LLM node or Output node to display or process the retrieved information.
Best Practices
Always specify the correct knowledge base ID to ensure accurate search results.
Use filters to refine results for more targeted answers.
Combine with LLM nodes for context-aware, natural language responses.
Summary
The Knowledge Base node is a powerful tool in StackAI for searching and retrieving information from your indexed documents. By configuring its inputs and outputs, you can build intelligent workflows that leverage your organization’s knowledge for automation, support, and more.
Last updated
Was this helpful?