Table of Contents

AI Agent Setup - Best Practices

Jonathan Goodfellow Updated by Jonathan Goodfellow

🚀 Best Practices for Building AI Agents in Landbot

AI Agents in Landbot are powered by GPT models under the hood. That makes them flexible and powerful — but to get the best results, you need to set them up with clear guardrails. A well-configured agent can feel smart, safe, and helpful. A poorly set one can get lost, loop endlessly, or confuse users 🥴

To help you avoid that, here are best practices across four key features: Instructions, Knowledge Base, Outputs, and Store Data.

If you are just getting started with AI Agents, we recommend that you first check out our AI Agent Block article, here.

📝 Instructions: Set the Ground Rules

Instructions are like the job description for your AI Agent. The clearer you are, the better it performs. 💥

  1. Be specific about the role → Define what the agent is and what it isn’t allowed to do. ✅⛔️
  2. Set the tone & style → Friendly? Professional? Short answers? Emojis? Decide and write it down. 🔝
  3. Be specific about data collection → Tell the agent exactly what info to collect and provide examples. For instance, the English Academy demo shown above uses budget ranges and course types so the agent knows what to look for. ↔️
  4. Handle variations → Anticipate the different ways users may say the same thing. Example: a user might type “business” instead of “business course,” and the agent should still capture the correct intent. 🖌️
  5. Test & refine → Run trial conversations and adjust wording if the agent misunderstands or misses data. 🧪
You can also check out our guide to using AI Tools to create your Instructions here

📋 Storing Data

Fields are your bot’s memory. Using them well means you can personalise experiences and reuse data later 🏁

  1. Define clear categories for custom fields → Clearly define the fields you want to collect (e.g., “user_name,” “preferred_course,” “budget_range”) to avoid overlap and confusion 🙋🏼‍♂️
  2. Collect only what you need → Don’t overload the user with unnecessary questions. Focus on info that actually drives the conversation forward 🔮
  3. Use consistent field names → Stick to the same naming conventions across flows so data is portable and easy to analyse 📇
  4. Validate inputs → Ensure emails, phone numbers, or dates are stored in the right format for later use ℹ
  5. Save fields and use them in the your instructions → You can use fields that the Agent stores in your Agent Instructions. For example, you might want to collect the user's name then use this Field to address them in the rest of the chat! 💬
You can reference Fields that have been set in your Agent Instructions with the @ symbol, for example, if you saved the user's name in the Field "name", you can access it in the instructions with: "@name"

📚 Knowledge Base Section

Your Knowledge Base (KB) is what the agent relies on to answer questions. A clean KB = clean answers 🧹

You can check out our full guide to Knowledge Base Optimisation here.
  1. Use Q&A format where possible → Easier for the AI to match user queries 🙋🏼‍♂️
  2. Organize with clear headings/subheadings → Helps retrieval and improves accuracy 📝
  3. Write step-by-step guides → Break processes into numbered steps 🔢
  4. Keep entries short & focused → One topic per section/document 😌 It can go until 200k characters
  5. Explain jargon & add examples → Define technical terms and show practical use cases 🔧

🔁 Outputs

The user will remain in the AI Agent until the Output you add in this section tells the agent when to stop the conversation and trigger the next part of the flow.

  1. Clearly define when the Output should trigger
    Specify exactly what event or condition will cause the Agent to exit its loop. For example: user has no more questions, lead doesn’t meet qualification criteria, user requests human assistance 🙋🏼‍♂️
  2. Add & name your Outputs purposefully
    Give each Output a meaningful name (e.g., “Unqualified Lead,” “Needs Human Talk,” “Finish FAQ”) so you can easily tell them apart ℹ️
  3. Reinforce the Output in the Instructions
    Even though the Output logic is set elsewhere, the Agent needs to “know” these conditions in its Instructions. That helps align how the AI responds so it can recognize when to exit ✅
  4. Use practical examples and test them
    Use sample scenarios (like FAQs done, lead unqualified, or user says “EXIT”) to test each Output. Testing ensures you don’t have dead-end chats or loops ↔️

🧪 Testing Your Setup

Above all else the best practice that we can recommend in getting your Agent to behave exactly as you want is test, test and test some more!

  1. Verify Data Collection: Test that the agent captures information exactly as specified in your instructions 📝
  2. Check Output: Ensure the agent exits at the right time ↔️
  3. Test Integrations: Verify that the collected information is properly accessible in your rule-based chatbot flow and any connected systems 📝

Test, test and test again! ✅

In summary...

AI Agents provide a powerful way to enhance your chatbot with intelligent conversation capabilities while maintaining seamless integration with your existing flows. The key to successful implementation lies in:

  1. Clear Instructions: Detailed guidance on agent behaviour and data collection
  2. Proper Field Configuration: Well-defined custom fields with examples in the Instructions.
  3. Effective Conditions for Outputs: Clear criteria for returning to rule-based flows
  4. Comprehensive Knowledge Base: Relevant, up-to-date information for agent reference.

Was this article helpful?

AI Agent block

Tips to migrate from old AI Assistants to AI Agents

Contact