Generate with AI

Use AI inside a workflow.

The Generate with AI step allows you to add a Generative AI capability directly inside your conversation flow.
It can be used to generate text, extract structured information, or enrich user answers with external knowledge.

❗️

To use the Gen AI step, you must have configured Louis AI.

When to use the Gen AI step

Use the Gen AI step whenever you need the bot to produce a dynamic answer or analyze user input beyond simple scripted logic.

Common use cases:
• ✍️ Generate personalized answers based on context or previous variables.
• 🧾 Extract and structure information (e.g., booking data, names, emails, flight numbers).
• 🔍 Query your Knowledge Base to answer FAQ-type questions.
• 🧠 Transform data — for example: summarize, translate, or format user input.

💡

Example to collect data

If a user types:

“My flight is AF1234 from Paris to Geneva tomorrow”

You can use the Gen AI step to extract {flight_number, departure_city, arrival_city, date} as structured variables.

How it works

Step 1 — Add the block

Add a Generate with AI block in your flow.
Connect it after an intent or another step that collects user input.


Step 2 — Configure step


In the right panel:
• Description → Add a short note about the purpose of this step.
• AI Prompt → Select an existing prompt or create a new one.
• Output variable → Choose the variable where the AI output will be stored.

Step 3 — Create or edit a Prompt

When you click Create New Prompt, you’ll enter the Prompt Editor, composed of:


System Prompt

Describe the role and context for the AI.
Example:

“You are an assistant that extracts structured booking information from a user’s message.”

User Prompt

Define the instruction or user message. You can use flow variables here, e.g.:

{{user_input}}

Use prompt samples to quick start


Advanced Settings


Click Advanced Parameters to access optional features:

  • Connect to Knowledge Base Allows the AI to access your Knowledge Base for more accurate, documented answers.
  • JSON Output Forces the model to return structured data in a defined JSON format.
    • JSON Schema Defines expected fields and types (e.g., string, number, boolean).

You can also start from a JSON template using “Start with a JSON example”.

Step 4 — Test your prompt

Click Test AI Response to preview the generated output.

When satisfied, save your prompt.


Save the result in a variable

You must save the answer to use it after in your flow.


Advanced usage

Combine with API calls

Use the Gen AI step to format or preprocess data before an API request.
For example: extract a date and send it to an external booking API.

Use with Knowledge Base

Enable Connect to Knowledge Base to combine your AI prompt with your documents — perfect for RAG-style answers powered by Louis AI.

JSON mode for structured automation

Enable JSON Output and define a schema to make the AI return data you can reuse later in the flow:

{
"name": "string",
"email": "string",
"destination": "string"
}

This structured output can then be passed into API calls, conditional logic, or agent handovers.

💡

Tips & Best Practices

•	Write a precise system prompt (define the role, style, and expected output).
•	Use JSON Output when your next step depends on structured data.
•	Always test your prompt before publishing.
•	Avoid vague or open-ended instructions unless the goal is text generation.