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

# Design-time and run-time features

> Configure and use the design-time and run-time generative AI features available for Flow-based agents.

Flow-based agents use large language models (LLMs) in two ways: to support the agent builder while you design a Flow ([design-time](#design-time-generative-ai-features)), and to enhance the customer experience while the Flow runs ([run-time](#run-time-generative-ai-features)). For prerequisites and supported providers, see [Generative AI](https://docs.cognigy.com/ai/agents/develop/gen-ai-and-llms/providers/all-providers).

## Design-time generative AI features

### Configure LLMs for design-time features

1. In **Manage > AI & Voice Providers**, open the **Language Models** tab and click **Assignments**.
2. Under **Design-Time**, from the **Design-Time Features** list, select an LLM or embedding model.

### Generate Cognigy resources

During the design phase of creating flow agents, LLMs can be used to generate a variety of Cognigy resources:

> [accordion] Generate lexicons
>
> > [!NOTE]
> >
> > * The generation of Lexicons for primary NLU languages besides German and English isn't fully supported.
> > * The model may not always generate the exact number of Lexicon entries requested, as its output can vary based on interpretation and model behavior.
>
> To use Generative AI technology for creating a new Lexicon, do the following:
>
> 1. In the left-side menu of the Cognigy interface, click **Advanced > Lexicons**, then **+ New Lexicon**.
> 2. In the **New Lexicon** window, specify the name covering the Lexicon's general main topic and add a relevant description. It helps generate a more accurate result. To ensure that the generated content meets the desired expectations, fill in both fields. Relying solely on the title without using the description field will not produce the intended results.
> 3. Go to the **Lexicon Entry Generation** setting, and activate **Generate Lexicon Entries**.
> 4. Select **Lexicon Language** from the list and set the number of entries (lexicon units).
> 5. *(Optional)* Add the default [Slot](https://docs.cognigy.com/ai/platform-features/nlu/slots/overview).
> 6. *(Optional)* Activate **Generate Synonyms**. Synonyms help flow agents understand and recognize different variations of the same concept. Up to five synonyms will be generated for each keyphrase.
>
> When the Lexicon Editor with new keyphrases is opened, you can edit, delete, or add new ones manually.
>
> ![Lexicon editor with AI-generated keyphrases](https://mintcdn.com/cognigy-15abf2ba/kRoeN5SI_WzAukT3/_assets/ai/empower/generative-ai/generating-lexicons.png?fit=max\&auto=format\&n=kRoeN5SI_WzAukT3\&q=85\&s=94ad072f844dbc71a4506797b2625274)

> [accordion] Generate flows
>
> Note that the generation of Flows for primary NLU languages besides German and English is not fully supported.
>
> To use Generative AI technology for creating a new Flow with pre-configured Nodes based on your scenario, do the following:
>
> 1. In the left-side menu of the Cognigy interface, click **Design > Flows**, then **+ New Flow**.
> 2. In the **New Flow** window, go to the **Flow Generation** section and select one of the options in **Flow Generation Input**. The section appears only when you create a new Flow.
>
>    * **None** — the Generative AI will not be applied to this Flow. This setting is activated by default.
>    * **Name and Description** — the Generative AI will use the Name and Description fields for generating Flow.
>    * **Name and Transcript** — the Generative AI will use the Name and Transcript fields for generating Flow. For this setting, you need to create a scenario and put it in the Transcript field, which accepts up to 600 characters. Use the Transcript field template as an example for your scenario.
>
> In the existing Flow, you can edit Nodes created based on your scenario. Generate new Intent sentences or responses for a chatbot.
>
> ![Flow with Nodes generated by Generative AI from a scenario](https://mintcdn.com/cognigy-15abf2ba/kRoeN5SI_WzAukT3/_assets/ai/empower/generative-ai/generating-flows.png?fit=max\&auto=format\&n=kRoeN5SI_WzAukT3\&q=85\&s=3bfde2a896829df7a0fbd8ea6fd8e7ca)

> [accordion] Generate intent sentences
>
> > [!NOTE]
> >
> > * The generation of Intent example sentences for primary NLU languages besides German and English is not fully supported.
> > * The model may not always generate the exact number of sentences requested, as its output can vary based on interpretation and model behavior.
>
> To use Generative AI technology for creating Intent example sentences, do the following:
>
> 1. Open the existing Flow.
> 2. In the upper-right corner of the **Flow Editor** page, select **NLU**.
> 3. On the **Intent** tab, click **Create Intent**.
> 4. Specify a unique name for the Intent and add a relevant description. It helps generate a more accurate result. To ensure that the generated content meets the desired expectations, fill in both fields. Relying solely on the title without using the description field will not produce the intended results.
> 5. Activate the **Generate Example Sentences** setting and set the number of generative sentences.
> 6. Generate new sentences by clicking **Create**, then click **Build Model**.
>
> If you want to add more examples automatically, use the **Generate Sentences** button. New sentences will be marked in light blue. The system generates specific numbers of sentences. Save changes and build your model again.
>
> You can also use Generative AI in the Node configuration.
>
> ![AI-generated example sentences for an Intent](https://mintcdn.com/cognigy-15abf2ba/kRoeN5SI_WzAukT3/_assets/ai/empower/generative-ai/generating-intent-sentences.png?fit=max\&auto=format\&n=kRoeN5SI_WzAukT3\&q=85\&s=6d1c956e2613de3c5509181cf3504c90)

> [accordion] Generate Adaptive Cards
>
> LLMs can create Adaptive Cards based on the prompt you provide in the description field for the **Adaptive Card** output type in the [Say](https://docs.cognigy.com/ai/agents/develop/node-reference/basic/say.md) or [Copilot: Adaptive Card Tile](https://docs.cognigy.com/ai/agents/develop/node-reference/agent-copilot/set-adaptive-card-tile.md) Nodes.

## Run-time generative AI features

In Cognigy, the run-time Generative AI features enrich flow agents with dynamic interactions using LLMs.
These features include running prompts, orchestrating conversations, rephrasing outputs,
dynamic question reprompts, and generative knowledge retrieval.

### Configure LLMs for run-time features

1. In **Manage > AI & Voice Providers**, open the **Language Models** tab and click **Assignments**.
2. Under **Runtime Features**, assign a model to each [run-time feature](https://docs.cognigy.com/ai/agents/develop/gen-ai-and-llms/model-support-by-feature.md) you want to use.

### Use run-time features

In the [Flow editor](https://docs.cognigy.com/ai/agents/develop/projects-and-flows/editor), you can use the following run-time Generative AI features:

> [accordion] LLM prompt node
>
> The [LLM Prompt Node](https://docs.cognigy.com/ai/agents/develop/node-reference/service/llm-prompt.md) enables you to run a prompt against an LLM and either output the message or store it in the Input or Context objects.

> [accordion] Rephrasing flow agent outputs
>
> To use AI-enhanced bot output rephrasing in [Say](https://docs.cognigy.com/ai/agents/develop/node-reference/basic/say.md), [Question](https://docs.cognigy.com/ai/agents/develop/node-reference/basic/question.md), and [Optional Question](https://docs.cognigy.com/ai/agents/develop/node-reference/basic/optional-question.md) Nodes, do the following:
>
> 1. Open the existing Flow.
>
> 2. Add one of the Nodes: Say, Question, or Optional Question.
>
> 3. Go to the **AI-enhanced output** section.
>
> 4. In the **Rephrase Output** setting, select one of the options:
>
>    * **None** — the Generative AI will not be applied to this Node. This setting is activated by default.
>    * **Based on Custom Input** — specify custom values for the Input. Use the **Custom Inputs** field that allows the bot developer to input information for contextualizing and rephrasing the output.
>    * **Based on previous user inputs** — set the last `x` user Inputs considered.
>
> 5. Set the score in the Temperature setting. The temperature range determines the extent of variation in Generative AI's response.
>
> 6. Click **Save Node**.
>
> Check in the Interaction Panel if your Flow works as expected.
>
> ![AI-enhanced output rephrasing settings in a Say Node](https://mintcdn.com/cognigy-15abf2ba/kRoeN5SI_WzAukT3/_assets/ai/empower/generative-ai/generating-output.png?fit=max\&auto=format\&n=kRoeN5SI_WzAukT3\&q=85\&s=d86a0f1b7933c35b1bf311aeaabe2ce4)

> [accordion] LLM-powered question reprompts
>
> The [Question Node](https://docs.cognigy.com/ai/agents/develop/node-reference/basic/question.md) includes a feature to output a prompt to the user when they have answered a question incorrectly. Instead of using static text, you can use LLMs to generate a more dynamic and personalized output.

> [accordion] Search extract output node
>
> The [Search Extract Output Node](https://docs.cognigy.com/ai/agents/develop/node-reference/other-nodes/search-extract-output.md) uses Cognigy [Knowledge AI](https://docs.cognigy.com/ai/agents/develop/knowledge-ai/overview)
> to execute a search within a Knowledge Store,
> extracts a relevant answer via a Generative AI model, and creates an output.

> [accordion] LLM entity extract node
>
> The [LLM Entity Extract Node](https://docs.cognigy.com/ai/agents/develop/node-reference/other-nodes/llm-entity-extract.md) retrieves specific entities from user inputs,
> such as product or booking codes and customer IDs.
> For example, if a user input is `I would like to book flight AB123 from New York to London`,
> the LLM can extract the booking code `AB123` from this input.

## More information

* [Generative AI](https://docs.cognigy.com/ai/agents/develop/gen-ai-and-llms/llms)
* [Flows](https://docs.cognigy.com/ai/agents/develop/projects-and-flows/overview)
* [Flow Nodes](https://docs.cognigy.com/ai/agents/develop/node-reference/overview)
