Theme
KB Search Node
The KB Search node queries a Knowledge Base (KB) to find relevant document chunks, then uses an LLM to generate a grounded response. It combines vector similarity search with AI generation -- a pattern known as retrieval-augmented generation (RAG).
When to Use
- You want the bot to answer questions from your uploaded documents (FAQs, policies, manuals, product catalogs).
- You need responses that are grounded in specific content rather than general LLM knowledge.
- You want to cite sources so the user knows where the information came from.
Configuration
| Property | Description | Default |
|---|---|---|
| Knowledge Base | The KB to search. Selected from a dropdown of your tenant's Knowledge Bases. | None (required) |
| Integration | The AI model used to generate the response from retrieved chunks. | Tenant default AI model |
| Query Template | The search query. Defaults to the user's last message. Supports {{variable}} interpolation. | {{last_message}} |
| Top K | The maximum number of document chunks to retrieve. | 5 |
| Min Score | Minimum similarity score (0.0 to 1.0). Chunks below this threshold are excluded. | 0.5 |
| Max Context Tokens | Maximum number of tokens from retrieved chunks to include in the LLM context. | 4000 |
| Max Tokens | Maximum number of tokens for the LLM's generated response. | 2048 |
| Include Sources | Whether to include source document references in the output. | true |
KB Search node config panel showing Knowledge Base dropdown, integration selector, query template field, Top K slider, Min Score threshold, and Include Sources toggle
AI Prompt Management
Like the LLM Response node, you can select a Managed Prompt to control how the LLM generates answers from the retrieved context. The prompt template typically instructs the LLM to answer based only on the provided documents and to cite its sources.
Dynamic KB Lookup
Enable Dynamic KB to select the Knowledge Base at runtime based on the page_label session variable. This is useful when:
- You embed the chat widget on multiple pages, each with its own KB.
- The page label (set via the widget's
metadataoption) maps to a KB name.
When dynamic lookup is enabled, the node:
- Reads the
page_labelvariable from the session context. - Searches for a KB whose name matches the label (case-insensitive).
- Falls back to the statically configured KB if no match is found.
Setting the page label from the widget
Pass the page_label in the widget's metadata init option:
html
<!-- Widget on the pricing page -->
<link rel="stylesheet" href="https://omnibots-widget.web.app/widget.css">
<script src="https://omnibots-widget.web.app/widget.iife.js"></script>
<script>
window.omnibot.init({
deploymentKey: 'your-deployment-key',
metadata: {
page_label: 'Pricing'
}
});
</script>For single-page apps, update the label on navigation:
js
// SPA route change
window.omnibot.setContext({ page_label: 'Support' });TIP
Dynamic KB lookup lets you build a single flow that serves different content depending on which page the user is chatting from. Create one KB per product or topic and name it to match the page label. See Widget Page Context for the full context API.
Agentic Mode
When Agentic Mode is enabled, the KB Search node can call tools during response generation, just like the LLM Response node. The LLM can combine KB results with tool calls (e.g., look up an order, then answer using KB context).
| Property | Description | Default |
|---|---|---|
| Agentic Mode | Enable tool calling during KB response generation. | true |
| Enabled Tools | Which tools the LLM can call. | None |
| Max Iterations | Maximum tool-call loops. | 5 |
Output
The node stores its output in a variable (default: kb_results) containing:
- The generated text response (grounded in KB content).
- An array of source documents with metadata (if Include Sources is enabled), including document name, page, and relevance score.
Use the output in a Message node to send the response to the user:
{{kb_results}}Chat widget showing a KB Search response with an AI-generated answer followed by source citation links showing document names and page numbers
WARNING
If the KB is empty or no chunks meet the minimum score threshold, the LLM will generate a response without document context. Consider adding a Condition node after the KB Search to check whether relevant results were found.
Handles
| Handle | Direction | Description |
|---|---|---|
| Input | In | Receives execution from the previous node |
| Output | Out | Continues to the next node after the search and generation completes |
