> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hubtalk.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 09. Global node and RAG

> An off-topic question must not break the script, and the answer must come from documents.

# Global node and knowledge base

> [!NOTE]
>
> **Module goal:** make sure a question like "how much is a visit?" does not break the script, and the answer comes from documents rather than the model's imagination.

A **global node** is reachable from anywhere in the dialog: instead of incoming transitions it has a trigger condition — **Entry condition (global\_condition)**. A typical setup (this is advice, not a platform requirement) is two global nodes: "product questions" and "asks for a human".

To keep the conversation on track, the global node has return enabled — **Go back — return to the interrupted node**: its own **Return condition** ("the client got an answer") brings the dialog back to exactly the node it was taken from. On top of that there is loop protection — **Prevent immediate retrigger (suppression turns)**: the node does not fire again for the set number of turns in a row, 3 by default.

![Global node inspector: entry condition, go back and its own knowledge base binding](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-14-global-node_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=88c29549eea549cb7d27dcc53e3473f1)

The “Question about the clinic” global node. Entry condition, return to the interrupted node and its own knowledge base binding with search settings: hybrid search, threshold 0.4, 5 results and LLM query rewrite. Retrigger suppression is in the collapsed block of the global node's expert options.

> [accordion] Show the full panel
>
> ![Global node inspector: entry condition, go back and its own knowledge base binding](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-14-global-node_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=88c29549eea549cb7d27dcc53e3473f1)

## How knowledge bases work (RAG)

**1. Create a base and upload files**

In the **Knowledge Bases** section you create a base and upload files to it. Formats: `.pdf`, `.txt` and `.json`, up to 5 MB per file; one upload takes up to 32 files with a total size of up to 5 MB. A base does not take a website address: save the pages as PDF or as text in a `.txt` file.

The base status is shown in the list: **new**, **indexing**, **ready**, **partially ready**, **indexing failed**. While indexing is running, no files can be added to that base. A base with some of its files ready already works with the ready ones.

An example for a clinic: a price list of services in PDF and answers to frequent questions in `.txt`. Advice: upload documents in the language the agent speaks — for an English-speaking agent (the `us_tcpa` market), `price-list.pdf` and `faq.txt` in English.

**2. Set the default set**

In the agent settings, in the **Knowledge bases** card, you set the **default base set** — every Conversation node without its own binding searches it. The set may be empty: then search runs only in nodes with their own binding.

**3. Override on a node if needed**

A Conversation node (a global one included) can get **its own** set with the **Set for this node** switch in the inspector. An empty list on a node = search on that node is off. The node's search settings override the agent's field by field: an empty field takes the agent's value. This is handy: a silent outbound agent searches only in one "FAQ" node, not on every utterance.

**4. Require answers only from what was found**

The retrieved fragments are added to the node's prompt. Advice: write "answer only from what was found" into the node instruction — otherwise the model will add things of its own.

> [!NOTE]
>
> **A knowledge base belongs to your organization and does not leave it.** The base picker shows only your organization's bases. An agent can reference only a base of its own organization: a binding to any other base blocks publishing the agent, a test session and a campaign launch — create the base in your organization and upload the files to it, or remove the binding.

![The Knowledge Bases section: the organization's bases with their indexing status](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-15-knowledge-list_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=509bc9b1ec4c55d3985f9bba5cbc509a)

/knowledge — the organization's knowledge bases: indexing status, renaming and deleting.

![The Knowledge bases card in the agent settings with two attached bases](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-16-settings-knowledge_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=e3c1dfa630abd6bf7671a27ab83b4341)

Settings → Knowledge bases. The default set; behind the gear in the card header are the search settings: type, threshold, number of results and the query rewrite mode.

> [accordion] Show the full panel
>
> ![The Knowledge bases card in the agent settings with two attached bases](https://mintcdn.com/hubtalk/UuNkjJ26eB-xpPwv/images/tutorial/tut-16-settings-knowledge_en.webp?fit=max\&auto=format\&n=UuNkjJ26eB-xpPwv\&q=85\&s=e3c1dfa630abd6bf7671a27ab83b4341)

An empty field in the search settings means the knowledge base service default: **Search type** `hybrid_search`, **Similarity threshold (0..1)** 0.4, **Max results (1..100)** 5.

> [!WARNING]
>
> **Pitfall: search costs time**
>
> Every search is a network request before the agent answers, and LLM query rewrite is one more model call, about 100–150 ms per turn. Advice: turn search on where questions are actually answered, and keep the threshold/limit modest: 4–5 results are almost always better than 20.
>
> On the platform the rewrite is on by default: if the search settings say **Default (platform)**, the agent rewrites the query before every search. The query is written in the language of the client's last utterance. Where response speed matters more than retrieval quality, pick **Off (gate + merge)** on the agent or the node: insignificant utterances are dropped, and the agent's previous question is added to the client's utterance. The rewrite model is set not on the agent but on the platform — see [Platform settings for agents](https://docs.hubtalk.ai/v4/platform/agent-settings/prompt-and-models.md#platform-settings-for-agents).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.