> For the complete documentation index, see [llms.txt](https://manuals.dialox.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://manuals.dialox.ai/studio/flows/nodes/iterate-llm.md).

# Iterate: LLM

To provide the user a way to ask questions that can be answered by an LLM

The **Iterate: LLM** node can be applied in similar way to the [**Iterate: Iterate**](https://manuals.dialox.ai/studio/flows/nodes/iterate-iterate.md) node. This means it is most often used as a form of main menu in your Smart App: "What can I do for you today?".

Large language models (LLMs) are great at understanding user questions and provide sensible answers based on the information stored in the common knowledge of the language model. The [LLM Flows skill](https://manuals.dialox.ai/store/skills/llm-flows.md) adds this Flow node to your Flow designer.

The difference from the default [**Iterate**](https://manuals.dialox.ai/studio/flows/nodes/iterate-iterate.md) node is that it will use the LLM to provide an answer to the user if none of the links are triggered. If the LLM doesn't have an answer, it will still trigger the `__unknown__` dialog trigger, which you can configure on this node to handle this event.

## How to use?

As explained above, the **Iterate: LLM node** is used in the same way the default [**Iterate**](https://manuals.dialox.ai/studio/flows/nodes/iterate-iterate.md) node is used. The **Iterate: LLM** node will work as a main menu. It can either respond using one of the [labelled links](https://manuals.dialox.ai/studio/flows/links.md#labelled-links), by triggering [dialog triggers](https://manuals.dialox.ai/studio/flows/links.md#dialog-triggers-that-are-triggered-by-a-user-intent), by answering one of its [FAQs](#faqs-and-routes), by following one of its [Routes](#faqs-and-routes), or by formulating a response from the LLM.

<figure><img src="https://3356808761-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEBQHGJABNTj5ISSOTRxM%2Fuploads%2FaktfXTIW7vh9MRmZ6JQu%2Fllm-blurred.png?alt=media&amp;token=5297ca4c-41c5-48e5-936e-c3ea81aa661a" alt=""><figcaption><p>Example of how to use the Iterate LLM node in your Flow</p></figcaption></figure>

In the above example, the **Iterate: LLM** node will match the intents associated with the two labelled links "Talk to a human" and "Done". If the user doesn't appear to be asking for either of these intents, it will use the LLM to generate an answer.

The LLM can use a specific instruction from you (as the Smart App designer) to guide the generation of the answer. This instruction is given in the form of a Prompt. The prompt can be configured in the [AI section](https://manuals.dialox.ai/studio/ai.md) of the platform. Besides instructions, the prompt will also contain content that the LLM can use on top of its own dataset to generate answers, like information regarding your address, opening hours, parking instructions, etc. See the [Prompts](https://manuals.dialox.ai/studio/ai/prompts.md) page for more information on this topic.

## FAQs and Routes

Just like the [**Iterate: Iterate**](https://manuals.dialox.ai/studio/flows/nodes/iterate-iterate.md) node, the **Iterate: LLM** node supports FAQs and Routes. They keep your Flow canvas clean: instead of drawing a link for every simple question or redirect, you configure them in the side panel of the node.

* **FAQs** - Select one or more FAQs that are maintained in the [FAQs](https://manuals.dialox.ai/studio/content/faqs.md) page in the Content section. When the user's message matches the intent of an FAQ, the Smart App gives the answer of that FAQ (and adds its tag, if one is set) without using the LLM. After that, the node asks the user again.
* **Routes** - Add a Route by selecting an intent and a destination Flow, and optionally one or more tags. When the user's message matches the intent, the tags are added to the conversation and the Smart App continues in the destination Flow.

The LLM is only used when none of the FAQs, Routes, labelled links or dialog triggers match the user's message.

{% hint style="info" %}
The intents used in FAQs and Routes must exist in your Smart App. Don't use the same intent for both an FAQ and a Route.
{% endhint %}

## Node properties

| Property   | Description                                                                                                                                         | Explanation |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
| Question   | The initial question                                                                                                                                |             |
| Repeat (1) | The text to use when re-prompting the user after a turn                                                                                             | optional    |
| Repeat (2) | The next text to use when re-prompting the user after a turn. The system will keep on iterating this step the third and all other turns             |             |
| Prompt     | The [prompt](https://manuals.dialox.ai/studio/ai/prompts.md) which contains the instructions and content the LLM can use when generating a response |             |
| FAQs       | The [FAQs](https://manuals.dialox.ai/studio/content/faqs.md) this node answers directly, without using the LLM                                      | optional    |
| Routes     | Intents that redirect the user to a different Flow, optionally adding tags to the conversation                                                      | optional    |

## Resources

* [Iterate: Iterate](https://manuals.dialox.ai/studio/flows/nodes/iterate-iterate.md)
* [Links](https://manuals.dialox.ai/studio/flows/links.md)
* [Prompts](https://manuals.dialox.ai/studio/ai/prompts.md)
* [LLM Flows](https://manuals.dialox.ai/store/skills/llm-flows.md)
* [AI](https://manuals.dialox.ai/studio/ai.md)
* [FAQs](https://manuals.dialox.ai/studio/content/faqs.md)
