Table of Contents

AI Agent block

Jonathan Goodfellow Updated by Jonathan Goodfellow

The AI Agent block adds an AI-driven conversation to your flow. The agent follows the instructions you write, answers questions using a Knowledge Base you provide, collects information into Fields, and hands the conversation back to your rule-based flow when one of your Outputs is triggered.

πŸ’¬ Compatible with Web, WhatsApp, and Facebook Messenger.

πŸ“Œ The AI Agent block is available on all paid plans. The AI Agent block is not available on the Sandbox plan.

How to open the AI Agent block setup

Add the AI Agent block to your flow and click it to open the setup pop-up. Every section described below lives inside that pop-up.

How to build an agent with Build it with AI

Build it with AI generates a complete Agent Setup from a plain-language description of what you want the agent to do. Describe the agent in the Description section, or choose one of the pre-set templates, then click Generate.

The Description section accepts up to 1,000 characters.

⚠️ Build it with AI overwrites the entire Agent Setup. Any changes you already made to the agent are replaced.

How to change your instructions with Edit it with AI

Edit it with AI updates your existing Agent Instructions from a description of the change you want, so you do not have to rewrite the full prompt. Describe the change and the AI adjusts the instructions you already have, adding new behaviors, improving existing ones, or making them clearer.

What you can set in the Configuration section

The Configuration section controls how the agent runs. You can set the following:

● AI Model β€” select the model the agent uses

● Text Input visibility β€” show or hide the text input when the agent uses Interactive components

● Custom Error Message β€” the message the user sees when the agent hits a technical problem, such as a failure connecting to the AI tools in the back end

● Time Context β€” give the agent the current date and time, and select the timezone it uses

● Pre-conversation context β€” pass the last 5 messages exchanged between the agent and the user, so the agent takes them into account when answering

What to put in your AI Agent's Knowledge Base

The Knowledge Base holds the information your agent consults when a user asks a question. Click Add Knowledge and choose Text, File, or URL. Choosing URL lets the agent scrape a website to gather its information.

Include in your Knowledge Base:

● Company or service-specific knowledge

● Common FAQs and their answers

● Detailed information the agent should know about your business

⚠️ Do not put behavior instructions in the Knowledge Base. The Knowledge Base holds information the agent consults; how the agent should behave belongs in Agent Instructions.

The Knowledge Base has the following limits:

● Up to 200,000 characters of text added directly, or uploaded as a document

● Up to 200,000 characters of a website's HTML when scraping a URL

● Accepted file formats: PDF, DOCX, TXT, MD, RTF

⚠️ The Knowledge Base reads text only. The agent does not read information contained in images or graphics, so anything shown only in a picture, chart, or screenshot is invisible to it.

After uploading a source, click it to see exactly how the content looks to the agent, and edit it if necessary.

For guidance on structuring the documents you upload, see how to write documents for the AI Agent Knowledge Base.

How to keep a scraped URL up to date

A URL source can refresh itself on a schedule, so the agent answers from the current version of the page. Open the URL source and toggle Refresh automatically, then choose Daily, Weekly, Biweekly, or Monthly.

How to write your Agent Instructions

Agent Instructions define how your agent behaves and are the core of the AI Agent setup. Effective instructions cover four areas. The examples below are for a lead generation agent at an English language academy:

● Behavior guidelines β€” how the agent interacts with users. Example: "Act as a lead generation agent for Brighton English Academy."

● Response style β€” how the agent answers. Example: "Maintain a formal, polite, professional tone throughout the chat."

● Edge case handling β€” how the agent manages unusual situations. Example: "If the user asks about a course that is not available, give them a list of the available alternatives taken from the Knowledge Base."

● Information capture β€” what data to gather and how. Example: "Gather the course the user is interested in (Business English, English for Beginners, Cambridge English)."

Information capture works together with the Store Data section: Store Data defines the Fields and their descriptions, while your instructions tell the agent which data to collect and how to collect it. An agent with Fields configured but no instruction to collect them will not collect them.

For a full guide to writing instructions, see rules to create instructions for a Landbot AI Agent.

How to use existing Fields in your instructions

The Add Fields button inserts a Field your flow already collected into your instructions, so the agent can use that value. For example, if you collected the user's name earlier in the flow, add that Field to your instructions and the agent can address the user by name. Select the Field from the drop-down list to add it.

How to collect and store data with your AI Agent

The Store Data section defines what information the agent collects from users and the Fields where that information is saved. Click Add Data, then give the Field a name and a Field Description explaining exactly what the data is.

The Field Description tells the agent what it is looking for, so write it as a description of the data rather than a label. To make capture reliable, also instruct the agent to collect that data in the Agent Instructions section, with examples of what the data looks like.

πŸ“Œ An AI Agent can collect up to 20 Fields.

How to create Fields from a template

The Use Templates button generates Fields and descriptions from pre-set options, with templates for contact information, lead qualification, and real estate information.

For a detailed guide, see capture and use data with AI Agents.

How to add Interactive components to your agent

Interactive components are elements such as buttons and cards that the agent displays in the conversation instead of plain text. Ask the AI to create them in the Interactive components section.

Turning on Text Input visibility in the Configuration section lets the user type a message or use an Interactive component, rather than only choosing a component.

For setup details, see AI Agent interactive components.

How Outputs end the AI conversation

An AI Agent runs in a conversational loop, and the user stays in that loop until one of your Outputs is triggered. Each Output defines a condition that ends the AI conversation and passes the user to the next block in your rule-based flow.

For example, to end the AI conversation when the user asks to speak to a person, create an Output for that condition. The Output then appears on the AI Agent block in your flow, where you connect it to the block that should run next β€” a Human Takeover block, in this case.

Once an Output condition is met, the conversation transfers to the block you connected it to, which is how an AI Agent hands off to APIs, CRM systems, or the rest of your automated flow.

⚠️ The AI Agent has no knowledge of what the next block does. Write your Output as an instruction to end the chat, not a description of what happens afterward β€” if the next block sends an email, do not mention the email in the Output.

What users see while the agent is writing a reply

Users see the message "Thinking…" while the agent composes a reply, instead of the three dots used elsewhere in the conversation. The message tells the user the agent is working on a response and the conversation has not stalled.

You can change this message to match your brand voice from the Custom System Messages section in your account.

How to test your AI Agent

Test an AI Agent the same way you test any other agent: publish it and use Share with a Link from the Share section for a Web agent, or one of the WhatsApp testing options for a WhatsApp agent. Testing shows both whether the agent answers correctly and whether the Fields you configured are actually being saved, which you can check in the Analyze section.

When testing, check all four of the following:

● Data collection β€” the agent captures information exactly as your instructions specify

● Agent responses β€” replies follow your instructions and the information in your Knowledge Base

● Outputs β€” the agent exits at the right moment and transfers to the correct block

● Integration β€” collected information is available to the rest of your rule-based flow and any connected systems

How to troubleshoot an AI Agent

Start by reading the conversation itself. The AI Analysis part of the Analyze section holds transcripts of your AI chats, which show what the agent was actually asked and how it responded.

Your AI Agent is not collecting information

An agent collects data only when the Agent Instructions tell it to, even if the Fields exist in Store Data. Check that your instructions include examples of how the information should be collected and categorized, and that each Field in Store Data has a description that matches what the instructions ask for.

Your Outputs are not working

Check that each Output on the AI Agent block is connected to the right block in your flow, and that its condition is clearly defined and reachable given the rest of your instructions. An Output with a condition the conversation never satisfies never triggers.

Your AI Agent is not using the Knowledge Base

Check that the uploaded content is text, correctly formatted, and detailed enough to answer the question being asked β€” content that exists only inside an image is not read. Then check that your instructions tell the agent when and how to use the Knowledge Base.

For more on AI Agents, see the AI Agent guides.

Was this article helpful?

AI Agent - Interactive components

AI Agent Setup - Best Practices

Contact